Source-linked AI summary
PolyMemDB: A Polyglot Database System for AI Memory Management
Yu Wang, Jiaheng Lu
TL;DR
Existing agent-memory systems struggle to manage heterogeneous data and track conflicting facts over time. PolyMemDB combines heterogeneous storage with probabilistic graph maintenance using temporal decay, provenance, and semiring inference. A factual-conflict demonstration produces a provenance-grounded response acknowledging contradictory memories rather than a binary answer.
Problem
Existing agent-memory systems lack unified storage and multidimensional association for heterogeneous data, alongside provenance mechanisms for maintaining conflicting facts over time.
Source: A. Motivation and Contributions · p. 1Method
PolyMemDB combines heterogeneous databases with probabilistic memory-graph updates that integrate temporal decay, data provenance, and semiring inference.
Source: A. Motivation and Contributions · p. 1Results
In the factual-conflict demonstration, PolyMemDB guided an agent to a provenance-grounded response acknowledging contradictory memories rather than a binary answer.
Source: §IV · p. 4Takeaways & Limitations
Users can inspect an answer’s supporting triplets, observational facts, temporal-decay probabilities, and source corpus through the demonstration interface.
Source: §IV · p. 4
Abstract
from arXiv · showhide
With the widespread adoption of personal intelligent agents, users generate massive, heterogeneous data during long-term interactions. Leveraging this data as long-term memory helps reduce token overhead and deliver personalized experiences. However, existing memory systems face two primary limitations: they rely on single-storage paradigms that fragment multi-dimensional data, and they lack fine-grained data provenance to resolve long-term factual conflicts, thereby worsening LLM hallucinations. In this demonstration, we introduce PolyMemDB, a novel system tailored for managing agent memory. PolyMemDB has a polyglot storage architecture designed to track and manage various memory types, including graph, vector, probability and spatial-temporal data. To ensure factual consistency and reduce hallucinations, it features a probabilistic inference engine that integrates temporal decay with semiring aggregation, resolving long-term factual conflicts, providing detailed data provenance, and enabling users to trace reasoning chains transparently.
I. INTRODUCTION · A. Motivation and Contributions
PolyMemDB combines a polyglot storage layer with probabilistic memory-graph maintenance to address heterogeneous memory storage and long-term factual conflicts.
A. Motivation and Contributions
- Persistent agent memory reduces inference latency and token costs, captures user preferences, and supports higher-order knowledge abstraction.Reusing semantically similar responses provides the stated latency and token-cost benefits.Source: A. Motivation and Contributions · p. 1
- Single-storage paradigms struggle to store, retrieve, and associate heterogeneous interaction histories containing entity networks, logical relationships, and spatio-temporal constraints.These limitations motivate unified storage and multidimensional association of long-term memory.Source: A. Motivation and Contributions · p. 1
- Coarse-grained state overwriting and missing temporal-probabilistic factual maintenance leave existing systems needing better provenance tracking and stronger handling of hallucinations.The problem arises as facts evolve and conflict during long-term memory maintenance.Source: A. Motivation and Contributions · p. 1
- PolyMemDB integrates multimodal object storage, graph databases, spatio-temporal databases, and probabilistic databases to address limitations of text-only and vector-based retrieval.The implementation also combines graph databases with spatio-temporal indexing.Source: A. Motivation and Contributions · p. 1
- Extending probabilistic-database semiring inference to evidence chains enables conflict resolution and entity alignment while mitigating LLM hallucinations and preserving interpretability.The probabilistic memory-graph maintenance approach addresses event integration and factual conflicts during long-term interactions.Source: A. Motivation and Contributions · p. 1
- Dynamic graph updates combine temporal decay with data provenance to support conflict resolution for facts from multiple sources.This mechanism forms part of PolyMemDB’s probabilistic memory-graph maintenance.Source: A. Motivation and Contributions · p. 1
B. Comparison to Existing Systems
PolyMemDB distinguishes itself through polyglot storage for heterogeneous memory and database-level conflict resolution combining probabilistic inference with temporal decay.
B. Comparison to Existing Systems
- PolyMemDB replaces single-storage memory organization with polyglot storage for heterogeneous, multidimensional data, unlike MemForest’s text-time indexing and HyperMem’s homogeneous hypergraphs.MemForest organizes time-related information in a tree, updating specific paths without rewriting global memory. HyperMem models topics, fragments, and facts in a three-tier hypergraph, using hyperedges to capture dependencies among memory fragments.Source: B. Comparison to Existing Systems · p. 1
- PolyMemDB maintains entity topology in Neo4j and pushes spatio-temporal constraints into MobilityDB to jointly filter dynamic time windows and geographic polygons.This extends processing beyond the pure text relationships supported by the existing systems described in the comparison.Source: B. Comparison to Existing Systems · pp. 1–2
- PolyMemDB resolves memory conflicts through database-level semiring inference and temporal decay, providing fine-grained provenance, whereas MRAgent uses retrieval-time active reconstruction.PolyMemDB attaches historical observation sequences to memory-triplet edges and computes distribution vectors for positive drive, negative inhibition, and evidence conflict. MRAgent uses a “Cue-Tag-Content” graph in which the LLM iteratively explores and prunes paths based on intermediate retrieval states.Source: B. Comparison to Existing Systems · p. 2
II. SYSTEM OVERVIEW
PolyMemDB’s three-stage workflow converts inputs into atomic facts, routes them across specialized stores, and answers queries through cascaded retrieval.
Memory Ingestion & Indexing
- Memory ingestion begins the three-stage workflow by decomposing input into atomic facts using LLMs and vision language models.Processing includes entity alignment, coreference resolution, ellipsis recovery, named entity extraction, fact normalization, and confidence estimation.Source: §II · p. 2
Polyglot Storage Layer
- The polyglot storage layer routes normalized facts according to their multidimensional features, preserving relationships, confidence, spatio-temporal constraints, embeddings, and raw context in specialized stores.Neo4j represents entities, attributes, and long-term evolutionary trajectories as a connected graph supporting complex chain inference; ProvSQL stores event confidence, and MobilityDB manages spatio-temporal constraints. ChromaDB stores embedding vectors, while object storage preserves raw context.Source: §II · p. 2
Inference & Cascaded QA
- PolyMemDB uses three-tier federated retrieval, progressing from graph-based inference to dense retrieval and finally raw multimodal snippets when earlier tiers lack answers or sufficient evidence.Tier 1 combines low-latency subgraph traversal with probabilistic and spatio-temporal filtering and logical inference. Fallback tiers retrieve Top-k structured facts using query embeddings, then raw snippets to generate the final response, balancing inference overhead and recall accuracy.Source: §II · p. 2
III. PROBABILISTIC MEMORY GRAPH MAINTENANCE
PolyMemDB combines temporal decay and probabilistic inference to dynamically update an agent’s memory graph and resolve conflicting evidence. It preserves historical observations and supplies decomposed reliability scores to support provenance-grounded answers.
Memory Graph Formalization and Dynamic Update
- PolyMemDB represents memory as a heterogeneous directed graph and retrieves Top-k semantically similar local subgraphs before agents decide which nodes or relationships to create or update.The graph comprises heterogeneous entities, labeled directed relationships, and an attribute-labeling function. Each fact records evidence polarity, initial LLM-assigned confidence between 0 and 1, and observation timestamp.Source: §III · p. 3
Data Provenance and Evidence Chain Construction
- Instead of overwriting states, PolyMemDB preserves each relationship’s timestamp-ordered observation history in edge attributes, retaining evidence for provenance and interpretability.Every graph triplet maintains an appended sequence of historical facts, preserving observations from different time points.Source: §III · p. 3
Probabilistic Inference Based on Temporal Decay
- PolyMemDB combines temporal decay with probabilistic inference, extending the semiring framework used by ProvSQL to aggregate positive and negative evidence separately.Each observation receives weight w_i = c_i · λ^(T − i), where λ lies in (0, 1]. Inclusion-exclusion aggregates the positive and negative evidence into separate cumulative joint confidences.Source: §III · pp. 2–3
- PolyMemDB computes four intermediate cognitive states from P_+ and P_− to capture interactions between conflicting evidence: positive drive, negative inhibition, evidence conflict, and absence of evidence.Positive drive is P_+(1 − P_−), and negative inhibition is P_−(1 − P_+). Evidence conflict is P_+P_−, while absence of evidence is (1 − P_+)(1 − P_−).Source: §III · p. 3
- PolyMemDB computes Net Evidence Reliability R, distinguishing support from refutation while penalizing conflicting or insufficient evidence to guide provenance-grounded answers.R ranges from −1 to 1; when R ≈ 0, the largest intermediate state distinguishes contradictory evidence from an evidence void. QA receives both R and the decomposed state distributions.Source: §III · p. 3
IV. DEMONSTRATION
PolyMemDB’s interactive dashboard demonstrates provenance-traceable long-session question answering, spatio-temporal memory exploration, and probabilistic handling of contradictory memories. Its backend uses FastAPI and Pydantic-AI.
Scenario 1: Long-Session QA with Fine-Grained Provenance
- 48 sessions from LongMemEval yield a memory graph with 229 entities and 221 relationships for the long-session question-answering demonstration.A book-discount query retrieves 20%, with inspection of the reasoning chain, supporting triplets, edge observations, and positive drive probabilities calculated using temporal decay. The interface also presents a matched-entity subgraph and the raw corpus.Source: §IV · pp. 3–4
Scenario 2: Spatio-Temporal Memory Evolution
- 5 Italian cities remain highlighted when a dynamic time window filters the graduation-trip planning period, alongside structured itinerary extraction and evidence-linked facts.Using an extended LongMemEval case, the global map displays all mentioned geographical locations and associated facts. Time-window filtering removes irrelevant locations and synchronizes the map with a fine-grained fact list tracing evidence sources.Source: §IV · p. 4, Figure 3 · p. 4
Scenario 3: Dynamic Probabilistic Inference for Factual Conflicts
- 52.3% for Sconflict exceeds 47.2% for Saction, reducing net reliability to R ≈0.22 across Alice’s 10-month running history.Temporal decay (λ = 0.8) and semiring aggregation produce a 4D cognitive distribution. The evidence-grounded response recognizes commitment alongside physical and motivational hurdles, rather than answering a binary “yes” or overwriting contradictory memories.Source: §IV · p. 4, Figure 4 · p. 4