Your coding agent stops grepping.
Polaris gives Claude Code, Cursor and Codex the right context from your
local codebase and docs, over MCP.
Better context. Fewer tokens: ~530 per query instead of the 10.7–15.4k a grep-and-read loop burns.
curl -fsSL https://raw.githubusercontent.com/girard-g/polaris/main/install.sh | bash Your agent reads 17 files to answer one question.
Ask it about your own docs and it greps, gets 46 matches across 17 files, then reads the biggest ones end to end. The answer was in one section. You paid for the other ten thousand tokens.
Do that sixteen times and the window is full. The agent compacts, loses the thread, and you explain what you were doing all over again.
Why not let the agent search for itself? →Same question. Two workflows.
Counters show the measured average per search in each project, not one lucky query.
docs/architecture.md
(46 matches across 17 files)$ cat docs/search.md$ cat docs/architecture.md─────────────────────────────
grep + read 0 tok
avg / search · 62 searches
→ cross-encoder-reranking §Pipeline · 0.97─────────────────────────────
polaris 0 tok
avg / search · 62 searches
Better context. Fewer tokens.
~530 tokens per query, not 12,700. Sixteen grep-and-read lookups fill a 200k context window. Polaris fits 375 in the same space. Your baseline is what varies by repo: 10.7k tokens on one, 15.4k on another, so the ratio lands between 22× and 31×.
- tokens per lookup, Polaris
- 533
- tokens per lookup, grep-and-read
- 12,726
- of a 200k context window
- 0.3% vs 6.4%
- per query
- 10.7k → 487
- searches
- 62
- saved
- $3.17
- per query
- 15.4k → 492
- searches
- 25
- saved
- $1.87
- per query
- 15.2k → 700
- searches
- 23
- saved
- $1.67
| Project | Tok / query | Searches | Saved | Ratio |
|---|---|---|---|---|
polaris 62 searches · since May 7 | 10.7k → 487 | 62 | $3.17 | ~22.0× |
polaris-ingest 25 searches · since May 8 | 15.4k → 492 | 25 | $1.87 | ~31.3× |
polaris-site 23 searches · since May 20 | 15.2k → 700 | 23 | $1.67 | ~21.8× |
Across three repos that's 110 searches and 1.34M tokens that never entered a context window. That's $6.71 at Opus input rates, about $0.06 per search. These are the
author's own repos, and the author wrote the docs being searched, so search
volume here is a floor, not a typical case. Run polaris savings on your own and report what you
get.
Measured with polaris savings across three real
projects over roughly three months of normal use. No extrapolation. The baseline
is an estimate of what the equivalent grep-and-read loop would have consumed.
Dollar figures use $5 per million input tokens, the Opus 4.7 / 4.8 / 5 input
rate, so the numbers are unchanged across those models. The baseline counts input
tokens only; the grep-and-read path also spends output-rate thinking tokens ($25
/ M) reasoning over the extra material, so the real cost gap is wider than shown.
One call. Ranked. Done.
Your agent sends one query and gets back a ranked list of the sections that answer it, not a pile of raw files to read. Underneath, Polaris indexes your markdown as both vector embeddings (via a local ONNX model) and full-text entries, runs both at query time, fuses them with RRF, and reranks with MMR for diversity. BM25 handles the lexical side; vector KNN handles semantic similarity.
Built for the way agents actually work.
Local. Private. No API key, no telemetry, no cloud round-trips, no infra to babysit. Everything runs in your process, on your machine, and stays in sync without you thinking about it. It speaks the protocol your agents already use.
Your code never leaves the machine
No API keys, no telemetry, no cloud, private repos included. Embeddings run on-CPU via a bundled ONNX model, so nothing leaves after the initial download.
Single static binary, zero dependencies
No Python runtime, no Node, no Docker. One curl | bash install drops a single binary in ~/.local/bin. polaris update upgrades it in place.
Re-indexed within ~500 ms of saving
Your agent never searches a stale snapshot. polaris watch re-indexes affected files within ~500 ms of a save; in Claude Code a PostToolUse hook does it after every edit.
MCP-native by design
Drop-in for Claude Code, Cursor, Codex and any future MCP-compatible client. polaris setup writes the .mcp.json for you and updates CLAUDE.md / AGENTS.md / GEMINI.md.
One context layer. Every agent.
One .mcp.json file is all it takes.
Polaris auto-configures Claude Code, Cursor, and Codex on first run.
Anthropic's official CLI. `polaris setup` writes the .mcp.json and updates CLAUDE.md automatically.
The MCP server is discovered through the same .mcp.json. No extra configuration in Cursor.
Works out of the box via stdio MCP. AGENTS.md is updated automatically to nudge Codex toward `polaris.search`.
{
"mcpServers": {
"polaris": {
"command": "/path/to/polaris",
"args": ["serve"]
}
}
} Free under MIT. Pro for what Markdown can't hold.
Same hybrid retrieval either way. Pro widens the index to code, PDF and .docx.
Polaris
MIT · ships today- Markdown indexing ✓
- MCP search / index / status ✓
- Hybrid retrieval (vec + BM25 + RRF + MMR) ✓
- Local-first, no telemetry ✓
- Code, PDF, .docx ingestion (polaris-ingest) ✕
- Web UI for browsing the index ✕
Polaris Pro
- Markdown indexing ✓
- MCP search / index / status ✓
- Hybrid retrieval (vec + BM25 + RRF + MMR) ✓
- Local-first, no telemetry ✓
- Code, PDF, .docx ingestion (polaris-ingest) ✓
- Web UI for browsing the index soon
Card required to start the trial. You can cancel before it ends and pay nothing.
Questions you're probably about to ask.
What is Polaris? +
A local context engine for coding agents. It indexes your project and returns, over MCP, the ranked sections that actually answer a question, about 530 tokens instead of the 10.7–15.4k a grep-and-read loop burns. The free binary indexes Markdown; Pro adds code, PDF, and .docx via polaris-ingest.
What is MCP? +
The Model Context Protocol, an open standard from Anthropic that lets AI agents talk to external tools. Polaris implements an MCP server so Claude Code, Cursor, and Codex can call it directly.
What's the difference between Polaris and Polaris Pro? +
The open-source Polaris server indexes Markdown only and is CLI-driven. Polaris Pro adds polaris-ingest for code, PDF, and .docx. A web UI for browsing the index without an agent is landing soon. Pro is available now. Start a 7-day free trial (no charge if you cancel), or buy a lifetime licence.
Does Polaris work with Claude Code, Cursor, and Codex? +
Yes. Any MCP-compatible client works.
polaris setupwrites the .mcp.json and updates CLAUDE.md / AGENTS.md / GEMINI.md automatically.Do I need an API key or cloud account? +
No. Embeddings run locally via a bundled ONNX model. Nothing is sent over the network after the initial model download.
How does Polaris compare to LangChain, LlamaIndex, or Haystack? +
Those are full RAG frameworks for building applications. Polaris is a thin, zero-config server purpose-built for the coding-agent use case: drop it next to a repo, get MCP search.
Can I use Polaris on private or proprietary code? +
Yes. Everything runs locally; there's no telemetry. The MIT license permits commercial use.
Does Polaris keep the index up to date automatically? +
Yes. When you run polaris setup in a Claude Code project, it installs a PostToolUse hook that reindexes any changed markdown file after every Write or Edit, in about 300 ms. Your agent always searches current docs, not a stale snapshot.
Can Polaris search on every prompt? +
Yes. An opt-in UserPromptSubmit hook (installed with polaris setup --search-hook) searches the index on every qualifying prompt and injects the top result as context. It adds about 1 second of latency, so it is off by default.