AgentStack
MCP verified MIT Self-run

Cortex

mcp-adityavg13-cortex · by AdityaVG13

Persistent shared memory and context compression for AI coding agents. Local-first Rust daemon with HTTP, MCP, and a desktop control center.

No reviews yet
0 installs
11 views
0.0% view→install

Install

$ agentstack add mcp-adityavg13-cortex

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Cortex? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Cortex Private local memory for your AI tools. Install once. Your tools stop starting from scratch.

     

Download  ·   Connect your tools  ·   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


Quick Start

Get to the first memory moment before learning daemon internals.

1. Install or build Cortex

Use the latest desktop installer, or build the 0.6.0 source CLI:

git clone https://github.com/AdityaVG13/cortex.git
cd cortex/daemon-rs
cargo build --release

2. Start local memory

Open Cortex Control Center and start Cortex from the app. CLI-only users can run:

cortex serve

3. Check readiness

cortex status --json

Success is "status": "ready". If status is needs_action or error, follow the returned nextAction / repair before continuing.

4. Connect one AI tool

Claude Code:

claude plugin marketplace add AdityaVG13/cortex
claude plugin install cortex@cortex-marketplace

Codex:

codex mcp add cortex -- cortex.exe mcp --agent codex

Restart the AI tool after changing MCP config.

5. Store and recall one memory

From a connected MCP client, call cortex_store, then cortex_recall. From the repo, run the matching smoke script:

Windows:

powershell -ExecutionPolicy Bypass -File scripts\first-run-smoke.ps1

macOS / Linux:

bash scripts/first-run-smoke.sh

That 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](Info/connecting.md).


❌ Without Cortex

Session 1  →  explain preferences Session 2  →  explain them again Session 3  →  and again, new tool Session 14  →  still explaining ~15,000 tokens wasted

✅ With Cortex

Session 1  →  store once Session 2  →  boot, already knows Session 3  →  boot, already knows Session 14  →  boot, still knows ~300 tokens per boot (97% less)


           

POST /store

Save decisions, lessons, preferences. Conflict detection is automatic.

GET /recall

Hybrid keyword + semantic search. In-process ONNX embeddings, no external service.

GET /boot

Compiled identity + delta capsule. ~300 tokens served instead of ~15,000 raw.


Memory tools are easy to pitch and hard to trust. Cortex starts to matter when the savings stop looking theoretical.

📊 Analytics

Savings, compression, and activity heatmaps

📈 Monte Carlo

30-day projection with confidence bands

🤖 Agents

Live sessions, inbox, deduped by identity

🎛️ Overview

Memory counts, health, and navigation


Benchmark note: cortex-http-pure is a benchmark adapter only; it is not required for normal Cortex operation. Scored LongMemEval-S validation is deferred until project budget allows, so v0.6.x does not claim a LongMemEval quality lift.

Historical v0.5.0 numbers below were measured against a 20-query ground-truth dataset via the cortex-http-base adapter. New recall-quality claims use the helper-free cortex-http-pure adapter as the canonical core baseline after funded validation.

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% —

Avg query tokens n/a 48.4 —

Raw v0.5.0 JSON Note: cortex-http-base ("raw") adapter retains partial adapter-layer helpers and is deprecated for new quality claims. The helper-free cortex-http-pure adapter is the v0.6.0+ canonical measurement floor, enforced by 5 CI purity gates. See benchmarking/README.md. Reranking ships default-off behind off/shadow/primary modes; public promotion remains gated on LongMemEval/API-backed validation. Query expansion (HyDE) is targeted for v0.7.0.


v0.6.0 makes settings, governance, boot audits, and recall-quality measurement first-class. Full details in CHANGELOG.md.

Accessibility and settings

  • 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

Governance

  • 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/audit and the read-only cortex_boot_audit MCP tool
  • Admin rollback with dry-run/apply workflow and audit events

Recall quality

  • cortex-http-pure adapter as the canonical helper-free measurement floor
  • Purity gates, CAS-100, and triangle judge tooling for safer quality claims
  • bge-base-en-v1.5 default embeddings with MiniLM profiles and qwen3-embedding-0.6b opt-in
  • Cross-encoder reranking behind off/shadow/primary modes; default remains off

Reliability

  • 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, prunes stale embeddings, and migrates canonical vectors to PQ8 int8 blobs

Cortex tracks active agent sessions when clients identify themselves through cortex_boot or GET /boot?agent=NAME.

Multi-agent, one brain

  • Each boot call registers a session. Control Center shows active sessions, deduplicated by agent identity.
  • Read-path tools (recall, peek, unfold) reattach to existing sessions. No duplicates.
  • Session descriptions preserved across reconnects and daemon restarts.
  • What one agent stores, every other agent can recall.

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/daemon-rs
cargo build --release

Claude Code plugin

claude plugin marketplace add AdityaVG13/cortex
claude plugin install cortex@cortex-marketplace

The plugin attaches to a running Cortex runtime. If Cortex is not ready, it reports APPINITREQUIRED; open Control Center or start the local runtime, then retry.


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 --json

Windows:

powershell -ExecutionPolicy Bypass -File scripts\first-run-smoke.ps1

macOS / Linux:

bash scripts/first-run-smoke.sh

Development build verification

# Daemon unit tests
cargo test --manifest-path daemon-rs/Cargo.toml

# 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 | |----------|--------| | [Connecting](Info/connecting.md) | Setup, MCP, HTTP, auth, troubleshooting | | [Architecture](ARCHITECTURE.md) | Codebase map, entry points, data flow, config, tests | | [MCP Tools](Info/mcp-tools.md) | All 29 MCP tool definitions and parameters | | [Research](Info/research.md) | Papers, inspirations, adaptation notes | | [Roadmap](Info/roadmap.md) | What shipped, what's planned, and why | | [Security](Info/security-rules.md) | Threat model, auth rules, vulnerability reporting | | [Team mode](Info/team-mode-setup.md) | Shared-server setup for engineering teams | | [Contributing](CONTRIBUTING.md) | Development setup and PR guidelines |

CLI reference

| Command | Description | |---------|-------------| | cortex serve | Start the daemon | | cortex --help | Full command reference | | cortex doctor | Run diagnostics | | cortex paths --json | Show file and port paths | | cortex plugin ensure-daemon | Ensure daemon health (plugin mode) | | cortex plugin mcp | MCP stdio bridge to HTTP API | | cortex setup --team | Initialize team mode and generate API keys | | cortex export | Export data (json or sql) | | cortex import | Import from a previous export | | cortex admin rollback --session-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. The SQLite database grows with usage. A real install with 286 memories and 493 decisions uses ~386 MB after compaction. The ONNX embedding model (~50 MB) downloads on first run.

🤖 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 3 attempts with backoff). 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. Settings and model files are preserved.


Built by


☕ Support Cortex  ·   Research  ·   Connecting  ·   Security  ·   Contributing  ·   Code of Conduct  ·   Changelog  ·   MIT License

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.