docbot search command performs fast searches over your indexed documentation using vector embeddings and traditional text search. It supports three search modes: semantic, exact, and hybrid.
Basic usage
- Connect to Qdrant
- Load the documentation index
- Search using hybrid mode (default)
- Display ranked results with scores and snippets
You must run
docbot index before searching. The search command queries the vector database, not the raw documentation files.Options
The search query. This is a required positional argument.Examples:
"API authentication""error codes""deployment configuration"
Path to the documentation directory. Can also be set via
paths.docs in your config file.Path to docbot config file. Defaults to
docbot.config.jsonc in your project root.Alias: -cSearch type:
semantic, exact, or hybrid.- semantic - Uses vector embeddings to find conceptually similar content
- exact - Traditional keyword/text search
- hybrid - Combines both semantic and exact search for best results
Maximum number of results to return.
Qdrant server URL. Overrides the URL in your config file.Default:
http://127.0.0.1:6333Examples
Search types
Semantic search
Uses vector embeddings to find conceptually similar content, even if the exact words don’t match:- Authentication flows
- User login
- Identity verification
- OAuth setup
- Natural language queries
- Conceptual searches
- Finding related topics
- When you don’t know exact terminology
Exact search
Traditional keyword-based search that matches exact terms:- Searching for specific terms
- Code snippets or identifiers
- API endpoint names
- Error codes or messages
Hybrid search (default)
Combines semantic and exact search, ranking results using both signals:- Finds exact matches for “API authentication”
- Also surfaces semantically related content
- Ranks by combined relevance score
- General purpose searching
- When you’re not sure which mode to use
- Most user-facing search experiences
Output format
Search results are displayed with:- Score - Relevance score (0-1 range, higher is better)
- File path - Relative path to the documentation file
- Section - The heading/section where the match was found (if applicable)
- Content snippet - First 150 characters of the matching content
Example output
Understanding scores
Search scores indicate relevance:- 0.9 - 1.0 - Excellent match, very relevant
- 0.7 - 0.9 - Good match, likely what you’re looking for
- 0.5 - 0.7 - Moderate match, may be relevant
- 0.0 - 0.5 - Weak match, probably not what you want
Scores are relative and depend on your corpus. A score of 0.6 in one documentation set might be more relevant than 0.8 in another.
Use cases
Testing search quality
After indexing, verify that search works:Finding related content
Discover pages related to a topic:Debugging indexing
If a page isn’t showing up in search:Building search UIs
Test queries that users might enter:Configuration
Set defaults indocbot.config.jsonc:
Performance
Search is very fast:- Semantic search - 10-50ms for most queries
- Exact search - 5-20ms for most queries
- Hybrid search - 20-70ms (runs both and merges results)
- Number of indexed chunks
- Query complexity
- Qdrant server resources
Troubleshooting
Error: AI_GATEWAY_API_KEY environment variable is required
Error: docs path is required
--docs or configure paths.docs in your config file.
No results found
If search returns no results:- Verify indexing - Run
docbot index --docs ./docsfirst - Check collection - Ensure the docs collection exists in Qdrant
- Try different query - Rephrase or use different search type
- Check spelling - Especially for exact search
Connection errors
If Qdrant isn’t accessible:Unexpected results
If results seem off:- Try different search type - Semantic vs exact vs hybrid
- Increase limit - See more results:
--limit 20 - Check indexing - Re-index with
--forceto rebuild embeddings - Refine query - Be more specific or use different terms
Programmatic usage
The search command is designed for CLI usage, but you can also use the Docbot API:Next steps
After testing search:- Integrate with UI - Use the Docbot server API to power search in your docs site
- Refine indexing - Adjust chunking strategy if results aren’t optimal
- Run tasks - Use
docbot runto improve documentation based on search gaps