Architecture overview
Docbot is built around three core components that work together:Vector search
Qdrant-powered semantic and exact-match search across docs and code
Blackboard
SQLite-based shared state for agent coordination and session tracking
Multi-agent system
Specialized agents for research, planning, writing, and orchestration
Vector search with Qdrant
Docbot indexes your documentation and codebase into Qdrant collections:- Docs collection: MDX files chunked by section with metadata (title, headings, navigation)
- Code collection: Source files chunked by symbol (functions, classes, types) with context
The blackboard pattern
Agents don’t pass data directly—they read from and write to a shared SQLite database called the blackboard. This decouples agent execution and provides session persistence. The blackboard stores:- Doc targets: High-level documentation goals (e.g., “document the settings page”)
- Findings: Research results from code/doc searches, tagged by relevance
- Plans: Structured outlines with sections mapped to findings
- Artifacts: Generated documentation content with version tracking
The blackboard uses an ephemeral SQLite database in the OS temp directory by default. Sessions don’t persist across runs unless you specify a custom database path.
Session state tracking
Each documentation run creates a session that tracks progress through workflow phases:- If findings exist and you ask for edits, it skips research
- If a plan exists and is approved, it proceeds directly to writing
- If artifacts exist, it treats requests as refinements rather than new work
Indexing and incremental updates
Docbot maintains a manifest file (.docbot/manifest.json) tracking file hashes and modification times. When you run docbot index:
This incremental approach means re-indexing is fast—only modified files get reprocessed.
Search and retrieval
Docbot uses a hybrid search strategy that combines three approaches:- Semantic search: Vector similarity using embeddings (OpenAI
text-embedding-3-smallby default) - Exact match: Regex patterns via ripgrep for precise identifier lookups
- Reranking: Cohere reranker scores results by relevance to the query
- Use
code_searchfor exact identifiers (function names, types, constants) - Use
semantic_code_searchfor conceptual queries (“how does auth work”) - Use
search_docsfor finding existing documentation pages
Model configuration
Docbot uses different models for different agent roles, balancing cost and quality:Tool-based execution
Agents interact with the world through tools. Each agent has access to a specific toolset:- Orchestrator: Session management, delegation, blackboard summary
- Research agent: Code/doc search, finding storage
- Planner agent: Navigation analysis, plan creation
- Writer agent: File reading, doc creation/updates, artifact storage
- User interaction agent: Approval prompts, question/answer
Example: Writer agent tools
Example: Writer agent tools
Termination and safety
Each agent has explicit termination conditions to prevent infinite loops:- Research agent: Stops after 5-8 searches or when
mark_research_completeis called (max 15 steps) - Planner agent: Stops after calling
submit_plan(max 12 steps) - Writer agent: Stops after calling
mark_writing_complete(max 20 steps) - Orchestrator: Stops after calling
finish_sessionor when all doc targets are complete (max 30 steps)