code_search
Search an indexed local codebase with hybrid semantic and full-text queries to uncover existing patterns and examples for informed code review.
Instructions
Hybrid semantic + full-text search over an indexed local repository.
Embeds the query via Ollama, then runs a combined vector + FTS search with RRF reranking against the LanceDB index built by index_repo. Use this to find existing patterns, conventions, or examples in the codebase before reviewing a new implementation. Requires a running Ollama (the semantic layer is built in) and index_repo to have been run first.
Args: query: Natural language or code snippet describing what to find. root: Absolute path to the repository (must have been indexed first). k: Maximum number of results to return (default 8).
Returns: {query, root, results[{file_path, symbol, symbol_type, start_line, end_line, text, score?}]} or {"error": "..."} on failure.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"root": "<root>"
},
"name": "code_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| root | Yes | ||
| query | Yes |