-
Notifications
You must be signed in to change notification settings - Fork 2
research(memory): temporal edge validity in graph memory (Graphiti/Zep pattern) #1693
Description
Source
Zep: A Temporal Knowledge Graph Architecture for Agent Memory (Jan 2025)
Graphiti: Build Real-Time Knowledge Graphs for AI Agents
Finding
The Zep/Graphiti architecture extends graph memory edges with temporal validity attributes (valid_from, valid_until). When a fact is updated (e.g. "Alice now works at Startup, not Acme"), the old edge is marked as expired rather than deleted — preserving historical context for temporal queries. This achieves 18.5% accuracy improvement on LongMemEval and 90% lower latency vs MemGPT baseline.
Applicability to Zeph
Zeph's graph memory (SQLite schema with entities/edges/communities, completed) already has an eviction policy but no temporal edge validity. The SQLite edges table can be extended with valid_from INTEGER (unix timestamp) and valid_until INTEGER (NULL = currently valid) columns. The graph_recall BFS can filter on valid_until IS NULL OR valid_until > now(), and entity extraction can detect superseding facts and expire old edges.
Implementation Sketch
- Schema migration: add
valid_fromandvalid_untilcolumns toedgestable - Update
GraphStore::upsert_edgeto setvalid_from = now() - Update extraction: when a new edge contradicts an existing one (same source+target+label), set
valid_until = now()on the old edge - Update
graph_recallBFS to filter on validity window - Expose temporal queries via
/graphslash command (e.g./graph history Alice)
Priority
Medium — low schema cost, significant accuracy improvement for long-running sessions where facts change over time.