
Citation Needed: Provenance for LLM-Built Knowledge Graphs — Daniel Chalef, Zep AI
What this covers
This talk from Daniel Ursell covers Graphiti, an open-source temporal graph framework, and Zep, the enterprise agent memory system built on it. It opens with a healthcare case: an agent tells a doctor a patient has a penicillin allergy, a fact synthesized from an EHR record, a lab report, and an intake chat, with no sign that it came from the patient. Ursell explains why stamping a source ID on the fact fails. That approach works in warehouses where a pipeline copies values deterministically. In an LLM pipeline, entities merge ("J. Smith" and "John Smith") and new data invalidates older facts, so the store shifts under the pointer.
The middle of the talk is mechanical. Sources become episodes, extracted entities become nodes, and edges between them are facts, produced by structured extraction as subject-verb-object triples. Tracing a fact is a graph walk, but keeping lineage correct through merges is the hard part. When contradicting data arrives, an invalid date goes on the edge along with the episodes that caused the change. Tagging a source once, such as "verified" or "EHR", propagates the tag to everything derived from it. The most contested point concerns facts with several parents. For an allergy in a prescribing context, one unverified parent should block action. For consent on file, every parent must be verified. The graph exposes the tags, but the agent applies that business logic. Deletion runs the same edges in reverse: after a GDPR erasure, a fact survives only if another episode still supports it.
The talk then turns to cost and alternatives. Graph construction is expensive, so the extraction pipeline is single-shot with a reflection step that records why a fact changed. It also avoids LLM calls where it can, using entropy analysis and simhashing for deduplication. In the Q&A, Ursell argues that markdown memory suits single-user desktop use but breaks down on provenance in multi-agent, multi-user settings.
LLM-based context systems require provenance tracking built into data structures as graphs rather than logged afterward, because synthesis destroys source attribution and compliance, verification, debugging, and deletion decisions depend on maintaining lineage from facts back to their originating sources.
- LLMs synthesize data non-deterministically, destroying the paper trail of how outputs originated
- Provenance must be engineered into the graph structure at ingestion time, not retrofitted via source IDs or append logs
- Graph-based lineage enables compliance, veracity verification, debugging, and selective deletion while preserving dependent facts
This asset isn't compiled yet
You're seeing its claims, ranked. Compile it to build the argument threads, weight them, and check each claim against your library — the full view.
LLMs are non-deterministic in their data synthesis—they interpret and synthesize data from multiple sources to generate summaries, extracted facts, and structured records that may not appear verbatim in the source inputs, which destroys the paper trail of how outputs were originated.
“LLMs are really great at pulling together data from many sources. Uh, but they do so non-deterministically. They interpret and synthesize data generating a summary, an extracted fact, uh a structured record. And this output artifact may not appear verbatim in the source inputs. Synthesis often destroys the paper trail of how these outputs were originated.”
Provenance (tracing how an artifact was built and why) is required by legal compliance but is also useful for debugging, deciding which sources to trust, and determining which artifacts to delete.
“I'm going to be talking today about provenence, which is tracing how an artifact was built and why. Legal compliance often demands provenence, but it's also useful for debugging. Deciding which sources you trust and which artifacts to delete.”
Privacy compliance (right to be forgotten, retention policies) requires the ability to delete source data, but with context derived from multiple sources, the question arises: if only some source data needs to be deleted (not all), how do you safely delete without breaking derived facts?
“Another situation where lineage is really important, we may have to delete source data due to retention policies or right to be forgotten requests. So privacy compliance and this is really tricky because if we have context derived from multiple sources, how do we do so?”
In a healthcare scenario, if an agent retrieves and presents a fact (e.g., 'patient has a penicillin allergy') synthesized from multiple sources (EHR, lab report, patient intake chat) without clearly indicating that the source was from the patient themselves, it may mislead a doctor in a treatment scenario.
“An agent retrieves context about a patient. So this is a healthcare scenario. And what comes back is a clean confident fact. Patient has a penicellin allergy. And the context was synthesized from three sources. A lengthy EHR record, electronic health record, a PDF lab report, and something a patient typed into an AI intake chat. If the agent presents the fact to a doctor in treat in a treatment scenario without clearly indicating the source was from the patient themselves, it may mislead the doctor.”
Lineage and provenance is expensive: graph construction is expensive, and Ursell's team has put significant engineering effort into reducing cost and latency of generating graph artifacts.
“So, by the way, as an aside, lineage and provenence is expensive. Graph construction is really expensive uh in the way that graffiti does it. And so we've put significant effort into reducing cost and latency of generating graph artifacts.”
In Graffiti and Zep, structured extraction works by extracting entities, relationships between them, and candidate facts as materialized triples (subject-verb-object structured as 'fact').
“So there's a structured extraction extracting entities and the relationships between them and candidate facts and those are the materialized or hydrated fact triples. So two entities and a fact. Um and it's structured as uh a fact is structured as um um uh subject well subject uh verb object.”
The Graffiti graph exposes which episodes have a particular metadata tag (e.g., 'verified'), but the agent must execute the business logic—applying which facts require ALL parents verified vs. ANY unverified parent blocking action—because this is situational and context-dependent.
“So the facts are very similar shapes. They have three three parent episodes but opposite policies. And here graffiti or the underlying store exposes that choice. It exposes which of the episodes have the gra the particular tag, but your agent needs to execute or apply your business rules. So that's not necessarily something that we bake into the graph. [snorts] It's situational.”
Deriving context is lossy and generative: lineage must be built into the data structure (as a graph) rather than logged afterward, and sources must be kept verbatim with everything derived from those sources linked back to the source.
“So to sum it all up, deriving context is lossy and generative. Lineage needs to be built in to the data structure, engineered into the data structure, which is a graph, not logged afterwards. And in graffiti we keep the sources verbatim and we link everything back everything derived from those sources back to the source.”
Lineage in LLM-based context systems must be modeled as an evolving set of links between facts and their sources, not as a static log, because it must survive mutation as entities merge and facts are invalidated.
“So lineage needs to be an evolving set and survive mutation.”
Using graph metadata projection, Graffiti can model classifications that span many different episodes and facts derived from them (e.g., an 'EHR tag' inherited by all entities and facts derived from an EHR episode), allowing agents to filter facts by veracity source (e.g., retrieve only facts from verified clinical sources).
“With metadata projection, we can also model classifications that span many different episodes. and facts derived from them. And so I'll give you an example here. In in the prior healthc are scenario, episodes may originate from an EHR record and have an EHR tag associate associated with them, but not all records are. And so on ingestion, we tag the episodes with the EHR tag. All subsequent entities and facts derived from the episode inherit the tag. And so if the agent wants to retrieve only facts from verified clinical sources, it's very simple to filter for the appropriate tag as we walk the graph.”
Lineage mapping shows which facts are derived from source data to be deleted; if only some source data needs deletion (not all), a fact survives deletion if other parent episodes still support it, but a fact is deleted only if no remaining episodes support it.
“Mapping lineage here is really useful. We know which facts are derived from the source data we intend on deleting. But what if only some of the source data needs to be deleted but not all? So in this example, we need to delete the intake chart data. So what the patient filled in, which is only one of three source data. In graffiti's model, the allergy fact survives the deletion and that's because there are two parents parent episode still supporting the fact. However, the contact preference fact is deleted as it was derived solely from the deleted source data. So, the rule is pretty simple here and it's easier to apply because the link exists. A fact is only deleted if no remaining episodes support it.”
Markdown files work well for single-user, desktop scenarios and sometimes work in single-agent, server-based agentic use cases, but break down with the types of enterprise problems Zep solves, particularly provenance in multi-agent, multi-user scenarios.
“I think they work really well um for desktop usage. Uh, they sometimes work well in uh agentic use cases that are server based, not necessarily desktop or single user, single agent scenarios. Um but what we found is that it's um they just break down with the types of enterprise problems that we solving in particularly in particular provenence as an example.”
Markdown-based memory (file-based memory, wikis, knowledge bases) suffers from provenance challenges: mutating lines in a file makes it very difficult to understand the lineage or provenance of why those changes occurred, and file-based systems break down in multi-agent, multi-user, multi-source scenarios.
“Yeah. uh markdown suffers from provenence. File-based um file-based uh memory starts to break down with provenence. It's very difficult when you m mutate lines in a file to understand the lineage or the provenence of why those changes occurred. Um, not only that, but in multi- aent, multi-user, and multi-source scenarios, it can be very challenging to manage markdown files at scale.”
Storing a simple source ID on a fact works well in structured data warehouses or data lakes where a pipeline outputs one value that is copied or mutated deterministically and sources are known and easily marked, but this breaks with context pipelines run by LLMs.
“This can work well in structured data warehouses or data lakes. A pipeline outputs one value copied or mutated deterministically, and the sources are known and easily marked. But with context pipelines run by LLMs, this breaks in several ways.”
In LLM context pipelines, entity merging (e.g., 'J. Smith' and 'John Smith' merged into one identity) causes facts derived from many different places to be collapsed into a single entity, making lineage tracking fail because new data can invalidate old facts and the store keeps changing underneath a pointer.
“You prompt an LLM with several sources. Many facts are each synthesized from one or more of the sources. Somebody like J. Smith and John Smith are merged into a single entity, one identity. And John's facts are derived from many different places. So new data might invalidate old facts. The store keeps changing underneath your pointer and an appendon log which often might you know might come to mind here gets very hard to manage at scale as there's so many changes occurring.”
Graffiti's fact extraction pipeline uses a single-shot extraction (extracting entities, relationships, and facts in one pass) that manages to work cheaply as a consequence, and includes a reflection step to ensure accuracy and add richness to lineage (capturing not just what changed but why it changed).
“Uh, yeah. So, so we do um as part we actually as part of the extraction, we've managed to get um a singleshot extraction working that extracts entities and the relationships between them and facts. and we're able to do so really cheaply as a consequence. Um, and so yes, we're using an LLM for that. Uh, we do have a reflection step or some reflection built in to ensure that the things that we've retrieved um are actually accurate um as well as to do some other stuff around uh uh more more richness to lineage. So why did something change? Not just this was related but also why did it change.”
Graffiti is an open-source temporal graph framework, and Zep (an enterprise agent memory infrastructure) is built on Graffiti, helping customers derive context and agent memory from multiple user touchpoints including chat, voice transcripts, email, and business data.
“So my team and I built Graffiti uh the open-source temporal graph framework and Zep, our enterprise agent memory infrastructure is built on graffiti. Our customers derive context or agent memory for many user touch points. Those could be chat, but not only chat. Often it's voice transcripts, email, business data.”
Graffiti customers have struggled with provenance: determining where a fact came from and what the veracity of that fact is.
“Our customers have struggled with provenence. Where did this fact come from? What is the veracity of this fact?”
Provenance in a context store containing facts can be modeled on a graph as relationships: source data nodes become episodes, extracted entities become nodes, and edges between entities represent facts that can be hydrated (made readable) as statements (e.g., 'Patient has a penicillin allergy').
“So sets of links between facts and their sources can be modeled on a graph as relationships. So provenence in a context store containing facts is a knowledge graph. We have three in this example we have three source data in graffiti that turned episodes. We have two entities extracted from the episodes patient and penicellin and an edge between them. This graph triple the two entities and the edge can be hydrated as a fact. Patient has a penicellin allergy.”
For a fact with multiple parents (sources), veracity policies differ based on context: for a penicillin allergy in a prescription scenario, the agent should block the prescription if any parent source is unverified (because missing one unverified source could be lethal), but for a consent-on-file fact, every parent source must be verified (because the entire consent chain must be verified or the consent is invalid).
“But what if the fact is three parents or more? Here we have a verified flag as our metadata and in this case one parent is not verified. So is the fact verified for the allergy flag which could be a life and death situation. the agent missing it, missing that particular flag could be a deadly mistake. So not retrieving the fact and any source of the three should block that prescription being issued. But for something like a consent on file for procedure fact, the mistake is operating on unverified consent. So the patient hasn't actually given their consent and every parent needs to be verified. So every single episode should have that tag.”
Tracing a fact to its source in a graph model is simply a graph walk, making it easy to map source to fact initially, but keeping lineage correct while the graph changes (entities merge, new data contradicts existing data) is very hard.
“Tracing a fact to its source is just a graph walk. So it's pretty simple and easy to map source to fact on the first right but keeping it correct while the graph changes can be really hard when new data uh so for example when two entities merge the merged entity needs to keep all source links from both otherwise we silently drop a source and we lose lineage.”
When new data contradicts existing data and mutates a fact, Graffiti captures this by adding an invalid date to the mutated edge and noting the source episodes that resulted in the edge mutating against the fact.
“And when new data contradicts existing data, mutating it, we need to capture this lineage too. In the rightmost card, a fact is rendered invalid by new data. And in graffiti, an invalid date is added to the mutated edge. And the source episodes that resulted in the edge mutating are noted against the fact.”
In the extraction pipeline, Graffiti tries hard to avoid using LLMs where possible, instead deploying traditional information retrieval and NLP techniques (entropy analysis, simhashing for deduplication) because these are far cheaper, faster, and more deterministic than LLM-based approaches.
“A lot of what we do uses LLMs but we try very hard not to use LLMs in this process as well. So where we're able to deploy more traditional information retrieval techniques, more traditional NLP techniques, uh looking at things like entropy and a bunch of other, you know, using um sim hash and a bunch of other approaches to ddupe, uh we do so uh far cheaper, far faster, deter more more far more deterministic.”
Graffiti's temporal graph support is built in at the database level, enabling agents to understand provenance across facts spanning multiple episodes (50+ edges/relationships) using a separate data structure from the graph itself.
“to account for weight changes in relevancy. Um that is some structure that we've actually built into Zap not into graffiti and um what we do is we do have for that a some tracing that we do which is kind of x of the graph. So not all of the um provenence is in the graph. Sorry, you if you have 50 edges, uh, sorry, is was that a question? If you have 50. Oh, there you go. You use 50. Yeah, 50 edges. Um, so so you know, Zep is able to uh look at provenence across those but using a separate data structure from the graph.”
Provenance in Graffiti offers multiple benefits: compliance is built in (satisfying regulatory requirements), veracity assessment (determining if a fact is trustworthy based on its sources), debugging (understanding why and how facts were generated), and deletion (determining what can be safely removed).
“And provenence offers many benefits to users of graffiti. You have compliance built in which makes your chief compliance officer very happy. You can verify a fact based on its sources so you understand veracity. Should I trust this fact? It's easy to debug where something came from. So, why do I have this fact? How was it generated? And also determining what to delete.”
The add_episode method in Graffiti runs a complicated pipeline on episode ingestion with multiple high-level steps: structured extraction (entities and facts), deduplication and deconfliction of entities and facts, and mutation tracking (invalidating facts when contradicted by new data).
“Um in terms of how the ad episode method works, there's a pretty complicated uh, pipeline that gets run on um, uh, episode ingestion and I'll just give it the very high level uh, uh, outline for you. So there's a structured extraction extracting entities and the relationships between them and candidate facts and those are the materialized or hydrated fact triples.”
A concrete example of deconfliction: if initially extracted 'Daniel loves Adidas shoes,' and later Daniel returns the shoes with a complaint, Graffiti extracts the new facts 'Daniel returned shoes' and 'Daniel was unhappy about Adidas,' which invalidate the original 'Daniel loves Adidas shoes' fact.
“So Daniel loves Adidas shoes. Three months later, Daniel's shoes fell apart. He sends it back to those the shoes back to the return application and he sends a nasty gram along with it. We now Daniel returned shoes as a fact and Daniel was unhappy about Adidas. We need to invalidate the Daniel loves Adidas shoes fact and so that is part of that pipeline as well.”
After structured extraction, Graffiti runs a deduplication and deconfliction process that deduplicates entities and deconflicts facts—identifying when new facts invalidate or mutate existing facts in the graph.
“Um and after that there is a uh deconliction process that runs dduplication and deconliction process. We dduplicate entities and we deconflict facts because there might be existing facts in the graph that are going to be mutated by a new learned fact.”
In Graffiti and Zep, episodes (source data) are nodes on the graph, like any other node, and various derived artifacts (entities, facts) are also modeled as nodes because they too need to have lineage and users need to understand how they were derived.
“Yeah, yeah so uh yes episodes are an entity on the graph uh or a node on the graph. Um it makes sense to model them that way. Um in Zep and graffiti we have various derived artifacts that are um nodes on the graph as well because they too need to have lineage and we need to understand how they were derived.”
Agents can search Graffiti's graph using vector similarity search (semantic search on textual artifacts), full-text search, and graph relational operations (breadth-first search), with search results enabling agents to understand provenance of any artifact hit by walking the graph.
“So in graffiti you can search across the entire graph. Uh it has um vector similarity search against various textual artifacts um full text search as well as graph relational operations things like BFS um it depends on the underlying uh graph database that's used and so your agent can walk the graph it can search semantically etc. And obviously from anywhere you hit in the graph you're then able to understand the provenence of a particular artifact that you've hit.”
Solving provenance at scale (in systems where LLMs derive context from multiple sources for multiple user touchpoints) presents a real engineering challenge.
“And solving this at scale presents a real engineering challenge.”
Most of what Ursell covered in the talk is available in the Graffiti framework open-source repository on GitHub, which users can access and try out.
“And most of what I've covered today is in the graffiti framework. So, you can go to uh the graffiti repo on GitHub and I have a little uh QR code QR code later that you can zap um and try it out.”