> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Source traceability

> Trace facts and other graph artifacts to their ingested source episodes and retain source references for application audit workflows.

Zep stores ingested messages, text, and JSON as episodes. Facts, entities,
observations, and summaries retain associations with the episodes from which
Zep derived them. These associations let you trace retrieved graph data to its
source content.

Source traceability records where information came from. It does not establish
that the source content or a derived fact is true.

## Trace a retrieved fact

Each fact is stored on an edge. The edge includes an `episodes` field that
contains the UUIDs of its associated source episodes.

#### Retrieve the fact

Use [`graph.search`](/searching-the-graph) or the edge APIs to retrieve the
fact and its source episode UUIDs.

#### Retrieve the source episodes

Use the episode API to retrieve each associated episode. An episode contains
the original message, text, or JSON that your application ingested.

#### Retain the retrieval record

If you must connect an agent answer to source content, retain the retrieved
fact, its source episode UUIDs, and the source content in your application.
[API Logs](/api-logging) record request activity, but they are not a
complete answer audit trail.

## Use source metadata

You can attach metadata when you ingest an episode. Zep projects supported
episode metadata onto the facts, entities, observations, and summaries that it
derives from that episode.

Use projected metadata to:

* Filter graph search results by source attributes.
* Apply source-based access policies to shared Context Graphs.
* Identify the source system, record type, account, project, product, or other
  application scope.

The [episode metadata projection](/episode-metadata-projection) guide explains
how associations and metadata apply to each context type.

> **Warning**
>
> Your application must authorize each source and graph scope before retrieval.
> Do not use customer-writable or model-generated metadata as a trusted security
> label.

## Related controls

* [Policy-based access control](/policy-based-access-control) limits the context
  that an API key or a Context MCP user can retrieve.
* [Audit logging](/audit-logging) records supported dashboard and account
  administration events.
* [API logging](/api-logging) records supported SDK and API request activity.