# Citation Needed: Provenance for LLM-Built Knowledge Graphs — Daniel Chalef, Zep AI

## Executive summary

The synthesis of facts by Large Language Models (LLMs) often destroys the original source attribution or 'paper trail.' Daniel Chalef argues that traditional methods like simple Source IDs fail when data undergoes complex transformations, such as entity merging or fact invalidation. He proposes that provenance for LLM-built knowledge graphs must itself be a graph structure. The open-source framework Graphiti models sources as 'episodes' and uses graph walks to trace every derived fact back to its original source(s), ensuring compliance (e.g., GDPR deletion) and verifiable veracity.

## Key takeaways

- LLM Synthesis Destroys Provenance: Because LLMs synthesize facts non-deterministically, the resulting output artifact may not appear verbatim in the source inputs, making simple source ID tracking insufficient for complex agent applications.
- Provenance Requires a Graph Structure: To maintain lineage through mutations and merges, provenance must be modeled as a knowledge graph where facts are derived from linked sources (episodes). Tracing a fact's origin then becomes a simple 'graph walk.'
- Graphiti Enables Robust Lineage Management: The Graphiti framework models source data as episodes, allowing derived facts to inherit all necessary links. This structure supports complex operations like metadata projection (e.g., filtering only 'EHR' verified sources) and GDPR-compliant deletion.

## Technical details

- Provenance Failure Mode: In a healthcare scenario, an agent synthesizing the fact 'Patient has a penicillin allergy' from three sources (EHR record, lab report, intake chatbot) risks misleading a doctor if the source is not clearly indicated.
- Limitations of Source IDs: In LLM context pipelines, simple source ID tracking fails because entities can merge (e.g., J. Smith and John Smith becoming one identity), or new data might invalidate old facts, causing the underlying 'store to keep changing underneath your pointer.'
- Graph Modeling for Lineage: Provenance is modeled as a knowledge graph where source data are treated as 'episodes,' and facts are represented by edges linking extracted entities. Tracing the fact to its origin is achieved via a graph walk.
- Handling Data Mutation and Invalidation: When new data contradicts existing information, the system must capture this lineage. Graphiti handles this by adding an 'invalid date' to the mutated edge while noting the source episodes responsible for the change.
- GDPR Erasure and Deletion: For privacy compliance, deletion must follow the graph links. A fact only survives a source data deletion if at least one other remaining episode still supports it (e.g., deleting intake chart data leaves the allergy fact intact).

## Practical implications

- **Compliance:** Provides an auditable trail for regulatory requirements (e.g., GDPR erasure).
- **Veracity/Trust:** Allows agents to filter facts based on source metadata (e.g., only accepting data from 'verified clinical sources').
- **Debugging:** Enables engineers to understand exactly how a fact was generated and which components contributed to its existence.
- **Data Integrity:** Ensures that when entities merge or data is mutated, the full lineage of all contributing sources is preserved.

## Topics

Provenance, Knowledge Graphs, LLMs, Graph Databases, GDPR Compliance, Data Lineage, Graphiti, Zep

Source: https://www.youtube.com/watch?v=H7puB0RwJMM
