Your AI coding assistant starts every session with amnesia. Vectr gives it a structural map, a symbol lookup, and working memory that persists across sessions — via MCP, automatically, 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, # writes MCP config. Ten tools available. ✓ Passport built — 247 tokens, structural map ready ✓ Indexed 847 files → 14,523 chunks (9m 12s) ✓ Symbol graph: 6,841 symbols, 22,104 edges ✓ MCP ready at http://localhost:8765/mcp
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 when the session ends, the AI offloads its working notes to Vectr. Next morning, one call brings it back to exactly where it left off — key files, edge cases found, what's still missing. The context window clears. The knowledge doesn't.
Humans don't memorise codebases — they recall intelligently. Vectr applies the same principle to LLMs.
targeting/segment/evaluator.go:45 — no code content, no tokens wasted.VECTR_EMBED_MODEL=<hf-model-id> for any sentence-transformers compatible model.localhost:8765/mcp. Map, locate, search, remember, recall, evict, snapshot. Any MCP-compatible tool — Cursor, Claude Code, Windsurf — connects with two lines of JSON config.vectr_remember offloads a working note — key files, edge cases found, what's still missing — to a SQLite store. vectr_recall retrieves it next session. The AI picks up exactly where it left off without re-reading code.vectr_evict_hint lists every retrieved chunk with its estimated token cost and a <50ms recall guarantee. The context window stays usable, not full.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 MCP config for Cursor and Claude Code. The embedding model runs locally. No API key required for search — only for the one-time passport build.First run downloads the embedding model (~440MB). Subsequent startups take seconds.
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 # 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 exactly where it left off. No files re-read. No symbols re-grepped.| 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 |