mem0rize v2 — how memory works

Explore the interactive graph → Try the contradiction walkthrough →
← back to dashboard

The idea

One brain on the server, many agents plugged into it. Agents don't carry context between sessions — they check out exactly one project's current truth at session start, write back durable outcomes the moment they happen, and everything else stays in the database costing nothing until asked for.

Session lifecycle

Session start get_rules + get_state Agent works normal coding session Decision / gotcha happens remember() — immediately "Why did we…?" question recall(project, query) Session ends / dies nothing to save — already saved

No hooks anywhere. The instruction file tells agents when to call; the server does the rest. A killed session loses nothing because writes happen at decision-time, not at session-end.

Every retrieval & write point

Session start EVERY SESSION
get_rules(project) · get_project_state(project)

Deterministic SQL — no similarity search. Returns ALL current rules (project + global) and current facts.

→ a few KB, always complete, superseded versions invisible
Historical question ON DEMAND
recall(project, query, k)

Hybrid search: vector + full-text fused, optional AI rerank. Scoped to one project.

→ top ~8 snippets, never the archive
Decision made AT DECISION TIME
remember(project, kind, body)

Reconcile-before-add: contradictions supersede the old version instead of piling up next to it.

→ old versions become history, never deleted
Human reading MANUAL
dashboard · graph · memory.md?scope=X

memory.md is a live projection — re-rendered from the database on every read. Not a file; can't rot.

→ one project's current truth, human-readable
Enrichment MANUAL ONLY
⚡ deep research · ⚡ analyze with related

Fired only by your click on a memory. Output saved back as extended context in the same project.

→ becomes a memory itself; nothing auto-fires
Thread resolved ON DEMAND
update_episode_status(id, status)

Open threads get closed (or reopened) by agents via MCP when the work actually happens.

→ open-thread list stays honest

Scoped memory flow

Any agent Claude Code · Codex · Hermes ONE DATABASE — 25+ DRAWERS trumove-crm ← opened global ← rules always added trumove-marketing-platform lively-hypatia …22 more — untouched, zero cost "I'm working on trumove-crm" scope = trumove-crm gets back: current truth rules + facts + open threads (~KB)

Scopes are hard walls at query level: a DataForSEO question in one project can never surface another project's billing noise — the failure that made v1 useless.

Borrowing context across projects

Working in one project and need an old one? You borrow one drawer — the rest of the cabinet stays shut.

Active session scope: trumove-crm "how did calljamal handle rate limits?" calljamal (old project) 23 other projects — never touched, zero tokens recall("calljamal", query) → top 8 snippets
In any agent session
"check memory for calljamal: rate limits"

Agent calls recall on the other scope mid-session. Gets ~8 snippets, nothing else.

From the dashboard
isolate cluster → ⤓ export

That project's current truth as markdown — paste it into any tool, session, or doc.

Direct URL
memory.md?scope=calljamal

One clean page, human-readable, always current.

Why other projects can't leak in

The scope isn't a search preference — it's a wall before the search even starts.

ALL 1,000+ MEMORIES SCOPE WALL WHERE scope = 'trumove-crm' — SQL filter, runs first only this project's memories exist now similarity ranking vector + full-text, fused, ranks only the survivors top 8 returned

v1 failed because similarity ran over everything and hoped for the best — a DataForSEO budget question surfaced Google Cloud billing noise. v2 deletes the possibility: memories outside the scope are not ranked lower, they are not in the race at all.

How memories are cataloged

Two layers, like a library: a Dewey-decimal address everyone can compute, plus a librarian who remembers what every book means.

The address (deterministic) scope / kind / subject trumove-crm / fact / dataforseo-budget exact lookups: rules, state, one-current-per-subject The meaning (semantic fingerprint) embedding — 1,536 numbers per memory "rate limiting" finds "429 backoff strategy" fuzzy lookups: recall, the galaxy graph's clusters

Rules and current facts are fetched by address — complete, no guessing. History is fetched by meaning — the graph you fly through is literally this second layer made visible: nodes that sit close together have similar fingerprints.

The write path — why contradictions can't pile up

remember("cap is $75") scope + subject key existing current fact? same subject → AI compares CONTRADICTS ($50) old → superseded, new → current ELABORATES merged version becomes current NEW SUBJECT inserted fresh history kept forever valid_from / superseded_by

Agents reading state only ever see one current answer per subject. The $50 version still exists — as history, findable when you ask "what changed?", invisible otherwise. Database-level constraint enforces one-current-per-subject even under crashes.

Dashboard features

Export context MANUAL
isolate a project → ⤓ export

That cluster's current truth as markdown — copied to clipboard and downloaded. Paste it into any AI session, doc, or tool.

Publish to repo MANUAL
isolate a project → ↑ publish to repo

Pushes the same snapshot as MEMORIZE.md into the project's GitHub repo, marked as generated with a pointer to the live source.

Create memories MANUAL
+ new

Write a rule, fact, decision, or gotcha by hand — goes through the same contradiction-checking as agent writes.

Enrichment MANUAL
⚡ deep research · ⚡ analyze

Deepen any memory on click; the result is saved back as extended context on that subject.

Connections LIVE
header → connections

Every client that talks to the memory server — Claude Code, Codex, Hermes, scripts — with live/idle status and last-seen. New memories record which client wrote them.

Time replay MANUAL
settings → ▶

Scrub or replay the graph chronologically — watch memory grow.

Gap detection LIVE
projects sidebar → amber dot

The server compares when each project was last worked on (any agent read) against when memory was last written. Recently active but nothing saved → amber dot on the project, with exact "worked on / last write" times inside.

Context-loss alerts LIVE
keep the dashboard open while you work

If a gap opens while you're working — an agent reading a project but writing nothing back — a real-time alert appears within a minute. The fix is one sentence to the agent: “save what we decided or learned.” Silent context loss becomes a visible, fixable event.

How this differs

Most tools do one of these things. The point here is the combination — every column ships in one self-hosted box.

this system mem0 Zep / Graphiti Context7 Obsidian
What it isagent memory OSmemory APItemporal knowledge graphlibrary docs feedmanual notes
Deterministic rules read (same answer every time)✓✗ similarity search✗ graph traversaln/a✗ you search
Contradiction handling✓ supersede, old kept as historypartial — update-omission documented✓ edge invalidationn/a✗ manual
Hard scope isolation (projects can't leak)✓ enforced in SQL✗ shared vector spacepartial — groupsn/afolders only
Detects agents that forget to save✓ gap alerts + push✗✗n/a✗
Works with Claude Code / Codex / any MCP agent✓ native MCP✓ MCP✓ MCP✓ MCP✗ plugins
Self-hosted, your Postgres, no per-call vendor fee✓cloud or self-hostcloud-firstcloud✓ local
Zero hooks / zero client machinery✓ instruction-drivenSDK callsSDK calls✓n/a
3D graph of what your agents know✓✗✗✗✓ 2D

Context7 solves a different problem (up-to-date library docs) and pairs well with this rather than competing. Obsidian is for humans; this is for agents.

Cost profile

~3 KB
what an agent reads at session start
8
snippets returned by a recall — never more
0
tokens spent on the other 24 projects
1
current answer per subject, ever
never
auto-fired enrichment, hooks, or full-store scans