Chat Memory
Chat-only memory. Blind to business data, blind to events, blind to what the user did yesterday.
Research
Every retrieval comes with its receipt. Hash-chained, governance-checked, hard-erase capable. For stacks under FINMA, GDPR, and nFADP.
mema treats every memory as a verifiable knowledge asset. Seven composable layers, one markdown vault, no graph database, no blockchain. Inspired by Zep, Hindsight, Mem0, and OriginTrail, and shipped without their dependencies. The substrate is human-readable: every record is a file your engineer can open with `cat` and your auditor can re-hash by hand.
Agents don't fail because the model is bad. They fail because they don't have the right context.
Chat-only memory. Blind to business data, blind to events, blind to what the user did yesterday.
Stale and incomplete. Doesn't reflect what just happened. Doesn't track how facts change.
Nobody can verify why the agent answered the way it did. No receipt, no reproducibility.
Context is scattered, and nobody can verify it.
Seven composable layers, from the raw event to the verifiable asset. Each has a clear purpose and an endpoint.
Raw events: conversations, documents, tool calls, observations.
Immutable after write. The evidence base for everything higher. No claim without an episode.
POST /v2/observe Entities + facts with bi-temporal validity.
valid_from / valid_to describe truth in the world. invalidated_at / superseded_by describe what we've learned. Zep-style.
POST /v2/fact Experiences, observations, beliefs, with confidence and supersession.
Reflection runs offline, rule-based. No LLM call on the write path. LLM-augmented reflection is opt-in (v2.1).
POST /v2/cognitive Purpose, retention, provenance, hard erasure.
Every record carries purpose, retention, jurisdiction, evidence. policyCheck() decides at recall time. Hard-erase overwrites the file: GDPR Art. 17 / nFADP Art. 32.
POST /v2/erase Keyword + vector + graph + temporal + policy in one pipeline.
Fused scoring, graph expansion via derived_from, fully audited in L6. Every hit returns score_components, governance, why_retrieved.
POST /v2/recall Append-only SHA-256 hash chain, with external sealed witness.
Every operation is logged. verifyChain() detects any tampering. audit-witness.log defeats sqlite_sequence reset attacks.
GET /v2/audit/verify UAL + content_hash + metadata_hash + anchor lifecycle.
Every record can be wrapped as a verifiable asset. OriginTrail DKG Knowledge Asset pattern, without the blockchain. Pluggable anchor targets.
POST /v2/asset/wrap Example receipt. Every field is verifiable in the audit log.
score_componentskeyword + vector + graph fused, every component inspectable.ualstable resolvable identifier; re-hash the file, compare, done.governancepolicy decision with reason. Every denial is logged.verification_statusunverified → verified → anchored lifecycle.METHOD LoCoMo long-context memory benchmark. 25-query sample on the regulated 347-document corpus. Recommended: 15/5 for real-time chat, 30/30 for batch research.
Bi-temporal facts. Hash-chained audit. Hard erasure. That's the foundation. Recall performance is downstream.
| Property | Zep | Hindsight | Mem0 | OriginTrail | mema |
|---|---|---|---|---|---|
| Inspectable substrate | – | – | – | · | ✓ |
| Bi-temporal facts | ✓ | · | – | – | ✓ |
| Epistemic separation | · | ✓ | – | – | ✓ |
| Online LLM extraction by design | – | · | ✓ | – | – |
| Multi-tenant isolation | · | · | · | ✓ | ✓ |
| Hash-chained audit no blockchain | – | – | – | ✓ | ✓ |
| Hard erasure | · | · | – | – | ✓ |
| Verifiable assets (UAL/hashes) | – | – | – | ✓ | ✓ |
| External anchoring pluggable | – | – | – | ✓ | ✓ |
| Local-first | – | – | – | – | ✓ |
| Vendor-neutral | – | – | – | – | ✓ |
Legend ✓ supported – not supported · partial
A Swiss private bank deploys an internal assistant for relationship managers.
Every recall is audit-logged. Erasure requests are honoured: the file is tombstoned, the audit entry preserved.
Every tool call becomes an L1 episode with a source hash.
When something goes wrong, the auditor walks derived_from from the answer back to the calls that justified it.
Pharma R&D feeds protocols and decisions into mema.
GDPR Art. 17 / nFADP Art. 32 requests are honoured by hardErase: content overwritten, audit reference preserved.
All findings fixed and regression-tested.
v1 isolation, v2 smoke, v2 professional, v2 assets, security-hardening rounds 1 & 2.
Repo at github.com/machtsinnch/mema.
mema is our open, ongoing research, the engine behind our context engineering. Not a product pitch; a place we keep learning. On GitHub ↗