Knowledge Graph
Memories don’t sit in a flat list. As the engine learns, it wires them into a graph of entities connected by typed, weighted, bi-temporal edges. This is the substrate the lattice and prediction layer build on, and it’s what makes recall associative rather than purely lexical.
Entities and edges
An entity is a canonical node — a person, org, product, location, concept,
event, or document. An edge is a typed relationship between two entities (or
between an entity and a literal value): a snake_case predicate like purchased,
prefers, works_at, located_in, has_condition.
Edges carry:
- a weight — how strong the relationship is;
- a validity window (
validFrom/validTo) — so the graph is bi-temporal and can answer “what did we believe on date X”.
Entities and edges come from two sources: the agent-run LLM extraction protocol
(extract_pending → commit_extraction, see Lifecycle) and
manual annotation through the admin routes.
Point-in-time queries
Because edges are bi-temporal, the graph supports time travel. A
point-in-time query returns the edges valid at a chosen instant — reconstructing
a past belief state rather than only the current one. The same principle applies
to memory list and search via the asOf parameter.
See Knowledge Graph API.
Associative (anticipatory) recall
The graph turns recall into spreading activation. Starting from the memories a session is already using, the engine walks the graph to the memories that share the most entities and surfaces them — the context most likely needed next, before it’s asked for. It’s deterministic and read-only.
This is exposed directly as a prefetch endpoint, and — when the
MEMORY_ASSOCIATIVE_RECALL_ENABLED flag is on — folded into ordinary search,
where a ranked query seeds activation from its top hits and blends the
graph-linked memories in with a bounded association bonus.
Reflection
Periodically, the engine can reflect: review a subject’s recent confirmed
memories and synthesize higher-order insight memories — generalizations
supported by several raw memories that none states outright. Insights are saved
as first-class memories with provenance, so retrieval returns synthesized
understanding, not just raw facts.
Consolidation
Left unchecked, a graph accumulates near-duplicates and stale nodes. Two maintenance passes keep it healthy:
- Semantic dedup collapses near-identical memories (high cosine similarity), keeping the strongest and superseding the rest — deterministic, no deletion.
- Decay / consolidation compacts the store over time.
None of these passes destroy history: dedup supersedes rather than deletes, so the audit trail and time-travel queries stay intact. The maintenance routes live under the Knowledge Graph API.