v1.2.0 Cortex-MCP Streamable HTTP Gateway is live on Vercel — 7 tools, 3 resources, 2 prompts, 108/108 tests passing. Connect in 15s →
Cortex-MCP v1.2.0
Bi-Temporal Memory Engine · MCP 2024-11-05

Persistent memory for coding agents.
Stale facts expire automatically.

Cortex-MCP pairs a local-first bi-temporal knowledge graph with an Okapi BM25 + 2-hop graph context compiler, semantic contradiction auditor, and TruthGate citation exporter.

• runs locally • zero external API keys • SHA-256 Merkle verified • MIT open source
Target: Project or User Scope Streamable HTTP
bash
fx memory_compile_context(...) sha256:e893bf67...
• Claude Code reading active subgraph • Cursor upserting ADR-019
Click any timestamp above to inspect bi-temporal supersession 0% stale-fact leakage
Compiled Context Budget 307 / 320 tokens (95.9%)
Okapi BM25 + 2-Hop Packed Items 2 Stale Facts Suppressed (0% leak)

Why Bi-Temporal Memory Matters

Vector stores stuff contradictions into your prompt. Cortex retires them.

When an engineering team migrates token formats or database isolation levels, append-only RAG surfaces both old and new notes simultaneously.

Append-Only Vector Store / Static Rules Hallucination Risk
- [chunk_14 · sim 0.89] "auth_service uses JWT_HS256 signed with HMAC_SHA256_SHARED_SECRET"
- [chunk_87 · sim 0.87] "auth_service migrated to PASETO_v4_public with Ed25519 keypair"
! Agent sees contradictory facts, wastes 420+ tokens, and patches legacy JWT middleware.
Cortex-MCP Bi-Temporal Compiler 100% Stale Suppressed
~ [fact_auth_token_v1] closed: valid_until=2026-04-20, superseded_by=fact_auth_token_v2
+ [FACT:fact_auth_token_v2] auth_service --(uses_token_format)--> PASETO_v4_public
+ [INVARIANT:ep_inv_007] 2-hop neighbor payment_ledger SERIALIZABLE_WITH_IDEMPOTENCY_KEY (@sha256)

How It Works

Three deterministic stages from session amnesia to verified prompts

01

Record & Supersede

Upsert structured facts with transaction and valid timestamps. Writing a new singular predicate atomically closes the prior claim's validity window.

02

Audit Contradictions

Detect negation polarity inversions, opposing technical antonyms, predicate alias collisions, and unsuperseded concurrent drift.

03

Compile Token Budget

Rank active subgraphs with Okapi BM25 and 2-hop spreading activation, pack within max_tokens, and export TruthGate citation bundles.

Live Contradiction & Supersession Preview

Switch engineering scenarios to inspect how Cortex-MCP flags drift before compilation.

Launch Interactive Studio → Browse 7 MCP Tools

Reproducible Evidence (500 Facts · 150 Supersessions · 100 Episodes)

Sub-millisecond graph operations without cloud latency

Measured via cortex-mcp benchmark across 60 entities and 50 context compilation queries.

100.0%
Stale-Fact Suppression
0 leaked stale facts / 50 queries
0.004 ms
Fact Upsert P50
P95: 0.006 ms (with supersession)
5.750 ms
800-Tok Compile P50
BM25 + 2-hop graph activation
1.756 ms
600 SHA-256 Verify
Full graph Merkle root pass
Explore Full Benchmark Report & ADRs →

Engineering FAQ

Design decisions & operational guarantees

Why bi-temporal tracking instead of a flat vector store?

Vector similarity treats deprecated config (like JWT_HS256) and its replacement (PASETO_v4_public) as equally true neighbors. Bi-temporal bounds (valid_from, valid_until, superseded_by) exclude superseded facts while preserving historical time travel via memory_time_travel.

What is the difference between the hosted Vercel endpoint and local stdio?

The hosted Vercel endpoint (https://cortex-mcp-steel.vercel.app/mcp) runs statelessly in memory per serverless instance for instant zero-install testing. For private, persistent project memory saved atomically to disk, run cortex-mcp serve-stdio --storage .cortex/memory.json.

How does Cortex-MCP integrate with TruthGate?

cortex-mcp export-sources (and export_truthgate_sources()) emit verified GroundedSourceDocument payloads carrying temporal provenance and the graph SHA-256 Merkle root so downstream verification gates can prove zero stale-fact citation.

How is tampering detected in local graph storage?

Every recorded episode and temporal fact participates in a canonical SHA-256 hash and deterministic Merkle root digest checked by memory_verify_integrity and exposed on cortex://graph/integrity.