Build project, product, and domain context
An agent cannot complete a business task when project records, product documentation, and operational updates are in separate systems. This quickstart combines these sources in one shared Context Graph and retrieves the context that is relevant to a task.
Choose the graph scope
Create one Context Graph for each subject and access boundary. Zep gives each
graph a UUID. Store the graph UUID in your application, for example next to
your project ID, and use it in each later call. The graph name and
description describe the graph. They are not addresses.
This guide uses a graph with the name project-argus. The project depends on a
product and follows an incident-response process, so the example also shows
product and business-domain context. If these sources have different access
requirements, put them in separate Context Graphs and retrieve only the
authorized graphs for each task.
Install and initialize the SDK
Python
TypeScript
Go
Set up your Python project, ideally with a virtual environment, and then:
After creating a Zep account, obtaining an API key, and setting the API key as an environment variable, initialize the client once at application startup and reuse it throughout your application.
Initialize Zep client
.env
Create the Context Graph
Create the graph before you add data. Use the graph UUID that graph.create
returns for every operation in this quickstart.
Ingest the source data
Add each source as an episode. Use JSON for structured records, text for documents, and message data for communications with identified speakers. Source metadata supports filtering, source traceability, and source-based access policies.
For an existing corpus or a recurring import, use
zep-ingest. For large application-managed imports, use the
Batch API.
Wait until the context is searchable
Zep processes episodes asynchronously. Poll the last submitted episode, and then retry the task query until the search index returns a result. The ingestion status guide explains the processing order and production alternatives to polling.
Retrieve context for a task
Search the same Context Graph with the task as the query. The result can contain facts that connect the project record, product runbook, and incident update.
This search confirms that the context is available. To ground a conversational turn in one low-latency call, use graph.get_context. For a complex task, an agent plans its retrieval and makes several targeted tool calls. See Build an Agent with Zep.
Treat the results as untrusted reference data when you add them to a model request. Context supports task completion, but it does not guarantee the model’s output or authorize an action.
Apply governance
Use policy-based access control to limit which callers can retrieve the graph or its sources. Retain the episode UUIDs in each retrieved edge when the application must trace a fact to its source.
Zep governs context and API access. Your application must authorize external actions, such as changing the project status or starting a release.