The current Rust workspace uses asupersync, in-process kernel calls, CLI and MCP stdio. It no longer builds an HTTP listener, network proxy, or Tokio runtime. Start with cargo build -p cortex-daemon, cortex setup, then cortex mcp --agent <name> or cortex op <operation>. cortex serve is an optional bounded maintenance worker, not a server.
The Control Center, HTTP SDKs, downloads, and HTTP/service instructions below describe the earlier tagged product and are not compatible with this source runtime. No external installations or existing memory databases are migrated by changing this repository. See ARCHITECTURE.md and crate contracts for the current API and cancellation boundaries.
The local operator can register a logical source, then submit normalized observations without any model-generated diary:
cortex capture register --source worklog --scope project --role tool_report
printf '%s\n' '{"event_key":"run-123","text":"Observed tool output, retained verbatim","observed_at":null}' |
cortex capture tail --source worklog --generation session-1 --offset 0The receipt reports next_offset and accepted source IDs. Continue from that byte offset; a trailing partial JSONL record is not acknowledged. capture put accepts one JSON observation. capture get --id <source_id> returns its exact retained text. capture disable --source worklog revokes the source; capture enable explicitly reauthorizes it. --quiet suppresses successful output for capture-only adapters. Registration is per local principal, and normalized event bodies cannot supply their own actor or grant.
File intake routes the state-file, project-memory and configured custom-source indexers through the same transactional observation capture. Register each file using file:<canonical absolute path> as its source key before importing it:
cortex capture register --source 'file:/absolute/canonical/path/notes.md' --scope project
cortex capture file --path /absolute/canonical/path/notes.md --quietFile capture preserves the entire UTF-8 payload, including frontmatter, whitespace and the tail. Files exceeding the registered limit or the 1 MiB file ceiling fail without acknowledging a prefix. Revision keys include file metadata and a content digest; unchanged retries replay their receipts. File modification time is retained as observed_at, not interpreted as the time an assertion became true. Indexer errors propagate; earlier files committed before a later failure can be safely replayed. Legacy filename-only aliases are not automatically merged or rewritten because their provenance can be ambiguous.
The native cycle now includes registered-source inventory, resumable bootstrap, exact any-cue retrieval, reverse-indexed active needs, qualified delivery and opt-in scoped associations:
cortex capture inventory
cortex capture bootstrap --revision '<revision-from-inventory>' --max-sources 16 --max-bytes 16777216
cortex capture reconcile --revision '<revision-from-inventory>'
cortex capture query --scope project --query 'retry'
printf '%s' '{"id":"current-task","scope":"project","cues":["retry"],"exclude_cues":[],"max_results":32,"max_bytes":32768,"ttl_seconds":3600}' | cortex capture subscribe
cortex capture prepare --id current-task --context context-epoch-1 --payload
cortex capture require --parent '<source-id>' --child '<source-id>'prepare without --payload returns evidence, exact source references, coverage and a delivery ID. Supply --present <delivery_id> only when the host establishes that delivery remains in the current input; use a new context epoch after compaction/restart. Pending, unavailable, denied or oversized bundles do not produce a misleading partial payload. rebuild --scope project rebuilds a bounded projection slice; later reads catch up remaining projection work. Exact source bytes survive projection replacement and retraction.
learn --scope project explicitly enables/rebuilds scoped associations. A subscription with "learned":true may add separately labeled learned candidates; literal query stays the default. learn-explain, learn-reset, assess and unassess expose attribution, sticky disable and reversible named usefulness events. Copies, delivery events and unresolved agent/tool derivatives cannot become independent learning support. A successful tool call is not automatically causal credit.
Assemblies are exact membership over existing revision rows. assemble / assembly-get / assembly-expand write and read them; learn-event, learn-retract and learn-erase keep the learning ledger attributed and reversible. routes-rebuild turns on cue routes for a scope; routes-reset turns them off; why cites the cues and training units. After that rebuild, cortex op query / orient compile an evidence-closed assemblies section (expand asm:<id>), and live hooks / SessionStart can inject the brief without a tool call. Ranking does not change what the members are. Default query and lens stay exact unless a need opts into learned after that rebuild.
Live host events use cortex hook <kind>. The plugin always spawns that command. The kernel reads CORTEX_CAPTURE if set, otherwise $CORTEX_HOME/capture.json (written by cortex setup). Opted-in events run observation capture-and-prepare; other events stay silent. CQR stays on cortex hook-boot, cortex op, MCP, and the process() library seam. host-register, host-put, host-tail and host-cycle are the operator/flagged forms of the same host subset. Origin policy is operator-owned, never a claim in captured prose. A fully specified sidecar accepts grant, host_version, session, generation, origins, context, and optional event_key/present. File-tool and compaction flags are native_file_results, native_compactions, native_finals, or native_hooks for the whole matrix.
The native Claude user/Bash/file-tool shapes support a static operator opt-in:
printf '%s\n' '{"key":"claude-native","scope":"project","host_version":"2.1.260","adapter_version":"claude-code-2.1.260-v1","max_bytes":65536,"live":true,"history":true}' | cortex capture host-register
export CORTEX_CAPTURE='{"grant":"claude-native","host_version":"2.1.260","native_user_prompts":true,"native_bash_results":true,"native_file_results":true,"native_compactions":true}'Set that environment only in an approved hook runner; no host configuration is installed here. The bridge derives session, stable event identity and fresh context identity from native invocation metadata. Other tools stay on the existing hook path. Native prompt_id corresponds to historical promptId, not transcript uuid. Structured Bash and file-tool reports are preserved rather than reduced to a preview. PreToolUse prepares from the tool input without storing the request. PreCompact records a silent checkpoint. Known non-evidence transcript control records receive transactional metadata markers, so they neither stall backfill nor reinforce memory. Unknown shapes still block the cursor. Stop does not carry the final-message UUID: live final capture still needs an explicit trusted identity, or subsequent transcript catch-up.
These are attributed observations, not automatic verified facts or new CQR witnesses. Existing semantic CQR APIs remain separate. No host configuration is installed. Broader installed-host compatibility, held-out task quality, model-token savings, power-loss durability and a release-performance acceptance band remain unverified.
Private local memory for your AI tools.
Install once. Your tools stop starting from scratch.
Download · Connect your tools · Architecture · What's new · Roadmap
🔒 Private by default: localhost only, data never leaves your machine
🔗 One memory, every tool: HTTP and MCP, same brain, no per-tool silos
📊 Prove it works: token savings, recall quality, and Monte Carlo projections
Get to the first memory moment before learning daemon internals.
Use the latest desktop installer, or build the 0.6.0 source CLI:
git clone https://github.com/AdityaVG13/cortex.git
cd cortex
cargo build -p cortex-daemon --releaseOpen Cortex Control Center and start Cortex from the app. CLI-only users can run:
cortex servecortex status --jsonSuccess is "status": "ready". If status is needs_action or error, follow the returned nextAction / repair before continuing.
Claude Code:
claude plugin marketplace add AdityaVG13/cortex
claude plugin install cortex@cortex-marketplaceCodex:
codex mcp add cortex -- cortex.exe mcp --agent codexRestart the AI tool after changing MCP config.
From a connected MCP client, call cortex_commit, then cortex_query. From the repo, run the matching smoke script:
Windows:
powershell -ExecutionPolicy Bypass -File scripts\first-run-smoke.ps1macOS / Linux:
bash tests/scripts/first-run-smoke.shThat smoke checks status, stores one disposable local memory, and recalls it. Normal use does not require benchmark adapters, provider keys, or LongMemEval.
More tool-specific setup: Info/connecting.md.
|
Save decisions, lessons, preferences. Conflict detection is automatic. |
Clock-Quorum Recall: admit a stored row when a hard anchor matches, two clocks agree, or a strong lexical hit holds. Empty is a valid answer. Use |
Extractive identity + delta + current-truth pack. ~300 tokens served instead of ~15,000 raw. No summarizer. |
Memory tools are easy to pitch and hard to trust. Cortex starts to matter when the savings stop looking theoretical.
Cortex admits a memory. It does not guess a neighbor.
| Gate | Meaning |
|---|---|
| Hard anchor | Path, symbol, alias, entity, or citation matches |
| Two clocks | Write, truth, task, and history are independent evidence |
| Strong lexical | Quoted phrase, stem, or closed-lexicon hit — not BM25 alone |
| Empty | No shared handle → no result. That is correct |
No local embedding or reranker model. /recall/semantic is the same engine under a compatibility name.
LongMemEval quality claims are deferred. CQR is scored on honest miss, as-of windows, and determinism — see clock_quorum contracts.
Historical v0.5.0 embedding-era numbers (not the current engine)
These were measured against a 20-query set via a helper-augmented adapter while MiniLM was still on the hot path. They are not CQR scores and are not a v0.6 quality claim.
| v0.4.1 | v0.5.0 | Δ | |
|---|---|---|---|
| Precision | 55.2% | 87.5% | +32.3% |
| MRR | 69.2% | 95.0% | +25.8% |
| Top-1 hit | 90.0% | 90.0% | — |
v0.6.0 makes settings, governance, boot audits, and recall-quality measurement first-class. Full details in CHANGELOG.md.
- Settings panel: Accessibility, Appearance & Motion, Connection, Budgets, and Keyboard & Navigation
- Runtime preferences: high contrast, reduced motion, keyboard hints, and compact navigation
- Accessibility gates: stronger focus states, ARIA/live regions, contrast checks, and 375px reflow checks
- Retention classes across store, MCP, OpenAPI, export, and import
- Local endpoint budgets with stable HTTP
429/ JSON-RPC denial metadata - Budget UI in Control Center, backed by the local
budgets.toml - Boot audits plus
GET /boot/auditand the read-onlycortex_boot_auditMCP tool - Admin rollback with dry-run/apply workflow and audit events
cortex-http-pureadapter as the canonical helper-free measurement floor- Purity gates, CAS-100, and triangle judge tooling for safer quality claims (declared target, not yet measured/pinned — no claim:
CAS-100and the triangle judge are named but have no located artifact intests/; purity gates exist attests/purity-gates/) - Clock-Quorum Recall: deterministic evidence from write, truth, task, and history clocks. No local embedding or reranker model.
- Claude plugin MCP is attach-only and no longer starts a second daemon from plugin MCP paths
- Control Center supervises the app-managed daemon and honors intentional stops
- Handler panics return JSON 500 responses, with local panic breadcrumbs
- Storage hygiene compacts FTS and keeps legacy embedding rows inert
Cortex tracks active agent sessions when clients identify themselves through cortex_boot or GET /boot?agent=NAME.
Claude Code, Codex, Cursor, and custom scripts can all be connected simultaneously. Each tracks its own session while sharing the same memory. |
| Tool | Connection | Setup |
|---|---|---|
| Claude Code | MCP (plugin) or desktop app | Plugin: claude plugin install cortex@cortex-marketplace |
| Codex | MCP | codex mcp add cortex -- cortex.exe mcp --agent codex |
| Cursor | MCP | Point MCP server at cortex mcp --agent cursor |
| Factory Droid | MCP | cortex mcp --agent droid |
| Aider | CLI / HTTP | cortex boot --agent aider |
| Custom tools | HTTP | Three endpoints: /boot, /recall, /store |
| Local LLMs | HTTP / MCP | Same protocol, any runtime |
Full setup guide: Info/connecting.md
Desktop app (Control Center)
Download from the latest tagged release page. The Control Center manages daemon lifecycle for you.
| Platform | Desktop installer | Daemon archive |
|---|---|---|
| Windows | .exe (NSIS installer) |
.zip |
| macOS | .dmg |
.tar.gz |
| Linux | .AppImage / .deb |
.tar.gz |
Current release: v0.6.0.
From source
git clone https://github.com/AdityaVG13/cortex.git
cd cortex
cargo build -p cortex-daemon --releaseClaude Code plugin
claude plugin marketplace add AdityaVG13/cortex
claude plugin install cortex@cortex-marketplaceThe plugin spawns a local cortex binary over MCP stdio. If no binary is found, install one or set CORTEX_APP_BINARY, then restart the session.
Cortex enforces a single-daemon invariant: only one daemon process runs at a time.
| Mode | How it works |
|---|---|
| Desktop app | Control Center owns the daemon. Restart and monitor from the app. |
| CLI | cortex serve starts the daemon. Exits cleanly if one is already running. |
| Plugin | Attach-only MCP bridge. It connects to the running app/service daemon and does not silently spawn a second daemon. |
Default bind: 127.0.0.1:7437. Non-loopback binds require TLS. Auth token at ~/.cortex/cortex.token.
If using the Control Center, manage the daemon from there. Do not run a second cortex serve alongside it.
After installing, verify the product path:
cortex status --jsonWindows:
powershell -ExecutionPolicy Bypass -File scripts\first-run-smoke.ps1macOS / Linux:
bash tests/scripts/first-run-smoke.shDevelopment build verification
# Daemon contract tests
cargo test -p cortex-tests
# Desktop test suite
npm --prefix desktop/cortex-control-center test
# Lifecycle smoke test
npm --prefix desktop/cortex-control-center run verify:lifecycle:dev
# Security audit
npm audit --omit=dev --audit-level=high
cargo audit| Document | Covers |
|---|---|
| Docs index | All product and operator docs |
| Connecting | Setup, MCP, HTTP, auth, troubleshooting |
| Architecture | Store, CQR, boot, schema, crate map |
| MCP Tools | All 29 MCP tool definitions and parameters |
| Roadmap | What shipped and what's next |
| Security | Threat model, auth rules, vulnerability reporting |
| Team mode | Shared-server setup for engineering teams |
| Contributing | Development setup and PR guidelines |
CLI reference
| Command | Description |
|---|---|
cortex serve |
Start the daemon |
cortex mcp |
MCP stdio bridge to the running daemon |
cortex --help |
Full command reference |
cortex doctor |
Run diagnostics |
cortex paths --json |
Show file and port paths |
cortex status --json |
Local memory readiness and next action |
cortex rebuild-anchors |
Rebuild derived clock projections |
cortex setup --team |
Initialize team mode and generate API keys |
cortex export |
Export data (json or sql) — not implemented in the CLI (default builds exit 1); use the daemon's HTTP GET /export endpoint (JSON format) or the desktop app |
cortex import |
Import from a previous export — not implemented in the CLI (default builds exit 1); use the daemon's HTTP POST /import endpoint or the desktop app |
cortex admin rollback --session-id <id> |
Soft-delete a session's memory writes (dry-run default; --apply to persist) |
Cortex defaults to localhost-only access with bearer-token auth.
Full threat model, auth rules, and vulnerability reporting: Info/security-rules.md
How much disk space does Cortex use?
The daemon binary is ~30 MB (declared target, not yet measured/pinned — no claim; build-profile-dependent). The SQLite database grows with usage. Clock-Quorum Recall does not download or load a local model. Older installs may still have leftover files under
~/.cortex/models; they are unused.
Can multiple agents write to Cortex at the same time?
Yes. SQLite WAL mode handles concurrent reads and serialized writes. Each agent maintains its own session while sharing the same memory. Conflict detection handles contradictions automatically.
Does Cortex send any data externally?
No. In solo mode, Cortex runs entirely on localhost. No telemetry, no phone-home, no cloud sync. Team mode sends data only to the configured team server over your network.
What happens if the daemon crashes mid-session?
The MCP proxy detects daemon death and restarts automatically (bounded to 4 attempts with 250 ms × n backoff, pinned by `tests/contracts/mcp_proxy_durability.rs`). SQLite WAL mode ensures no data corruption. Sessions survive transient crashes.
How do I reset Cortex to a clean state?
Delete
~/.cortex/cortex.db and restart the daemon. A new empty database and auth token are generated. Control Center settings are preserved. No model download is required.
Built by
Support Cortex · Docs · Connecting · Security · Contributing · Code of Conduct · Changelog · MIT License





