Documents
Overview
A document is a customer-facing grouping for episodes on a graph. Use a document_id when you ingest chunks of the same logical source — for example pages of a PDF, sections of a JSON export, or messages from a Slack channel.
Documents are the graph analogue of threads on user graphs. Prior-episode context during ingestion is scoped to the same document_id, which improves pronoun resolution and continuity across chunks. Zep also generates incremental document summaries from those episodes.
Add episodes with a document ID
Pass optional document_id when calling graph.add (or when appending graph_episode batch items). Episodes that share a document_id on the same graph are associated together.
List episodes for a document
List document summaries for a graph
Document summaries are generated asynchronously after episodes are associated. Listing returns one summary per document that has been summarized.
Related
- Threads — message grouping on user graphs
- Thread summaries — per-thread incremental summaries