smart_search
Describe code functionality in natural language to search symbols. Converts queries like 'handle BLE pairing failure' into FTS5 keywords and runs semantic embedding to find relevant results.
Instructions
Natural-language search: Ollama generates FTS5 keywords, then searches the index.
Multi-phase approach:
Translate non-English queries
Rough FTS5 search to gather sample symbols
Ollama sees those samples + query and generates FTS5 terms
Refine: Ollama checks results and course-corrects
FTS5 search with generated terms
Semantic embedding search (cosine similarity)
Score, deduplicate, format
When to prefer over search_code: When you don't know the exact keywords and want to describe what you're looking for ("how does the modem connect?", "handle BLE pairing failure").
Fallback: When Ollama is unavailable, falls back to direct FTS5 search with word-split terms from the query.
Args: query: Natural language description of what you're looking for. Be specific — 5–15 words works best. project_root: Absolute path to the project. Defaults to nearest git root. limit: Maximum number of results (default 20, max 100).
Returns: list of dicts with metadata entries (_generated_queries, _rough_queries, _translated_from) followed by symbol results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language description, 5-15 words. E.g. 'how does the modem connect?' or 'handle BLE pairing failure'. | |
| project_root | No | Project root. Auto-detected if omitted. | |
| limit | No | Maximum results (default 20, max 100). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |