Source-linked AI summary
WorldDB: A Vector Graph-of-Worlds Memory Engine with Ontology-Aware Write-Time Reconciliation
Harish Santhanalakshmi Ganesan
TL;DR
Persistent memory remains a challenge for long-running agents, and flat RAG has structural weaknesses. WorldDB combines recursively composed worlds, content-addressed nodes, and graph-based retrieval; on LongMemEval-s it reports 96.40% overall and 97.11% task-averaged accuracy, a new state of the art on that benchmark.
Problem
Persistent memory is an engineering constraint for long-running agents, and canonical RAG has structural weaknesses.
Source: §1 · pp. 1–2Method
WorldDB combines content-addressed nodes with graph-based retrieval through resolver-unified entities and refers_to edges.
Source: §1 · p. 2, §2.1 · p. 4, §4.3 · p. 7Results
96.40% overall and 97.11% task-averaged accuracy establish a new LongMemEval-s state of the art, with the largest gains in multi-session reasoning and temporal consistency.
Source: §10 · p. 11Takeaways & Limitations
WorldDB makes graph topology part of the answer, so facts are retrievable by structure as well as content and identity is first-class.
Source: §10 · p. 11Resolver tiers add 5–15 ms per candidate at 10k-node scale, making ingest more expensive than a flat store.
Source: §9 · p. 10
Abstract
from arXiv · showhide
Persistent memory is the bottleneck separating stateless chatbots from long-running agentic systems. Retrieval-augmented generation (RAG) over flat vector stores fragments facts into chunks, loses cross-session identity, and has no first-class notion of supersession or contradiction. Recent bitemporal knowledge-graph systems (Graphiti, Memento, Hydra DB) add typed edges and valid-time metadata, but the graph itself remains flat: no recursive composition, no content-addressed invariants on nodes, and edge types carry no behavior beyond a label. We present WorldDB, a memory engine built on three commitments: (i) every node is a world -- a container with its own interior subgraph, ontology scope, and composed embedding, recursive to arbitrary depth; (ii) nodes are content-addressed and immutable, so any edit produces a new hash at the node and every ancestor, giving a Merkle-style audit trail for free; (iii) edges are write-time programs -- each edge type ships on_insert/on_delete/on_query_rewrite handlers (supersession closes validity, contradicts preserves both sides, same_as stages a merge proposal), so no raw append path exists. On LongMemEval-s (500 questions, ~115k-token conversational stacks), WorldDB with Claude Opus 4.7 as answerer achieves 96.40% overall / 97.11% task-averaged accuracy, a +5.61pp improvement over the previously reported Hydra DB state-of-the-art (90.79%) and +11.20pp over Supermemory (85.20%), with perfect single-session-assistant recall and robust performance on temporal reasoning (96.24%), knowledge update (98.72%), and preference synthesis (96.67%). Ablations show that the engine's graph layer -- resolver-unified entities and typed refers_to edges -- contributes +7.0pp task-averaged independently of the underlying answerer.
1 Introduction
WorldDB addresses persistent-memory limits in flat RAG and knowledge graphs with recursively nested, immutable worlds and edges whose handlers reconcile writes. Its introduction also reports LongMemEval-s results and identifies the engine’s graph and retrieval components.
1 Introduction
- Flat RAG fragments cross-segment dependencies, lacks chronology, and fails to unify mentions of the same entity across sessions; longer context windows also leave persistence and stale-content problems unresolved.The introduction describes lost-in-the-middle degradation and context rot alongside the limits of extending context windows.Source: §1 · pp. 1–2
- Earlier bitemporal graph systems address some memory problems, but their flat nodes and typed pointers leave edge semantics to application code.The introduction names Graphiti/Zep, Memento, and Hydra DB as examples.Source: §1 · p. 2
- WorldDB makes each node a recursively nestable world with its own subgraph and scope, while content-addressing propagates a new hash from an edited leaf through every ancestor.The resulting structure provides the stated Merkle-style audit trail.Source: §1 · p. 2
- Edge types run write-time handlers: supersession closes validity, contradiction preserves both sides, and same_as stages a merge proposal rather than silently merging identities.The introduction presents the reconciler as the sole edge-write entry point, with no raw append path.Source: §1 · pp. 2–3
1.1 Contributions
- 96.40% overall and 97.11% task-averaged accuracy beat Hydra DB by 5.6pp overall and 6.3pp task-averaged; the graph layer contributes +10.7pp task-averaged.The reported LongMemEval-s results accompany contributions including three-lane retrieval, a background consolidator, engineering benchmarks, and an MCP surface.Source: §1.1 · p. 3
2 Data Model
WorldDB models nodes as worlds with interior structure, scoped queries, and composed embeddings. Content-addressed immutability, handler-only edge writes, and separate validity and ingestion times define how the data model preserves and updates state.
2.1 Nodes are Worlds
- A node can be a leaf or a composite world; descending into it re-scopes queries, ontology, and composed-embedding space to that world.The node schema includes children, interior edges, an embedding, provenance, validity, and a parent-world reference.Source: §2.1 · p. 3, Table 1 · p. 4
- Editing a node’s content, children, edges, or creation time changes its hash, and editing a leaf propagates new hashes through every ancestor.The graph thereby functions as a Merkle tree over its interior, supporting deduplication, verifiable references, and audit-trail replay.Source: §2.1 · p. 4
2.2 Never-Appends
- Every edge write dispatches through its type’s handler, which can close validity intervals, create derived nodes, stage merge proposals, or refuse the write.Handler dispatch is the sole entry point; there is no raw append path for edges.Source: §2.2 · pp. 4–5, Table 2 · p. 4
2.3 Bitemporality
- Facts carry separate valid-time and ingestion-time timestamps; queries can pin either axis, and the default view hides nodes whose valid-time interval has closed.An explicit include-superseded flag returns those nodes with their closed intervals intact.Source: §2.3 · p. 5
3 Reconciliation Pipeline
Incoming text or structured input is extracted into candidates, resolved, reconciled through edge handlers, and committed with incremental embedding-index updates. A tiered resolver proposes identity matches, while post-ingest neighborhood reclustering checks for newly apparent matches.
3 Reconciliation Pipeline
- Ingestion proceeds through extraction, candidate-node resolution, edge-handler reconciliation, and commit, with embeddings added incrementally to the ANN index.The extractor is caller-supplied; the engine itself does not run an LLM for extraction.Source: §3 · p. 5
3.1 Tiered Resolver
- The resolver tries exact, fuzzy, phonetic, and embedding matches in sequence, then uses a caller-supplied tiebreaker when tiers disagree.The specified fuzzy and embedding thresholds are 0.92 and 0.88, respectively; a match stages a same_as proposal rather than silently merging identities.Source: §3.1 · p. 5
3.2 Incremental Reclustering
- After ingest, the resolver reruns over the new nodes’ two-hop neighborhood to catch facts whose embeddings have drifted toward an entity missed initially.The bounded-frontier reclustering does not block the ingest commit.Source: §3.2 · p. 6
4 Retrieval Layer
The retrieval layer uses deterministic, compositional queries that return subgraphs, with hash, text, or vector seeds. Hybrid retrieval combines lexical, vector, and entity-graph lanes, while an HNSW index accelerates vector search.
4.1 Query Pipeline
- A query pipeline starts from a seed and applies operations to return a subgraph of nodes and traversed edges; reads are deterministic and do not run an LLM.The planner selects among hash, text, and vector starts, preferring seeds, then text, then vector when given a declarative QuerySpec.Source: §4.1 · p. 6
4.2 HNSW Index
- At 100k nodes, HNSW reduces P95 cosine-search time from 102 ms with brute force to 1.07 ms on a 16-dim index, a 95× speedup.At 10k nodes the reported speedup is 12×: 352 µs versus 4.59 ms.Source: §4.2 · p. 6
4.3 Hybrid Retrieval: Reciprocal Rank Fusion
- Reciprocal rank fusion combines BM25, HNSW cosine, and entity-graph traversal, whose resolver-unified entities let one hop surface mentions across sessions.The entity-graph lane alone delivers +10.7pp task-averaged accuracy in the cited ablation.Source: §4.3 · pp. 6–7
5 Composed Embeddings
WorldDB composes each world’s embedding from its interior, using either mean pooling or parameter-free attention pooling. A content/composed embedding split keeps recomposition anchored to stable content as children change.
5 Composed Embeddings
- Each world’s composed embedding aggregates its interior and is ℓ2-normalized; the two modes are mean pooling and parameter-free attention pooling.Attention uses the world’s content embedding as query and its children as K = V.Source: §5 · p. 7
- 100% top-1 vs. 88% for mean pooling: attention pooling led by +12pp on the held-out synthetic retrieval task.The task used 50 worlds with 20 children each and 100 theme queries; incremental updates recomposed only the path to the root in O(depth).Source: §5 · p. 7
- The composer reads the stable content embedding as its parent query and writes only to the effective embedding used by the ANN.This split avoids feeding a previous composed output back as the next parent query, which the passage says would drift embeddings toward their own composition fixpoint regardless of leaf content.Source: §5 · p. 7
6 Background Consolidator
The background consolidator addresses accumulating leaves, unrecorded latent facts, and contradictions between distant graph regions. It creates summaries, infers selected transitive edges, and flags structural contradictions; summary-preferred queries are faster while retaining on-demand access to detail.
6 Background Consolidator
- The consolidator targets leaf accumulation, latent facts not stated in a single turn, and contradictions between distant regions that did not interact at write time..Source: §6 · p. 7
- The consolidator summarizes sufficiently old worlds, adds inferred closure edges for causes and subtype_of, and flags conflicts on user-registered functional-relation types.Inferred edges are marked metadata.inferred=true and sent through the standard handler pipeline.Source: §6 · pp. 7–8
- 6.5× faster: summary-preferred queries took 30 ms versus 194 ms for full-detail traversal at 1000 facts and 100 topics.These times are medians of 9 runs; detail remains reachable on demand.Source: §6 · p. 8
7 Results
WorldDB achieves 96.40% overall accuracy on LongMemEval-s, with gains in multi-session and temporal reasoning; ablations attribute substantial performance to its graph layer. The section also reports cross-category stability, engineering benchmarks, and performance across answerer choices.
7.1 Experimental Setup
- The evaluation used 500 LongMemEval-s question–conversation stacks averaging ∼115k tokens, with Claude Opus 4.7 answering and retrieval_k=50.Ingestion was session-by-session; Claude Sonnet 4.6 judged answers, and the run took 13.7 minutes at eight workers.Source: §7.1 · p. 8
7.2 LongMemEval-s Results
- 96.40% overall accuracy, +5.61 pp over Hydra DB and +11.20 pp over Supermemory, with 97.11% task-averaged versus Hydra DB’s 93.66%.Table 3 compares LongMemEval-s results; Hydra DB and Supermemory used Gemini 3.0 Pro, while Zep and full-context used GPT-4o.Source: §7.2 · p. 8, Table 3 · p. 8
- +15.79 pp versus Hydra DB on multi-session reasoning, +5.27 pp on temporal reasoning, and +1.29 pp on knowledge update.The reported mechanisms include cross-session entity unification, bitemporal storage with explicit supersession, and validity closure at commit time.Source: §7.2 · pp. 8–9
7.3 Cross-Category Stability
- WorldDB maintains ≥92.48% accuracy on every category, while Hydra DB falls to 76.69% on multi-session reasoning.The passage attributes this stability to retrieval architecture without hand-coded category routing and says the three RRF lanes contribute strengths across question shapes.Source: §7.3 · p. 9
7.4 Ablation: Engine-Layer Contribution
- 84.27% task-averaged for flat-RAG with the same Claude models; full WorldDB gains +10.66 pp task-averaged and +16.79 pp on multi-session.The passage attributes the majority of the gap to the engine’s structural commitments rather than the answerer.Source: §7.4 · p. 9, Table 4 · p. 9
7.5 Engineering Benchmarks
- 1,000,000 nodes and 2,499,993 refers_to edges were bulk-loaded in 10 min 47 s, at 5,401 writes/s; HNSW rebuilding took 37 min 37 s.Table 5 reports three read shapes, all ≥100× under the 500 ms P95 target.Source: §7.5 · p. 9, Table 5 · p. 10
- Across two seeds and 2,000 random operations each, reconciler fuzzing found zero invariant violations.Checked invariants included content-hash roundtrips, validity monotonicity, merge-proposal provenance, accepted-same_as symmetry, and ANN size.Source: §7.5 · p. 9
7.6 Cross-Model Generalization
- The same-answerer flat-RAG to WorldDB gap is 10.66 pp task-averaged, versus a 9 pp overall gap between the best and weakest answerers.The passage concludes that the engine layer contributes more than answerer choice within this model family.Source: §7.6 · p. 10, Table 6 · p. 10
8 MCP Surface
WorldDB exposes nine memory tools over MCP and supports stdio and streamable-HTTP transports. Its scope identities are deterministically hashed Scope nodes, with memories attached through contains edges.
8 MCP Surface
- Nine MCP memory tools use names distinct from Mem0’s, allowing both servers to coexist in one client; stdio and streamable-HTTP transports are supported.Scope identities are Scope-typed nodes with deterministic hashes, and contains edges allow a memory to belong to multiple scopes.Source: §8 · p. 10
9 Discussion and Limitations
WorldDB’s write-time reconciliation incurs an ingest-time cost, while several capabilities and evaluations remain unfinished or deferred. The discussion identifies training composed embeddings, evaluating DMR quantitatively, and implementing bio-mimetic decay as open work.
Discussion and Limitations
- 5–15 ms per candidate at 10k-node scale is the stated resolver-tier cost of preserving provenance and avoiding silent conflict handling.The passage contrasts this ingest-time expense with flat stores and their risk of returning one of two conflicting facts at random.Source: §9 · p. 10
- Table 7 lists the nine MCP tools exposed by WorldDB.Source: Table 7 · p. 11
- A learned aggregator trained by contrastive loss on query-to-correct-world pairs remains open work; the current v2 attention aggregator is parameter-free.The proposed training approach is in the style of HAKG [5].Source: §9 · p. 11
- The evaluation covers LongMemEval-s but defers the DMR benchmark, leaving quantitative DMR results for follow-up work.The authors expect qualitative conclusions to carry over, but report no DMR number here.Source: §9 · p. 11
- Bio-mimetic decay is architecturally compatible with the consolidator interface but is not implemented.The proposed engine would combine age-based retention decay with retrieval-frequency reinforcement.Source: §9 · p. 11
10 Conclusion
WorldDB combines recursive worlds, content-addressed immutability, and edges that act as write-time programs. On LongMemEval-s, it reports 96.40% overall and 97.11% task-averaged accuracy, with ablations attributing an 11 pp task-averaged contribution to the graph layer.
10 Conclusion
- WorldDB’s three commitments are recursive worlds, content-addressed immutability, and edges as write-time programs.The conclusion contrasts these commitments with flat RAG and recent bitemporal knowledge-graph systems.Source: §10 · p. 11
- 96.40% overall and 97.11% task-averaged on LongMemEval-s; ablations isolate an 11 pp task-averaged contribution to the graph layer, distinct from answerer capacity.The paper describes this as a new state-of-the-art on the benchmark, with the largest gains in multi-session reasoning and temporal consistency.Source: §10 · p. 11
- The conclusion frames persistent, queryable state as a choice for agentic systems that otherwise remain experimental.Source: §10 · p. 11
A Evaluation Protocol
The evaluation specifies reproducible prompts and distinct extraction, answering, and judging procedures, while keeping language models off the engine’s read path.
A Evaluation Protocol
- Prompts use temperature 0, specified token caps, and runtime fields, and are reproduced verbatim for replication.The answerer, judge, and extractor have max_tokens caps of 512, 8, and 2048, respectively.Source: A Evaluation Protocol · p. 13
A.1 Extractor Prompt (Claude Haiku 4.5)
- The extractor produces exhaustive session summaries and dated, self-contained facts with stable canonical subjects; omissions in summaries can hurt count-query accuracy.The prompt asks for every distinct event and state change, and for entity names to remain stable across sessions.Source: §A.1 · p. 13
A.2 Answerer Prompt (Claude Opus 4.7)
- The answerer prompt, refined through v5–v19 ablations, checks the exact subject, applies timestamp-based supersession, enumerates matches, synthesizes preferences, and abstains when information is absent.It runs once per question with the RRF-merged retrieval context.Source: §A.2 · pp. 13–14
A.3 Judge Prompt (Claude Sonnet 4.6) — LLM-as-Judge Protocol
- Sonnet 4.6 scores each triple CORRECT or WRONG with strict prefix parsing; the rubric handles abstentions, paraphrases, and numeric mismatches, and a pilot found 94% agreement with GPT-4o.The authors use one judge to keep the protocol reproducible and avoid ensemble opacity.Source: §A.3 · pp. 14–15
B Why No LLM in the Engine
- The engine avoids language-model calls on the read path because latency conflicts with query SLOs and nondeterminism can undermine ontology guarantees; calls are limited to out-of-band ingest and consolidation.Extractor and summarizer traits accept caller-supplied closures.Source: B Why No LLM in the Engine · pp. 15–16
C Reproducibility
- Evaluations use temperature 0, pinned seeds, and one answerer and judge model per run; seeded synthetic-retrieval and reconciler-fuzz results are reproducible.The reported approximately 14-minute run varies by a few seconds due to API round-trip jitter.Source: C Reproducibility · p. 16