Semantic Vector Search
Describe what you're looking for in natural language. vecgrep embeds code chunks and finds semantically related results — not just text matches.
Index once, search with plain English. Local-first vector embeddings, hybrid keyword+semantic search, and an MCP server for your AI assistant — all powered by Ollama.
vecgrep init
vecgrep indexvecgrep uses structural boundaries where available and a lossless generic fallback everywhere else, embeds each chunk via Ollama, and stores vectors in VecLite — all locally under ~/.vecgrep/projects/.
vecgrep search "error handling in HTTP middleware"Ask in plain English. Hybrid mode blends semantic vector similarity with BM25 keyword matching. Filter by language, file pattern, directory, or line range.
claude mcp add vecgrep -- vecgrep serve --mcpExpose your index to any MCP-compatible AI assistant. Claude, Cursor, and others can search your codebase semantically — no copy-paste required.
# Index the current project (incremental — only changed files)
$ vecgrep index
Indexing 247 files...
✓ 2,126 chunks embedded
✓ 1,638,752 vectors stored in VecLite
Done in 14.2s
# Search with natural language
$ vecgrep search "database connection pooling"
Results (hybrid mode, top 5):
0.68 internal/db/pool.go:42-68
func (p *ConnectionPool) acquire(ctx context.Context) (*Conn, error) {
p.mu.Lock()
defer p.mu.Unlock()
select {
case conn := <-p.free:
...
0.61 internal/db/pool.go:112-135
func (p *ConnectionPool) release(conn *Conn) {
p.mu.Lock()
defer p.mu.Unlock()
...
0.53 internal/config/resolution.go:88-104
// resolveDatabaseConfig merges project and global DB settings
...
# Find similar code by chunk ID, file:line, or raw text
$ vecgrep similar --file-location internal/search/search.go:50
# Open the full-screen terminal workspace
$ vecgrep studioTraditional cloud-based code search tools require uploading your source code to a server. vecgrep runs entirely locally — Ollama generates embeddings on your laptop, vectors are stored under ~/.vecgrep/, and no telemetry is collected. For proprietary or sensitive codebases, this is the difference between "can we use this?" and "legal will never approve this."
grep finds exact strings. vecgrep finds meaning. Search for "database connection pooling" and get results about ConnectionPool.acquire() — even if those exact words never appear together. The hybrid mode blends both approaches so you never miss a keyword match either.
The MCP server turns vecgrep into a semantic search backend for your AI assistant. Instead of manually pasting files into a chat, Claude and Cursor query your index directly — vecgrep_search, vecgrep_similar, vecgrep_overview, and 8 more tools are available out of the box.
| Feature | grep / ripgrep | vecgrep |
|---|---|---|
| Match by meaning | ✗ text patterns only | ✓ semantic vectors |
| Natural language queries | ✗ | ✓ plain English |
| Keyword + semantic blend | ✗ | ✓ hybrid mode |
| Language-aware chunking | ✗ line-based | ✓ structural where available, lossless fallback otherwise |
| Filter by language/type/dir | limited | ✓ full metadata filters |
| Similar code discovery | ✗ | ✓ vecgrep similar |
| AI assistant integration | ✗ | ✓ MCP server |
| Incremental re-indexing | ✗ | ✓ file-hash detection |
| Local-first embeddings | N/A | ✓ Ollama default |
| Terminal UI | ✗ | ✓ Studio TUI |
vecgrep ships a Model Context Protocol server that gives AI assistants semantic access to your indexed code. Instead of pasting files into a chat window, your assistant queries the index directly.
# Add vecgrep to Claude Code
claude mcp add vecgrep -- vecgrep serve --mcp
# Or configure manually in your MCP client
{
"mcpServers": {
"vecgrep": {
"command": "vecgrep",
"args": ["serve", "--mcp"]
}
}
}11 MCP tools available: vecgrep_search · vecgrep_index · vecgrep_init · vecgrep_status · vecgrep_similar · vecgrep_delete · vecgrep_clean · vecgrep_reset · vecgrep_overview · vecgrep_batch_search · vecgrep_related_files
| Provider | Default Model | Dimensions | Type |
|---|---|---|---|
| Ollama (default) | nomic-embed-text | 768 | Local · free |
| OpenAI | text-embedding-3-small | 1536 | Cloud · API key |
| Cohere | embed-v4.0 | 1536 | Cloud · API key |
| Voyage AI | voyage-code-3 | 1024 | Cloud · API key |
Switch providers with a single config command — then run vecgrep index --full. → Provider configuration details
No. vecgrep uses Ollama with nomic-embed-text by default, which runs efficiently on CPU. Embedding generation is a one-time cost per indexing run — search itself is pure vector similarity and is instant on any machine.
grep and ripgrep find exact text patterns. vecgrep finds semantically related code — you describe what you're looking for in natural language and get results that match the meaning, not just the text. The hybrid mode also blends BM25 keyword matching so you never lose exact-match capability.
No. With the default Ollama provider, embeddings are generated locally and vectors are stored under ~/.vecgrep/projects/. Nothing leaves your machine. Cloud providers (OpenAI, Cohere, Voyage AI) are optional and only activated when you explicitly configure them.
Any client that supports the Model Context Protocol, including Claude Code, Cursor, and custom MCP-compatible clients. The server exposes 11 tools for searching, indexing, status inspection, similar-code discovery, and codebase overview.
vecgrep recognizes Go, JavaScript/TypeScript, Python, Vue, Rust, Java/Kotlin/ Scala, C/C++/CUDA, C#/VB, Ruby, PHP, Dart, Swift, Lua, Elixir, common web containers, Terraform/HCL, and text formats. Recognition provides stable language metadata and filters. Built-in structural heuristics currently cover Go, JavaScript/TypeScript, Python, and Rust; fresh codemap exports provide stronger symbol boundaries. Every other language uses bounded generic chunks, so recognition never overstates parser or call-graph support.
vecgrep hashes every file on each vecgrep index run. Files whose hash hasn't changed are skipped — only new or modified files get re-embedded. A full rebuild (vecgrep index --full) is only needed when you change embedding model, dimensions, or chunking profile.
Yes. vecgrep is MIT-licensed and available on GitHub. Contributions, issues, and feature requests are welcome.
# Homebrew (recommended)
brew install abdul-hamid-achik/tap/vecgrep
# Or build from source
git clone https://github.com/abdul-hamid-achik/vecgrep.git
cd vecgrep && task build
# Then index and search
cd /path/to/your/project
vecgrep init && vecgrep index
vecgrep search "what you're looking for"Quick Start Guide · CLI Reference · Studio TUI · GitHub
MIT-licensed · open source · contributions welcome