Your codebase, indexed.
Your AI, grounded.
Nothing leaves the machine.
Open Context Engine turns any repo into a searchable knowledge base for AI — hybrid semantic + keyword retrieval, AST-aware chunking, and a code graph, served to Claude, Cursor, or its own coding agent over MCP. Local-first, MIT core.
Open Context · code-native agent index 12,481 chunks · hybrid approvals suggest › where do we validate webhook signatures? ✓ codebase-retrieval webhook signature validation · 0.3s ✓ read-file billing/src/verify.ts:41-63 · 0.1s Signatures are verified in verifySignature() — HMAC-SHA256 over id.timestamp.payload with a constant-time compare. Called from the webhook route before any parsing: ╭── ts billing/src/verify.ts │ export function verifySignature(sig, raw) { │ const mac = hmac(secret, raw); │ return timingSafeEqual(mac, sig); ╰── 1 step · 2 tools · 4,120→96 tok · 3.8s › ▍
Retrieval that ranks like it means it
One query fans out across dense vectors and BM25, fuses with reciprocal-rank fusion, reranks, then expands along the code graph — so callers and callees ride along with every hit.
Hybrid search
Vector similarity and porter-stemmed keyword search run together and fuse — semantically relevant and lexically precise, in one ranking.
0.977AST-aware chunking
Tree-sitter splits code along real boundaries — functions, classes, methods — across TypeScript, Python, Go, Rust, Java, C#, C, C++, Ruby, PHP, Kotlin, and Swift.
13 langsCode graph expansion
Import, call, and inheritance edges are extracted at index time. Top results pull in their callers and definitions automatically.
3 edge kindsStreaming stages
Keyword hits stream back before the query embedding round-trip even starts. UIs paint first results in milliseconds and refine as stages land.
<5ms firstMeasured, not guessed
A committed gold set scores every ranking change: recall, MRR, nDCG, context-recall — with before/after deltas in CI. Run oce eval on your own repo.
A coding agent that asks before it acts
Bare oce opens a full agent REPL grounded in your index — plans its steps, delegates broad research to sub-agents, and shows a diff preview with an approval prompt before any edit or shell command runs.
Approvals, three speeds
Default asks on every mutation. --auto-edit lets file edits through and still gates shell. --full-auto for containers. Workspace policies cap all of it.
┌─ edit src/auth.ts ─────────────── │ - return user.length > 0; │ + return validateSession(user); └────────────────────────────────── approve? [y]es · [a]lways · [n]o: ▍
Context that survives long sessions
History over budget gets condensed by the model into a context note — decisions and file paths survive, raw tool dumps don't. Sessions persist; --continue picks up where you left off.
✂ compacted 31 messages into a context note › /plan ✔ find the double-charge path ▸ add idempotency key to retries ○ backfill test for webhook replays
Fully local, provably
Air-gapped is a supported mode, not a degraded one. Every stage of the stack has an in-process or self-hosted option — no API key anywhere in the loop.
| stage | cloud option | fully local option | |
|---|---|---|---|
| Embeddings | Voyage · OpenAI | in-process ONNX or Ollama | ✓ offline |
| Keyword search | — | SQLite FTS5, always local | ✓ offline |
| Reranking | Voyage · Cohere | in-process cross-encoder | ✓ offline |
| Agent LLM | Anthropic · OpenAI · Google | Ollama / any OpenAI-compatible | ✓ offline |
| Index storage | — | local SQLite + sqlite-vec | ✓ offline |
One embedding bill for the whole team
Index once in CI, publish the artifact to storage you control — S3, GCS, a shared drive — and every teammate pulls it. Only their local diff re-embeds. A content-hash cache means identical code never bills twice.
Push from CI
$ oce push-index s3://acme/oce/main.db.gz Published: 12,481 chunks · 1,904 files · commit ab12cd34
Pull everywhere
$ oce pull-index s3://acme/oce/main.db.gz Installed team index. Reconciled: 3 files re-embedded, 1,901 reused from the artifact
Built to pass procurement
Org-signed policies your developers can't loosen. A hash-chained audit log where tampering is detectable, not deniable. Offline Ed25519 licenses that verify without phoning home.
Policy locks
Commit a policy file: disable shell, pin command allowlists, force local-only embeddings, exclude paths. Team orgs get Ed25519-signed locks that flags can't override.
Tamper-evident audit
Every run, tool call, and MCP invocation appends to a hash chain. oce audit --verify pinpoints any alteration, deletion, or reorder. Local file — your data stays yours.
Sandboxed by default
Workspace containment on every file surface, scrubbed environments for shell commands, credential files blocked from the index outright. Zero telemetry — verifiable in the MIT source.
Speaks MCP natively
Six retrieval and symbol tools over stdio for Claude Desktop, Claude Code, and Cursor — or a shared Streamable-HTTP endpoint with bearer auth for the whole team. A VS Code extension ships the same engine with chat, edit review, and index health.
Claude / Cursor
{ "mcpServers": { "open-context": {
"command": "oce",
"args": ["mcp"] } } }Team endpoint
$ oce mcp --http --auth-token $TOKEN listening on http://127.0.0.1:8940 bearer auth · /health · watching
Free for individuals. $25 per seat for teams.
The engine is MIT — index, search, MCP, and the agent are free forever. Teams pay for shared indexes, the embedding cache, policy locks, and multi-repo search.