Cloning Graphs
Overview
The graph.clone method creates a complete copy of a graph with a new
identifier. Clone a user graph to test or migrate one user’s context. Clone a
shared Context Graph to create an isolated test copy of an account, project,
product, or business-domain graph, or to use a maintained graph as a template.
The clone request has no body fields. You give only the UUID of the source graph. Zep creates the target graph, gives it a new UUID, and returns the new graph and a task in the response. The response contains the UUID of the copy at once, so store it before the task completes. Use the task to track the copy of the graph data. See Check data ingestion status for polling instructions.
The copy is always a new shared Context Graph, also when the source is a user graph. A clone does not create a user, and it does not copy data into an existing graph.
Clone a Graph
User Graph
Context Graph
To clone a user graph, use the graph_uuid of the user as the source.
Key Behaviors and Limitations
- New target: Zep always creates a new graph for the copy. You cannot select the identifier of the copy, and you cannot clone into an existing graph.
- Identifier at once: The response contains the new graph with its
uuidbefore the copy of the data is complete. Read data from the copy after the task succeeds. - User graphs: The copy of a user graph is a shared Context Graph. It is not a user graph, and Zep does not create a new user for it.
- Retries: Each clone call creates a new graph. If your application can retry a clone, you can send an
Idempotency-Keywith the call:idempotency_keyin Python,idempotencyKeyin the TypeScript request options, oroption.WithIdempotencyKeyin Go.