Overview
CoreMem is an on-device memory core for AI agents — zero-LLM retrieval at 99.9% session recall@5, with a file-based journal, versioned memory governance, and an MCP server.
CoreMem gives agents instant access to conversation history — semantic search plus deterministic retrieval heuristics, all without a single API call on the default path. The default recall(strategy="episodic") scores 99.9% session recall@5 on LongMemEval Oracle (500 questions) and 95.0% on LongMemEval S with zero LLM calls.
It is embedded, local, and open source: no external APIs, no vector DB services, no internet connection. Runs entirely on-device with HybridDB (SQLite + FTS5 + ChromaDB) + sentence-transformers. Single-backend architecture since v0.6.0.
30-second start
from coremem import MemoryCore
core = MemoryCore(path="./memory")
# Ingest conversation turns
core.ingest("user", "I visited the Museum of Modern Art today", session_id="conv_001")
core.ingest("assistant", "That sounds wonderful! How was it?", session_id="conv_001")
core.ingest("user", "I went to an Ancient Civilizations exhibition at the Natural History Museum", session_id="conv_001")
# Retrieve with the default episodic strategy (zero LLM)
results = core.recall("When did I visit art museums?")
for r in results:
print(f"[{r.memory.ts}] [{r.memory.role}] {r.memory.content}")
Why CoreMem?
Every AI agent needs memory. But cloud-based vector search is expensive, slow, and doesn’t work offline. Pure embedding similarity misses keyword matches and temporal context. LLM-based memory systems cost tokens per query.
| Component | What it does |
|---|---|
| HybridDB retrieval | FTS5 keyword + embedding similarity via a single SQLite-backed store |
| Deterministic heuristics | Keyword overlap (exact + fuzzy + bigram), temporal recency, person-name boost, quoted-phrase matching |
| Query decomposition | Splits multi-cue relational questions into independent search cues (+0.037 session recall on S temporal-reasoning) |
| Preference routing | Preference questions route through a per-variant union (+0.033 session recall on S preference questions) |
| Cross-encoder reranking | ms-marco-MiniLM-L-6-v2 reranks candidates — the single biggest recall win (m@5 0.472 → 0.867 on oracle) |
| MMR session diversity | One result per session, preventing cross-encoder overfit |
What’s inside
Install, ingest a conversation, and recall — plus bundles and filters.
Recall strategies, heuristics, AgentJournal, versioned memory, pre-filtering.
MemoryCore constructor, ingest/recall, lifecycle, journal, governance API.
LongMemEval Oracle + S tables, answer-accuracy eval, the composition lesson.
What shipped in each version — currently v0.16.1.
Compilation (AgentJournal) is the only LLM-backed feature — 1 call per turn, model-configurable (COREMEM_LLM_MODEL). Recall — the hot path agents hit constantly — is fully deterministic.
Status
v0.16.1 — actively developed. Core ingest/recall stable with full test coverage. The retrieval engine behind the Executive Assistant agent system, paired with HybridDB for storage. Also deployed to the Agent Memory Leaderboard via the academic route.
Source of truth for this page: CoreMem · open-assistants-lab/CoreMem