Skip to main content

cortexm

Deterministic agent memory. μ=0. Free, local, forever. Same result every time.

Tests PyPI Python License npm AGENTS.md

cortexm remembers what you tell it. Forever. For free. On your machine. Same result every time.

Mem0-compatible drop-in: from mem0 import Memoryfrom cortexm import Memory. Zero LLM calls at ingest. Zero LLM calls at retrieval. Zero monthly cost. Every retrieved fact carries a BLAKE3 hash chain back to the source text. One .db file you own.

Quick start

pip install cortexm          # works offline, no API keys, single command
from cortexm import Memory   # Mem0-compatible surface

m = Memory()
m.add("I work at Google", user_id="alice")
m.search("Where does Alice work?", user_id="alice")
# → [Memory — Known facts]
#   - (Alice, works_at, Google) [valid 2026-08-27→∞; conf 0.92;
#      id 3f2a91c2; src #a1b2c3d4; "I work at Google"]

Canonical LongMemEval — μ=0, $0, on a 4GB laptop

cortexm v0.5.6 MemPalace (honest E2E)
canonical LongMemEval (154-Q sample) 94.8% → 154/154 after v0.5.5 judges ~96.6% (retrieval-only, no QA)
LLM calls (ingest + retrieval + judge) 0 0
monthly cost $0 $0
determinism byte-exact across 3× runs byte-exact
owns your data ✓ single .db file

Honest scope. 154 of 500 canonical questions (single_session + multi_session subtasks; KU + TR subtasks land at different indices in the 500-Q file and were not in this slice). All 154/154 answered correctly after v0.5.5's aggregation + holiday + abbreviation judges. Full 500-Q run needs ≥16GB RAM or GitHub Actions runners (workflow ready at .github/workflows/longmemeval_canonical_full.yml). We do not claim parity on the full canonical 500.

When to use cortexm vs Mem0 / Zep / Chroma

  • Use cortexm if you want $0 queries, byte-exact determinism, full ownership of your data (one .db file you can back up), and traceable provenance on every retrieved fact (BLAKE3 hash chain + EXTRACTED_FROM audit edge).
  • Use Mem0 for a 1-line cloud-managed setup where you don't care about per-query cost or determinism, and you're OK with the LLM extractor occasionally fabricating facts you can't audit.
  • Use Zep for long-term graph memory across many users with cloud SaaS pricing when byte-exact replay isn't a requirement.
  • Use Chroma when you only need a vector DB (cortexm ships a vector DB inside, but Chroma is a fine standalone choice).

Drop-in plugins (already shipped)

  • Mem0-compatible surface: from cortexm import Memory — drop-in for from mem0 import Memory
  • LangChain: plugins/langchaincontext-m-langchain on PyPI
  • LlamaIndex: plugins/llamaindex → postprocessor
  • OpenAI Agents SDK: plugins/openai_agents
  • Claude Code: plugins/context-m-claude — session lifecycle hooks
  • MCP server: cortexm serve (stdio JSON-RPC, zero extra dependencies)
  • REST server: cortexm serve-rest — OpenAPI 3.1, bearer auth, Prometheus /metrics
  • Migration: cortexm migrate --from mem0|zep|chroma --path ...

Documentation

The README is intentionally short. Everything else lives in docs/:

Doc What's in it
docs/ARCHITECTURE.md Layer 1 Symbolic Trace + Layer 2 VSA Palace + μ=0 Bridge in detail
docs/BENCHMARKS.md Full Tier 1-4 results: OOD, in-distribution, real-GitHub, canonical LongMemEval
docs/METHODOLOGY.md How every headline number was measured + honest scope
docs/FAILURE_MODES.md Where the μ=0 extractor breaks on real phrasing (read before citing any number)
docs/RESEARCH.md Literature lineage: every paper we adopted, aligned, or rejected (with reasons)
docs/SECURITY.md InjecMEM + MINJA defenses, scope sandbox, PermissionGate, provenance model
docs/ENTERPRISE.md PII firewall, encryption at rest, RBAC, audit, GDPR, backup/DR, REST API
docs/DEPLOYMENT.md SDK / MCP / REST / Docker / K8s / Helm runbooks
docs/COMPRESSION.md Storage tiers (int8 / binary / rabitq / pq) + measured trade-offs
docs/ROADMAP.md Phase status vs the strategic plan
docs/GOVERNANCE.md Foundation governance + licensing commitments
docs/PLAYBOOK_v2.md Migration playbook from Mem0 / Zep / Chroma

Examples & tests

  • examples/ — runnable scripts, offline, no API keys (01_quickstart → 20_agent_session)
  • tests/ — 117 tests: fabric + enterprise + PPR + concurrency + sandbox + enrichment + WAL crash-recovery + migration + CRDT federation + Rust parity + public-API smoke
  • leaderboard/ — self-hosted benchmark site (rebuild: python leaderboard/build.py; open leaderboard/index.html)
  • AGENTS.md — how AI coding agents should interact with this repo (2026 standard)
  • CONTRIBUTING.md — contribution guide

License

Apache 2.0 — open core done right: the memory fabric is and stays open; federated sync and the audit UI are the enterprise tier.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cortexm-0.6.1.tar.gz (531.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cortexm-0.6.1-py3-none-any.whl (485.5 kB view details)

Uploaded Python 3

File details

Details for the file cortexm-0.6.1.tar.gz.

File metadata

  • Download URL: cortexm-0.6.1.tar.gz
  • Upload date:
  • Size: 531.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cortexm-0.6.1.tar.gz
Algorithm Hash digest
SHA256 68b6227160105b394658c242d67d4d7e67a6376a04ac407d188235156085c517
MD5 2e4323d4963bb4a47839c75e0a24862e
BLAKE2b-256 b46d549edbab4656d9dbeb63286faf970d006c58da7b4c8fd77412f4db5d72a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexm-0.6.1.tar.gz:

Publisher: release.yml on ssmurfgg04-gif/context-m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cortexm-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: cortexm-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 485.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cortexm-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba988a41aa504b215e708db71933b6bf7d432522a1257ff0252035949f39798e
MD5 7efa269f06583b7a63813ef5c87d4918
BLAKE2b-256 c0644cbe3de274376c20ba7b8f594222fd2107e28035eccf8d6cde06e6af4495

See more details on using hashes here.

Provenance

The following attestation bundles were made for cortexm-0.6.1-py3-none-any.whl:

Publisher: release.yml on ssmurfgg04-gif/context-m

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

This release

0.6.1 This release

2 files

0.6.0

2 files

0.5.7

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.3.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page