Local Context Engine for Coding Agents

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.

polaris savings · ~/code/polaris-site
$ polaris savings────────────────────────────Total searches 23Tokens delivered 16.1KBaseline 350.1K────────────────────────────Tokens saved 334.1K ~21.8× cheaper
Try it on your repo
Local Private No API key No telemetry
The problem

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? →
The Demo

Same question. Two workflows.

Counters show the measured average per search in each project, not one lucky query.

Question: hybrid ranking fusion
grep + read · polaris
$ grep -rni "RRF" docs/docs/search.md
docs/architecture.md
(46 matches across 17 files)
$ cat docs/search.md$ cat docs/architecture.md─────────────────────────────
grep + read 0 tok
avg / search · 62 searches
polaris · polaris
$ polaris search "hybrid ranking fusion"search.md §Reciprocal Rank Fusion · 1.00
cross-encoder-reranking §Pipeline · 0.97
─────────────────────────────
polaris 0 tok
avg / search · 62 searches
~22× cheaper · 10,219 tok saved / search
Try it on your repo → Three commands. Your own measured number in under a minute.
The Numbers

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%
polaris ~22.0×
62 searches · since May 7
per query
10.7k 487
searches
62
saved
$3.17
polaris-ingest ~31.3×
25 searches · since May 8
per query
15.4k 492
searches
25
saved
$1.87
polaris-site ~21.8×
23 searches · since May 20
per query
15.2k 700
searches
23
saved
$1.67

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.

How it works

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.

query
vector + BM25
RRF fusion
heading boost
MMR rerank
top-k results
Why it matters

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.

PRIVACY

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.

SIMPLICITY

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.

FRESHNESS

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.

INTEROP

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.

Integrations

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`.

.mcp.json
{
  "mcpServers": {
    "polaris": {
      "command": "/path/to/polaris",
      "args": ["serve"]
    }
  }
}
Pricing

Free under MIT. Pro for what Markdown can't hold.

Same hybrid retrieval either way. Pro widens the index to code, PDF and .docx.

OPEN SOURCE

Polaris

MIT · ships today
€0 forever
  • 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
Install on GitHub →
7 days free
PRO

Polaris Pro

€20 per month
  • 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
Start 7-day free trial → or €149 once, yours permanently →

Card required to start the trial. You can cancel before it ends and pay nothing.

FAQ

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 setup writes 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.