What You’ll Learn
By the end of this guide, you’ll understand how to:- 📖 Auto-generate API documentation from your code
- 🔐 Control documentation access (public, authenticated, admin)
- 🔍 Add semantic search to your docs
- ✍️ Use AI to write better documentation
- 🔄 Keep docs in sync with code changes
- 📊 Deploy documentation to production
Understanding Documentation in Conductor
What’s the Difference?
Docs (plural) = The infrastructure- The agents in
agents/docs/that generate documentation - Production tools you configure and keep
- Part of your application infrastructure
- The actual API docs your users read
- Generated HTML/JSON/Markdown
- Served at endpoints like
/docs-public
- Docs agents = Your documentation factory 🏭
- Documentation = The products it manufactures 📄
Step 1: Verify Your Setup
Check What’s Already There
Conductor 1.8.1 includes documentation agents by default:Test the Simplest Docs Agent
Start your dev server:What you should see: Auto-generated documentation of your API endpoints!
Step 2: Configure Your First Documentation
Choose Your Documentation Type
- Public APIs
- Authenticated APIs
- Admin-Only
Customize Appearance
Test Your Configuration
Step 3: Add AI-Powered Documentation Writing
This step is optional but recommended for better documentation quality.
Why Use AI for Docs?
Thedocs-writer agent can:
- Analyze your code structure
- Write clear, helpful descriptions
- Generate usage examples
- Maintain consistent style
- Update docs as code changes
Enable Workers AI
First, ensure Workers AI is bound inwrangler.toml:
Configure the AI Writer
Create a Documentation Ensemble
Automate doc generation with an ensemble:Use the AI Writer
Step 4: Add Semantic Search
This step is optional and requires Vectorize binding.
Why Add Search?
Thedocs-search agent enables:
- Semantic search (understands meaning, not just keywords)
- Fuzzy matching (“how to athenticate” still finds “authentication”)
- Relevance ranking
- Better user experience for large docs
Enable Vectorize
Add Vectorize binding towrangler.toml:
Configure Search Agent
Index Your Documentation
Search Your Docs
Step 5: Automate Documentation Updates
Keep Docs in Sync with Code
- Git Pre-commit Hook
- CI/CD Pipeline
- Scheduled Updates
NPM Scripts
Add topackage.json:
Step 6: Deploy to Production
Build Documentation
Deploy with Wrangler
Custom Domain (Optional)
https://docs.myapp.com/publichttps://docs.myapp.com/authenticatedhttps://docs.myapp.com/admin
Common Patterns & Use Cases
Multiple API Versions
Separate Customer & Partner Docs
Internal + External Docs
Troubleshooting
Docs Not Showing
Docs Not Showing
Problem:
/docs-simple returns 404Solutions:-
Check agent is registered:
-
Verify agent name matches route:
-
Check
operation: docsis set correctly -
Review logs for errors:
Authentication Issues
Authentication Issues
Problem: Can’t access authenticated docsSolutions:
-
Configure auth in
conductor.config.ts: -
Test with auth header:
- Check auth middleware is registered
AI Writer Not Working
AI Writer Not Working
Problem: docs-writer agent failsSolutions:
-
Verify Workers AI binding:
- Check model availability in your region
-
Review AI usage limits:
- Test with simpler input
Search Not Finding Results
Search Not Finding Results
Problem: docs-search returns no resultsSolutions:
- Verify Vectorize binding configured
-
Check index exists:
-
Reindex documentation:
- Test with exact matches first
Best Practices
Documentation Maintenance
✅ Do:- Update docs when API changes
- Version your documentation
- Include code examples
- Test all examples work
- Keep docs and code in sync
- Manually write docs that can be auto-generated
- Mix different API versions in same docs
- Forget to update docs after code changes
- Expose internal endpoints in public docs
Security
✅ Do:- Separate public/authenticated/admin docs
- Sanitize examples (remove real API keys)
- Rate limit documentation endpoints
- Log documentation access
- Review docs for sensitive information
- Expose admin endpoints publicly
- Include real credentials in examples
- Skip authentication on sensitive docs
- Allow unlimited doc generation requests
Performance
✅ Do:- Cache generated documentation
- Use CDN for static docs
- Lazy-load large documentation sets
- Index incrementally
- Monitor generation times
- Generate docs on every request
- Load entire codebase for each doc
- Skip caching strategies
- Ignore performance metrics
Next Steps
Level Up Your Docs
-
Add Interactive Examples
- Include API playground
- Live request/response testing
- Code generators
-
Integrate with CI/CD
- Auto-generate on deploy
- Preview docs for PRs
- Validate doc completeness
-
Add Analytics
- Track most-viewed docs
- Monitor search queries
- Identify documentation gaps
-
Multilingual Docs
- Use AI to translate
- Maintain multiple versions
- Auto-detect user language
-
Advanced Search
- Filters by category
- Related documentation
- Suggested docs based on history
Summary
You’ve learned how to:- ✅ Use Conductor’s built-in documentation agents
- ✅ Configure public, authenticated, and admin docs
- ✅ Add AI-powered doc generation
- ✅ Enable semantic search
- ✅ Automate documentation updates
- ✅ Deploy docs to production
Related Guides
- docs Operation Reference - Complete configuration reference and advanced features
- Your First Agent - Build custom agents
- Your First Ensemble - Orchestrate workflows
- Authentication & Authorization - Secure your docs
- Deploying to Production - Go live

