Overview

CoreMem is an on-device memory core for AI agents — zero-LLM retrieval at 95.7% session recall@5 on LongMemEval S, with a file-based journal, versioned memory governance, and an MCP server.

v0.16.1MITpip install corememPython 3.11+

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 95.7% session recall@5 on LongMemEval S (500 questions, ~48 sessions each) with zero LLM calls — measured with the current default (bge-small embedder + L-6 reranker).

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 (LongMemEval S message recall@5 0.628 with the default embedder)
MMR session diversity One result per session, preventing cross-encoder overfit

What’s inside

Zero-LLM where it matters

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