search_codebase
Semantically search a codebase by meaning, not keywords, using natural language queries with AI reranking.
Instructions
Semantic code search with AI reranking. Finds relevant code by meaning, not keywords.
CRITICAL: Write Specific Queries
Vague queries return noise. Specific queries find exactly what you need.
GOOD (specific intent + context): • "retry logic with exponential backoff in HTTP client" • "JWT token validation and refresh flow" • "database connection pooling configuration" • "error handling for file upload timeout" • "how user permissions are checked before API access"
BAD (too vague - avoid these): • "authentication" → TOO BROAD. Try: "password hashing during user login" • "error handling" → TOO BROAD. Try: "error handling when payment fails" • "config" → TOO BROAD. Try: "database connection config loading" • "utils" or "helper" → MEANINGLESS. Describe what the util DOES.
Query Formula
[WHAT] + [WHERE/WHEN/HOW] = Good Query • "caching" → "Redis caching for API response memoization" • "logging" → "structured logging setup for request tracing"
Tips
• Include the PROBLEM you're solving, not just keywords • Mention specific technologies if relevant (Redis, JWT, WebSocket) • Follow up with file read for full context
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codebase_path | Yes | Absolute path to the codebase root directory (e.g., '/home/user/myproject') | |
| query | Yes | SPECIFIC natural language query describing what you need. Include context: WHAT you're looking for + WHY/WHERE/HOW. GOOD: 'JWT token refresh when access token expires' BAD: 'token' or 'auth' (too vague, will return noise) | |
| max_results | No | Maximum number of results to return (default: 5 (recommended), max: 10) | |
| expand_context | No | If true, include surrounding code for more context (slightly slower) | |
| file_types | No | Filter by file extensions (e.g. ['.py', '.md']). Case-insensitive. | |
| include_paths | No | Only include files whose paths contain these strings (e.g. ['src/code_rag/api', 'tests/']). |