How Docbot moves through analysis, planning, execution, and review phases
Docbot follows a structured workflow that breaks documentation work into discrete phases. Each phase has specific goals and produces trackable artifacts stored in the blackboard.
Findings are tagged by type to help downstream agents understand what they represent:
code: Functions, classes, types, or other symbols from the codebase
doc: Existing documentation pages or sections
api: API endpoints, routes, or interfaces
concept: High-level ideas or architectural patterns
Each finding includes:
interface Finding { id: string // e.g., "finding-a3f2b1c4" docTargetId: string // links to the doc target this supports type: 'code' | 'doc' | 'api' | 'concept' filePath?: string // where this was found summary: string // user-facing description of what this is relevanceScore: number // 0-1, how relevant to the doc target}
The research agent is explicitly told to perform 5-8 searches and then stop. This prevents over-researching and keeps token costs predictable.
The writer agent is trained to write for non-technical users:
Focus on what users can do, not implementation details
Use Mintlify components (<Steps>, <Tabs>, <Accordion>) for structure
Avoid jargon, marketing speak, and filler phrases
Write concise, scannable content with clear headings
Example: Writer output for a settings page
---title: Settingsdescription: Configure your workspace preferences and account settings---You can customize your workspace behavior through the settings page.## Accessing settings<Steps> <Step title="Open the settings menu"> Click your profile icon in the top right corner </Step> <Step title="Select settings"> Choose "Settings" from the dropdown menu </Step></Steps>## Available settings<Tabs> <Tab title="General"> Control workspace name, language, and timezone preferences. </Tab> <Tab title="Notifications"> Manage email and in-app notification preferences. </Tab> <Tab title="Security"> Set up two-factor authentication and manage sessions. </Tab></Tabs>
Every file written becomes an artifact in the blackboard:
interface Artifact { id: string planId: string // which plan this fulfills sectionId?: string // which section (if applicable) type: 'draft' | 'final' | 'media_suggestion' content?: string // the actual MDX content filePath?: string // where it was written version: number // version tracking status: 'draft' | 'review' | 'approved' | 'written'}
This lets you track what was created, when, and which plan it came from.
The orchestrator injects session state into every decision to prevent redundant work:
// Injected before each orchestrator step[SESSION STATE]phase: planningfindings: 12plans: 0artifacts: 0targets: - settings-page: researching[/SESSION STATE]
This context helps the orchestrator decide:
Skip research if findings already exist for simple edits
Skip planning if an approved plan exists
Proceed directly to writing for minor tweaks
Avoid creating duplicate doc targets
If session state shows all targets are complete but the orchestrator hasn’t called finish_session, it receives a warning: ”🛑 ALL TARGETS COMPLETE - call finish_session NOW”. This prevents cycling.
If a tool call fails, the agent receives the error and can try a different approach. If retries are exhausted, the error bubbles up to the orchestrator, which can delegate to a different agent or skip that doc target.