SuperAPI AI Directory

vectr

Semantic codebase search and persistent working memory: hybrid dense and BM25 search over AST-aware chunks, a symbol graph and notes that survive restarts.

Open website

About this tool

Purpose

Vectr targets AI code editors and addresses two recurring costs: editors repeatedly reading files they read yesterday, repeatedly searching for symbols they already found, and losing the exact function signatures discovered earlier when a session is compacted. Vectr handles both retrieval and working memory in a single local daemon.

Main capabilities

  • Code-aware retrieval: Uses tree-sitter to parse files and split them along function, class, and method boundaries, avoiding truncation in the middle of logic; combines symbols and the call graph with hybrid ranking of dense semantics plus BM25. Describe behavior in natural language to retrieve an entire function in a single call, instead of relying on grep loops and repeated blind file reads.
  • Optional local embedding model: Uses ibm-granite/granite-embedding-english-r2 by default, runs on the local CPU, and can be overridden; natural language queries can map to code symbols, for example "JWT verification" can find verify_jwt_token; exact symbol names are handled by BM25.
  • Symbol graph: Extracts and stores call edges, import chains, and HTTP routes (Flask, FastAPI, Express, Spring). vectr_locate resolves names through a cascade of six strategies: exact match, suffix, same module, import chain, substring, fuzzy match; fuzzy results are explicitly marked as inexact to avoid giving confident wrong symbols.
  • Working memory: vectr_remember stores structured notes in SQLite and ChromaDB; vectr_recall performs semantic search over notes rather than SQL LIKE, so multi-word queries can also find relevant context. Notes are written to disk rather than kept in the conversation, so they can survive /compact and new sessions.
  • Triggered delivery: The daemon deterministically checks each note's conditions at lifecycle points, with a per-session trigger ledger and injection budget, so notes reappear when applicable and do not trigger repeatedly within the same time window.
  • MCP protocol: Provides 23 tools over HTTP, and any MCP-compatible AI code editor can connect without a plugin.

Usage

Requires Python 3.14 or later. Installation examples: on macOS, brew install python@3.14 can be used; on Ubuntu/Debian, run sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt install python3.14 python3.14-venv; on Windows, go to python.org/downloads. Then pip install, and run vectr start. The command returns immediately, indexing proceeds in the background, and vectr status can be used to check progress; on first run the embedding model is downloaded once (about 290 MB). vectr start automatically writes the editor's MCP configuration, and restarting the editor once makes it take effect.

A Docker option is also provided (exposing port 8765), suitable for CI and servers, but Docker does not automatically write the IDE configuration file, so local installation is recommended for IDE integration.

For clients and hosting platforms that start the server as a subprocess and speak MCP over stdin/stdout, the stdio transport can be used: no port, no daemon, a single foreground process communicating with newline-delimited JSON-RPC 2.0 frames; initialize and tools/list respond immediately, while embedding model loading and initial indexing proceed in a background thread, and previously initiated tools/call requests receive a graceful "still starting" response. --memory-only and --search-only behave the same as vectr start.

Editors whose configuration paths are listed include Claude Code (.claude/settings.json), Cursor (.cursor/mcp.json), VS Code / GitHub Copilot 1.99+ (.vscode/mcp.json), Windsurf (~/.codeium/windsurf/mcp_settings.json), Continue.dev (.continue/config.json), and Codex CLI (project-level .codex/config.toml, automatically written by vectr start). On first run, Codex prompts once each to trust the project and to trust the hook command, which the user needs to accept once.

Applicable scenarios and limitations

The cost data provided: on a 182-file Python repository, using vectr_recall recalls 3 notes as one tool call at about 360 tokens; re-deriving the same three facts with grep plus Read takes about 2,060 tokens and six tool calls, i.e. about 5.7x fewer tokens and 6x fewer tool calls, with latency under 50ms. On a Java corpus of 5,856 files, a previous run measured implementation cost -58%, implementation tool calls -72%, and wall-clock time -39%. The research phase costs more because storing rich code snippets produces output tokens (+94%), reaching break-even after note reuse across about 8 tasks.

On limitations: for single-point lookups in small, already-familiar repositories, grep is cheaper and faster; the material states that Vectr's median cost across 5 single-fact tasks is 60% more tokens, and a vectr_search round trip takes 1.7 to 3.6 seconds versus about 28ms for grep. Its advantages lie in the number of tool calls, answer completeness, and reuse of working memory. Automatic eviction and reminder banners also consume tokens: a persistent re-fetch footer is about 27 tokens, a light hint is about 89 tokens, and an escalated action-required banner is about 480 to 535 tokens.

Memory import: vectr memory import can import memories already on disk into the working memory store. Without --path, it traverses the default candidate files in the workspace root: MEMORY.md, CLAUDE.md, AGENTS.md, .cursorrules, .github/copilot-instructions.md; a repeatable --path can point to other files or directories (directories are searched recursively for *.md and *.mdc). Source files are split by Markdown heading boundaries, and headings inside fenced code blocks and HTML comment blocks are skipped. --dry-run is supported to preview the entries that will be created. Imported notes carry the tag triple src:, src-sha:, src-lines:, and re-importing an unchanged file does not create a new note; the source is marked auto by default, and notes whose body contains mandatory-rule keywords (MUST, MUST NOT, NEVER, ALWAYS, DO NOT, DON'T, REQUIRED, FORBIDDEN) are classified as directive and escalated to provenance="agent".

Regarding automatic memory delivery: it depends on the host exposing session hooks; on hosts that do not expose them, all tools remain available on demand over MCP.

Regarding the evidence for effectiveness, the material cites the paper "Delivery, Not Storage: Cue-Anchored Working Memory as a Harness Property for Coding Agents" (arXiv:2607.20972) and gives controlled evaluation results: even when the store was preloaded with knowledge directly relevant to the task, the agent performed 0 memory operations across 114 turns; in runs equipped with injection, deterministic injection delivered every time, with zero false positives in the trigger evaluation audit log; under repeated compaction, ten facts existing only in the conversation were missing 106 times out of 108 forced compactions, while the same ten facts injected from harness-owned storage arrived intact 138 times out of 138 compaction recoveries. Public results are stored in benchmarks/. The material does not currently provide the remaining pricing, platform support, or usage results.