Check Data Ingestion Status
For production use cases, we recommend webhooks instead of polling. Zep pushes an episode.processed event (and ingest.batch.completed for batch operations) as soon as processing finishes, so your application reacts immediately without the latency and wasted requests of polling in a loop. The polling approach shown in this recipe is best suited to testing and development.
Data added to Zep is processed asynchronously and can take a few seconds to a few minutes to finish processing. This recipe shows how to check whether data upload operations are finished processing.
Zep provides these methods for checking data ingestion status:
- Task polling: Use
client.task.get()to check the status of clone operations, direct node additions, and fact triple additions - Episode polling: Use
graph.episode.get()to check individual episode processing status - Batch status: Use
batch.get()andbatch.list_items()for Batch API imports
For tracking large historical ingestions, see the Batch API, which has its own progress reporting via batch.get and per-item status via batch.list_items.
Monitor zep-ingest with IngestResult
zep-ingest returns an IngestResult for Batch, episode, and task-backed operations:
The result records the identifiers needed to continue monitoring in another process:
Persist the appropriate identifiers and reconstruct the result later:
wait() polls the Batch, episode, or task handles in the result until they reach a terminal state. When Zep accepts a write but returns no handle for it, the result counts those items in untracked_items, status reports untracked, and wait() raises IngestUntrackedError rather than polling indefinitely. The submission succeeded in that case; only server-side extraction cannot be tracked, so confirm the data with a read of your own.
Search indexing can take additional time. search_when_ready() retries until a query returns any result or reaches the timeout; it does not verify that a specific imported record produced the result. Use a query unique to the imported data when checking indexing readiness.
Checking Operation Status with Task Polling
When using operations that return a task_id, you can poll for completion status using client.task.get(). The following operations return a task_id:
graph.clone()- Graph cloning operationsgraph.add_nodes()- Direct node additions and upsertsgraph.add_fact_triple()- Custom fact/node triplet additions
The pattern is the same for each operation: capture the task_id returned by the operation, then poll client.task.get(task_id=task_id) until status is succeeded or failed.
Checking Individual Episode Status with Episode Polling
For single episode operations or when you need to check the status of individual episodes, you can use the graph.episode.get() method. This approach is useful when adding data one episode at a time.
First, let’s create a user:
Now, let’s add some data and immediately try to search for that data; because data added to Zep is processed asynchronously and can take a few seconds to a few minutes to finish processing, our search results do not have the data we just added:
We can check the status of the episode to see when it has finished processing, using the episode returned from the graph.add method and the graph.episode.get method:
Now that the episode has finished processing, we can search for the data we just added, and this time we get a result: