cortexm
Deterministic agent memory. μ=0. Free, local, forever. Same result every time.
cortexm remembers what you tell it. Forever. For free. On your machine. Same result every time.
Mem0-compatible drop-in: from mem0 import Memory → from 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
.dbfile you can back up), and traceable provenance on every retrieved fact (BLAKE3 hash chain +EXTRACTED_FROMaudit 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 forfrom mem0 import Memory - LangChain:
plugins/langchain→context-m-langchainon 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 smokeleaderboard/— self-hosted benchmark site (rebuild:python leaderboard/build.py; openleaderboard/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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cortexm-0.5.7.tar.gz.
File metadata
- Download URL: cortexm-0.5.7.tar.gz
- Upload date:
- Size: 475.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c4531e81a97e25abd1da9f58b8393e636b0bc2615373fca76bf8754f123cbd8
|
|
| MD5 |
ad1cc29c8f93e046e4716b4eee9fddb9
|
|
| BLAKE2b-256 |
b640a2972b35e83f73eb967384f2ee3e7157f135630fb065098b32233f25f0a5
|
Provenance
The following attestation bundles were made for cortexm-0.5.7.tar.gz:
Publisher:
release.yml on ssmurfgg04-gif/context-m
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexm-0.5.7.tar.gz -
Subject digest:
3c4531e81a97e25abd1da9f58b8393e636b0bc2615373fca76bf8754f123cbd8 - Sigstore transparency entry: 2635935246
- Sigstore integration time:
-
Permalink:
ssmurfgg04-gif/context-m@82779dcddaadbcb0eac920b5e48dbaaabaecc61d -
Branch / Tag:
refs/tags/v0.5.7 - Owner: https://github.com/ssmurfgg04-gif
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82779dcddaadbcb0eac920b5e48dbaaabaecc61d -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortexm-0.5.7-py3-none-any.whl.
File metadata
- Download URL: cortexm-0.5.7-py3-none-any.whl
- Upload date:
- Size: 437.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be4b65710f28fa3f401a2b043c62e63242f98234e38d2cf53f8583d16d17b08a
|
|
| MD5 |
682b8e06c6d4a771438743febb480f27
|
|
| BLAKE2b-256 |
ff2ab87bef073b8f3717a25a806a4c7937fb16f9d234129e31095a6e93ab252f
|
Provenance
The following attestation bundles were made for cortexm-0.5.7-py3-none-any.whl:
Publisher:
release.yml on ssmurfgg04-gif/context-m
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortexm-0.5.7-py3-none-any.whl -
Subject digest:
be4b65710f28fa3f401a2b043c62e63242f98234e38d2cf53f8583d16d17b08a - Sigstore transparency entry: 2635935336
- Sigstore integration time:
-
Permalink:
ssmurfgg04-gif/context-m@82779dcddaadbcb0eac920b5e48dbaaabaecc61d -
Branch / Tag:
refs/tags/v0.5.7 - Owner: https://github.com/ssmurfgg04-gif
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@82779dcddaadbcb0eac920b5e48dbaaabaecc61d -
Trigger Event:
push
-
Statement type: