Post-Cortex
An MCP server that gives AI assistants long-term memory — durable knowledge base of conversations, decisions and insights, with automatic entity extraction, knowledge-graph construction, and semantic search powered by local transformer models.
Overview
Post-Cortex is an MCP server that gives AI assistants long-term memory. It stores conversations, decisions, and insights in a durable, searchable knowledge base — with automatic entity extraction and a graph built on top of every write.
The design constraints are deliberate:
- Local-first. All processing runs on your machine. No external APIs, no telemetry, no opaque cloud index of your work.
- Fast. Lock-free Rust architecture, HNSW vector search at O(log n), single-digit-ms write latency on warm paths, ms-per-text Model2Vec inference.
- Flexible storage. Embedded RocksDB by default for zero-config use, SurrealDB when you want distribution.
- Graph-RAG. Search results come back enriched with entity relationships, not just bag-of-text matches.
Workspace layout
Post-Cortex is a Cargo workspace of eight publishable crates. Downstream Rust projects can pick whichever layer they actually need — post-cortex-core carries no transport, I/O or ML dependencies, so it can be consumed for the type system alone without dragging in RocksDB, Candle, or the server stack.
| Crate | Pick when you need… |
|---|---|
post-cortex | The full stack in one dep |
post-cortex-core | Domain types + traits only (no I/O, no ML) |
post-cortex-proto | gRPC wire types (client-side) |
post-cortex-embeddings | Model2Vec (default) + BERT embedders + HNSW vector DB |
post-cortex-storage | RocksDB + SurrealDB backends |
post-cortex-memory | ConversationMemorySystem orchestrator |
post-cortex-mcp | MCP tool functions (embed in any MCP host) |
post-cortex-daemon | pcx CLI + rmcp/axum/tonic server |
MCP surface
The pcx daemon exposes a small but expressive MCP toolset — session, update_conversation_context (with required typed entities + relations arrays as of 0.3.0), bulk_update_conversation_context, semantic_search, get_structured_summary, query_conversation_context, assemble_context (graph-aware retrieval), manage_workspace, manage_entity, and admin (health, vectorize-session, vectorize-stats, checkpoints). Same canonical write path under all of them.
Release line
The current release is 0.3.0 — Model2Vec embedder by default, non-blocking write pipeline, and the canonical single-entrypoint write contract. CI enforces cargo fmt, clippy -D warnings, cargo deny check, and cargo audit on every push to main.
Architecture
Graph-RAG retrieval
Every write carries typed entities + relations. Search results come back enriched with entity-graph traversal and relationship paths, not just bag-of-text matches.
Model2Vec by default
potion-multilingual-128M ships out of the box: ~50 MB on disk, ms-per-text inference, multilingual (Latin / Cyrillic / CJK / Greek / Arabic). Heavier BERT models stay available behind the bert feature.
Single-entrypoint architecture
Every transport — gRPC, MCP, future REST — routes through the same canonical MemoryServiceImpl::update_context. No parallel codepaths to drift between.
Lock-free Rust core
O(log n) HNSW vector search, ArcSwap session state, atomic CAS write path. Non-blocking writes return on durable persist; embeddings + entity-graph merge happen on a bounded background pipeline.
Privacy-first
All processing runs locally — no external API calls, no telemetry, no opaque cloud index of your work. Embeddings, graph traversal, and storage all stay on your machine.
Flexible storage backends
Embedded RocksDB by default for zero-config use. Switch to SurrealDB (local or remote) when you want distribution. Same HNSW O(log n) vector search on either backend.
Quick start
Register Post-Cortex globally with the Claude MCP CLI — once, for all projects on the machine. The HTTP transport (with a long-running daemon via pcx start) is recommended; stdio is supported when you need a process-per-session.
# Install brew install julymetodiev/tap/post-cortex # or: cargo install post-cortex-daemon --features "embeddings,surrealdb-storage" # Register MCP server (HTTP transport — recommended) claude mcp add --scope user --transport http post-cortex http://127.0.0.1:3737/mcp # Set up a project (creates session + workspace + CLAUDE.md + hooks) cd ~/my-project && pcx setup # Start the daemon (shared memory across multiple Claude instances) pcx start # Start coding — Claude will search past knowledge before answering claude