search_docs
Search project documentation and README files using semantic search to answer conceptual questions about how features work or system architecture.
Instructions
USE THIS TOOL for conceptual understanding and "how does X work?" questions. Search markdown documentation, READMEs, and code docstrings using semantic search.
PREREQUISITE: This tool requires indexing. If results are empty or you haven't indexed this session, call index_codebase(directory) first.
TRIGGER - Call this tool when the user asks:
"How does [feature] work?"
"Explain the architecture of..."
"What are the setup/installation instructions?"
"Show me the documentation for..."
"Why was this designed this way?"
Any question answered by README, CHANGELOG, or docstrings
IMPORTANT: This is NOT for finding code implementations. For code locations, use search_code. This tool searches DOCUMENTATION, not source code.
Uses HYBRID RETRIEVAL (BM25 keyword search + dense vector semantic search with Reciprocal Rank Fusion) to find conceptually relevant documentation even when keywords don't match exactly.
Do NOT use this tool for:
Finding function/class definitions (use search_code with "definition")
Finding where code is used (use search_code with "references")
Git history or commit messages (use search_history)
Args: query: A natural language question (e.g., "How does authentication work?" or "API rate limiting"). Can be conversational - semantic search handles synonyms. directory: Path to the project directory to search. top_k: Maximum results to return (default 10, max 100).
Returns: Dictionary with 'results' array. Each result includes: - content: The documentation text - file: Source file path - section: Section heading (if applicable) - line_start/line_end: Location in source - relevance_score: Hybrid search score
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| top_k | No | ||
| directory | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |