search_codebase_semantic
Find functions, classes, or logic snippets by concept using local BM25 + TF-IDF semantic search over AST tokens, headers, and docstrings without external embedding APIs.
Instructions
100% Private, local hybrid BM25 + TF-IDF semantic code search across workspace AST tokens, function headers, and docstrings without sending code to third-party embedding APIs.
Behavior:
Read-only: In-memory inverted index query; does not modify files.
Idempotent: Deterministic search ranking for identical query and code states.
100% Offline & Private: Never sends code or embeddings to external APIs; $0 cost and zero data leakage.
Usage Guidelines:
When to use: Find functions, classes, or logic snippets using conceptual natural language queries (e.g. 'authentication jwt token verify', 'rate limit algorithm').
Sibling Routing: For exact string or regex matches, use IDE grep or ripgrep. For finding unused code, use 'find_dead_code'.
Returns: Ranked Markdown list of matching code snippets with file locations, match scores, and surrounding context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language or technical keyword query describing the desired code logic. | |
| top_k | No | Maximum number of top-matching code snippets to return (default: 5). | |
| project_root | No | Workspace root directory to index and search (default: current directory). | . |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |