TETHESIS
AI MEMORY

Memory an agent can explain

Store what an agent saw, thought and decided as graph records, each with two times. Ask what it knew at 9:00 yesterday, why it believed something, and what it believed before it changed its mind.

Read the quickstartDeveloper documentationrecordEpisode · recordBelief · semanticMatchExpand
Episodes→Beliefs + evidence→Summaries→Salience→Recall
THE PRIMITIVES

Procedures an agent calls itself

Each record carries a valid time and a recorded time, so the whole memory is replayable and explainable — not just its latest state.

01Episodes

Record what happened in a session; replay it in order.

CALL db.recordEpisode('conv-abc-123', 'observation', 'User asked about Q3 forecast', '{"topic":"forecast"}') YIELD eventId, ts; CALL db.replayEpisodes('conv-abc-123', 50) YIELD eventId, kind, ts, text, payload RETURN ts, kind, text ORDER BY ts;

Stored as (:Session)-[:HAD_EVENT]->(:Event). The payload is a string. With an embedding model the text is embedded in the same commit; otherwise keyword search still finds it.

02Beliefs, with evidence and revision

Record a belief with the evidence behind it, revise it when the facts change, and walk the revision chain.

CALL db.recordBelief('churn-risk-acme', 'High churn risk', 0.85, ['event-id-99', 'event-id-104']) YIELD beliefId, evidenceCount; CALL db.reviseBelief('churn-risk-acme', 'Moderate churn risk', 0.55, 'saved by upsell') YIELD oldBeliefId, newBeliefId, revisedAt; CALL db.beliefLineage('churn-risk-acme', 3) YIELD beliefId, claim, confidence, createdAt, supersededAt, depth, evidence;

A revision is a new belief linked to the old one by REVISES; the old one is marked superseded. Evidence can be records or quoted passages, checked before writing, with supports / contradicts counts per version. An evidence id that names no node is refused (EVIDENCE_NOT_FOUND).

03Session summaries

Consolidate a session into a summary you can retrieve later.

CALL db.consolidateSession('conv-abc-123', 'Q3 forecast conversation: revenue, forecast and risks.') YIELD summaryId, eventCount, firstTs, lastTs; CALL db.sessionSummaries('conv-abc-123') YIELD summaryId, text, eventCount, createdAt, lastTs;

04Salience

Reinforce what matters; decay the rest on your own schedule.

CALL db.reinforceSalience($eventStrId, 1.0) YIELD strId, oldSalience, newSalience; CALL db.applySalienceDecay('Event', 21600, 0.05) YIELD nodeId, oldSalience, newSalience;

The engine does not decay on its own — call applySalienceDecay on a schedule.

05Retrieval: match, then expand

Find the closest records by meaning, then expand across the relationships you choose — in one call.

CALL gds.semanticMatchExpand('Event', '_embedding_v1', $queryEmbedding, 10, 2, ['RESPONDS_TO']) YIELD nodeId, score, distance RETURN nodeId, score, distance ORDER BY distance, score DESC;

Over MCP, higher-level recall is available too: recall, fused_recall (keyword, meaning and graph-neighbourhood ranks blended by one documented rule, each source's contribution shown), reflect and entity_page.

06Embedding-model drift

Every vector index records the model it was built with; see which need re-embedding when the default changes.

CALL db.embeddingModelDrift() YIELD label, prop, lockedModel, currentDefault, driftKind, builtAt, vectorCount;

db.memory.reembed(model) rebuilds the affected indexes in the background.

READ THE PAST

What did the agent know at a given time?

Add atRecorded (or atValid) to a read and every top-level MATCH rewinds to that moment. A query that already carries a time clause is refused.

curl -X POST "https://invariantdb.com/graphs/$GRAPH/cypher" \ -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \ -d '{"query": "MATCH (e:Event) RETURN count(e)", "atRecorded": "2026-04-13T15:47:00Z"}'

Recall over HTTP uses {"v": 2, "query": "...", "k": 5}, and searches what was saved with remember and save_document.

Keeping agents and conversations apart. Give each agent or tenant its own graph and a key limited to it — a key reaches only the graphs it names. (Capability tokens cover a whole graph, not a single session.)
Forget vs. erase. forget takes a memory out of recall and records who and why; restore puts it back. Neither is erasure — to make a person's sealed values unreadable, destroy their subject key (see provenance and cryptographic erasure).

Give your agent a memory it can explain

Explore enterprise knowledge and memory →