Your AI code editor forgets everything. Vectr doesn't. Semantic search + persistent memory over your codebase — via MCP, zero config, the moment you open a workspace.
# No config. No API key. Just run. pip install git+https://github.com/swapnanil/vectr cd /path/to/your/project vectr start # Indexes workspace + builds symbol graph in background. # Writes MCP config. 12 tools available. ✓ Indexed 847 files → 14,523 chunks (9m 12s) ✓ Symbol graph: 6,841 symbols, 22,104 edges ✓ MCP ready at http://localhost:8765/mcp → Open your AI editor and ask about the codebase to build the structural map on first vectr_map call
On a codebase with 40,000 files, the AI runs rg -l "authenticate", gets 200 results, reads 8 complete files — 12,000 tokens gone for one query. And the next session, it starts over from zero: no memory of what it found, no record of what's still missing.
Vectr replaces the grep-then-read loop with three knowledge layers. A structural map gives the AI a 300-token overview of the entire codebase at session start. A symbol graph answers "where is X defined?" without reading any code. A content index returns the exact function body only when needed.
And as discoveries happen, the AI saves working notes to Vectr. Next morning, one vectr_recall() brings it back to exactly where it stopped — key files, edge cases, what's still missing. The conversation is gone, but the knowledge survived the gap.
Humans don't memorise codebases — they recall intelligently. Vectr applies the same principle to LLMs.
vectr_map with no cached passport, Vectr returns raw metadata and the CLAUDE.md that vectr init wrote prompts the editor to write a 300-token structural summary and save it with vectr_map_save. After that, every session opens with the full picture — module purposes, tech stack, entry points, domain vocabulary — without reading a single file.targeting/segment/evaluator.go:45 — no code content, no tokens wasted.vectr_map call with no saved passport, Vectr returns raw directory metadata and prompts the AI editor to write a structural summary. The editor calls vectr_map_save to store it. Vectr makes no LLM calls at any point — the AI editor uses its own API access for this one step.VECTR_EMBED_MODEL=<hf-model-id> for any sentence-transformers compatible model.localhost:8765/mcp. Map, locate, search, remember, recall, evict, snapshot, forget. Any MCP-compatible AI code editor connects with two lines of JSON config.vectr_remember saves a working note — key files, edge cases found, what's still missing — to a SQLite store. Notes survive /compact and new sessions. vectr_recall retrieves them in <50ms, verbatim, any time. If referenced files changed since the note was written, recall automatically flags them with a [STALE] warning so the AI knows to re-verify before acting.vectr_evict_hint lists every retrieved chunk with its estimated token cost and a <50ms re-retrieval guarantee — the AI never needs to re-read those files.vectr_locate finds where a function is defined — file, line, kind — without returning any code content. vectr_trace follows the call graph: who calls this, what does this call. Navigate before you read.vectr_map returns a plain-English structural overview: module purposes, tech stack, entry points, domain vocabulary. One call at session start means the AI already knows where everything lives before asking a single question.vectr start. Vectr detects your git root, indexes the workspace, and writes config files for Claude Code, Cursor, VSCode/Copilot, and Windsurf automatically. The embedding model runs locally — no API key required anywhere. See the README for the full list.First run downloads the embedding model (~440MB). Restart your AI editor once after vectr start — the installed CLAUDE.md will guide it through the first-session passport setup automatically.
docker-compose up api and you're indexing.# Option A — pip install pip install git+https://github.com/swapnanil/vectr cd /path/to/your/project vectr start # Option B — Docker git clone https://github.com/swapnanil/vectr docker-compose up api # Either way: stop and restart on a different workspace vectr restart --path /path/to/other/project # Write CLAUDE.md + .mcp.json without starting the server vectr init # Clear working memory after a large refactor vectr forget --path . # Search from the terminal vectr search "JWT token validation"
What an AI assistant's session looks like with Vectr — from cold start to end-of-day handoff.
# 1. Structural overview — free, ~247 tokens vectr_map() → "Go DSP ad server. targeting/ (audience matching), bidder/ (bid logic), tracker/ events. Entry: bidder/pipeline.go:RunBidPipeline" # 2. Recall yesterday's notes vectr_recall() → "[HIGH] Entry: EvaluateSegments() in targeting/segment/evaluator.go. Missing tests for nil visitor_id case." # 3. Find the symbol — no code read yet vectr_locate("EvaluateSegments") → [function] EvaluateSegments targeting/segment/evaluator.go:45
# After implementing, before closing vectr_remember( "Segment targeting done. EvaluateSegments in evaluator.go:45. Added nil guard at line 61. Still need: integration test for multi-segment visitor with expired segments.", tags=["segment-targeting", "wip"], priority="high" ) → "Stored note #4. You can safely drop related code chunks from context." # Vectr tells the AI what to drop vectr_evict_hint() → "Vectr has 6 chunks (~3,840 tokens) indexed. You can safely drop: targeting/segment/evaluator.go [lines 40-110] bidder/auction.go [lines 88-134] Recall latency: <50ms. Nothing will be lost."
Two-phase benchmark: Phase 1 explores and stores notes; Phase 2 opens cold, calls vectr_recall(), and implements. Vanilla Phase 2 re-reads from scratch.
custom_component, vanilla produced 0 bytes after 51 tool calls. Vectr produced a complete 5-file implementation. On route_policy: both working, but vectr was 3× cheaper and 2.4× faster.vectr_recall() at Phase 2 start returns structured notes in ~200 tokens, replacing hundreds of re-discovery tool calls. The AI picks up mid-thought: no files re-read, no symbols re-grepped. On Apache Camel, this dropped Phase 2 tool calls from 135 to 38.| Task | Vanilla P2 | Vectr P2 | Cost Δ | Tools Δ | Output |
|---|---|---|---|---|---|
| custom_component | $0.56 · 134s · 51 tools | $0.36 · 195s · 11 tools | −35% | −78% | 0 bytes (failure) vs 9,398 bytes (5 files) |
| route_policy | $1.15 · 430s · 59 tools | $0.35 · 177s · 16 tools | −70% | −73% | both 280-line impl |
| type_converter | $0.48 · 187s · 25 tools | $0.20 · 86s · 11 tools | −57% | −56% | both working |
| Totals (Camel) | $2.19 · 751s · 135 tools | $0.92 · 458s · 38 tools | −58% | −72% | −40% input tokens |