Graphiti and Zep: how graph memory tracks sources

Learn how Graphiti tracks facts to source episodes, handles deletion and entity merges, and leaves trust policies to the agent.

Player not loading? Watch on YouTube

Daniel Chalef explains how Graphiti, the open source temporal graph framework behind Zep, records the origins of facts extracted by LLMs. His healthcare example combines an electronic health record, a PDF lab report and a patient intake chat. A confident allergy statement can mislead a doctor if the agent loses track of which source supplied it.

In the model he describes, sources become episode nodes, and derived entities and relationships retain links to those episodes. Entity merges must preserve both sets of source links. When later information contradicts a fact, Graphiti records an invalidation date and the episodes responsible for the change.

Chalef also explains how source tags propagate to derived facts. An AI agent can use those tags to filter clinical context, but it must apply its own business rules when sources have different trust levels. For deletion, a fact survives while another episode still supports it; a fact with no remaining support is removed.

The Q&A covers extraction, deduplication and cost. Chalef says graph construction is expensive and describes using traditional retrieval and NLP techniques where possible. He argues that markdown memory works well for desktop use but becomes difficult to manage for provenance in enterprise scenarios. He also clarifies that some Zep provenance uses a separate data structure outside the graph.