docbot serve command starts the Docbot HTTP server without the interactive terminal UI. This is useful for running Docbot as a service, integrating with other tools, or accessing the REST API directly.
Basic usage
- Connect to Qdrant
- Initialize documentation and codebase indexes
- Start the HTTP server
- Keep running until terminated
The serve command does NOT perform indexing. You must run
docbot index first to create embeddings. The serve command only loads existing indexes.Options
Path to the documentation directory. Can also be set via
paths.docs in your config file.Comma-separated paths or globs to codebase directories. Falls back to
paths.codebase in your config file.Examples: apps/helm,packages/* or src/**Path to docbot config file. Defaults to
docbot.config.jsonc in your project root.Alias: -cEnable interactive mode (allows agent to ask questions). When false, the agent runs autonomously without human input.This setting affects how tasks submitted via API are executed.
Server port. Overrides the port in your config file.Default:
3070Qdrant server URL. Overrides the URL in your config file.Default:
http://127.0.0.1:6333Examples
Expected output
API endpoints
Once the server is running, you can access these endpoints:POST /api/task
Submit a documentation task:GET /api/task/:id
Check task status:GET /api/search
Search documentation:WebSocket /ws
Stream real-time task output:API documentation is in progress. Check the Server API reference for complete endpoint details.
Use cases
Running as a service
Use with systemd or Docker to run Docbot as a persistent service:CI/CD integration
Run Docbot in CI to automate documentation tasks:Integration with custom tools
Build custom documentation tools that use Docbot:Development and testing
Run the server for development:Interactive vs non-interactive mode
Interactive mode (default)
When--interactive=true (default):
- Agent asks for plan approval before making changes
- Tasks wait for human confirmation
- Suitable for production use where you want control
Non-interactive mode
When--interactive=false:
- Agent executes tasks autonomously
- No plan approval required
- Faster execution but higher risk
Configuration
Set defaults indocbot.config.jsonc:
Environment variables
Required
AI_GATEWAY_API_KEY- API key for the AI gateway (required for all agent operations)
Optional
QDRANT_URL- Override Qdrant URL (same as--qdrant-urlflag)PORT- Override server port (same as--portflag)
Running in Docker
Create a Dockerfile:Monitoring
Health check
The server doesn’t expose a dedicated health endpoint yet, but you can check if it’s responding:Logging
Server logs go to stdout. Redirect to a file or logging service:Troubleshooting
Error: AI_GATEWAY_API_KEY environment variable is required
Error: docs path is required
--docs or configure paths.docs in your config file.
Port already in use
If the port is taken:Connection errors
If Qdrant isn’t accessible:Server not responding
If the server starts but doesn’t respond to requests:- Check firewall - Ensure port 3070 is open
- Verify indexing - Run
docbot indexto create embeddings first - Check logs - Look for errors in server output
- Test locally - Try
curl http://localhost:3070/api/search?q=test
Graceful shutdown
The server handles SIGTERM and SIGINT for graceful shutdown:Performance
The server is lightweight and can handle:- Concurrent searches - 100+ queries/second
- Task execution - 1-5 concurrent tasks (depends on AI gateway rate limits)
- WebSocket connections - 50+ simultaneous clients
- Memory - 50-200 MB (depends on index size)
- CPU - Minimal when idle, spikes during task execution
- Network - Depends on AI gateway latency
Next steps
After starting the server:- Submit tasks - Use the API to automate documentation work
- Integrate search - Add search to your docs site
- Monitor usage - Track API calls and task success rates
- Scale up - Run multiple instances behind a load balancer