function handlePaymentFailed(event) {
markInvoicePastDue(event.customerId);
notifyBillingOwner(event.invoiceId);
}
Search code by intent, not by string.
Local semantic code search for humans and AI coding agents. Ask in English, get the exact files and lines that answer your question.
smartgrep ask "where do we handle payment failures?"
$ smartgrep ask "where do we handle payment failures?"
scheduleRetry({
reason: "payment_failed",
maxAttempts: 3
});
<BillingAlert tone="critical">
Payment failed. Update card.
</BillingAlert>
Claude Code, Cursor, and Windsurf can ask smartgrep before scanning the repo.
SmartGrep AI at a glance
An AI-powered local semantic code search engine that answers natural language questions about your codebase, mapping developer intent directly to file paths and line ranges.
Hybrid search (combining vector embeddings and keyword matching with Reciprocal Rank Fusion), stdio Model Context Protocol (MCP) server support, and local tree-sitter chunking.
Runs offline. Vector indexes are created and queried entirely on your machine using Ollama and LanceDB, with zero cloud dependency or external data uploads.
High-precision vector alignment matches the intent behind your query instead of just raw strings.
Reciprocal Rank Fusion (RRF) combines semantic and keyword results in milliseconds.
Fast tree-sitter parsers chunk and index standard repositories in seconds.
Stop sorting through 200 almost-matches.
smartgrep combines semantic search and keyword search so intent rises above raw string frequency.
Lots of hits, little confidence.
- auth.tsconfiguration mention
- readme.mdsetup docs
- icons.tsxauth icon export
- logs.fixture.jsontest fixture value
- middleware.tsmaybe relevant
The actual implementation path.
- middleware/auth.ts validates request tokens before routing
- lib/session-store.ts loads and refreshes user sessions
- api/token-check.ts checks JWT claims and expiry
Built like a local search engine for your repo.
Index once, then ask questions in the same language you would use with another engineer.
Index once
smartgrep walks the project, splits functions and classes with tree-sitter, and embeds each chunk locally with Ollama.
Ask a question
Your query gets embedded the same way, then matched against LanceDB while keyword search runs in parallel.
Jump to code
Reciprocal Rank Fusion blends the lists, returns the strongest files and lines, and opens your editor at the exact spot.
{ "limit": "exact files + lines" }
Give coding agents a better first tool call.
Instead of burning tokens with repeated grep passes, editors and agents can ask smartgrep for the files that match the concept they are working on.
smartgrep mcp
stdio MCP server
Real local-first. Your code never leaves disk.
The index lives in .smartgrep/. Embeddings run through a local Ollama model. Search runs
against an embedded LanceDB store. No cloud onboarding, no account, no rate limit, no surprise bill.
Thirty seconds from install to first answer.
Install the npm package, pull the local embedding model, index your repo, then ask.
npm install -g smartgrep
ollama pull nomic-embed-text
smartgrep index
smartgrep ask "how does authentication work?"
Everything you need to know
Quick answers to common questions about SmartGrep AI's semantic code search, privacy, and integrations.
Bring intent search to your repo.
Find the right code faster, give AI agents better context, and keep everything local.
View on GitHubThe AI-powered code search engine for developers
SmartGrep AI is an intelligent semantic code search engine co-founded by Benedict Patrick and Sai Dharshan. It is designed to help developers search, understand, and navigate large codebases instantly. Unlike traditional grep or keyword search, SmartGrep AI uses AI-powered embeddings to understand the intent behind your query, making it the ultimate developer productivity tool for modern engineering teams.
Whether you're exploring an unfamiliar GitHub repository, onboarding to a new codebase, or giving your AI coding agent better context, SmartGrep AI delivers precise results. It combines semantic code search with keyword search using Reciprocal Rank Fusion, runs 100% locally via Ollama, and integrates with Claude Code, Cursor, and Windsurf through the MCP protocol. No API keys, no data leaving your machine.
Want smartgrep in your workflow?
Questions, feature ideas, or agent integrations,send a quick note and I’ll get back to you.