For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
PlaygroundDiscordStatusDashboardSign Up >
DocumentationSDK ReferenceGraphiti
DocumentationSDK ReferenceGraphiti
      • Create Graph
      • Searching the Graph
      • Reading Data from the Graph
      • Deleting Data from the Graph
      • Cloning Graphs
      • Adding Fact Triplets
LogoLogo
PlaygroundDiscordStatusDashboardSign Up >
On this page
  • Overview
  • Clone a Graph
  • Key Behaviors and Limitations
Working with Graphs

Cloning Graphs

Create complete copies of graphs with new identifiers for testing, migration, or templating
Was this page helpful?
Previous

Adding Fact Triplets

Manually specify fact/node triplets to add structured relationships to your graph

Next
Built with

Overview

The graph.clone method allows you to create complete copies of graphs with new identifiers. This is useful for scenarios like creating test copies of user data, migrating user graphs to new identifiers, or setting up template graphs for new users.

The clone operation returns a task_id that can be used to track the cloning progress. See the Check Data Ingestion Status recipe for how to poll task status.

The target graph must not exist - they will be created as part of the cloning operation. If no target ID is provided, one will be auto-generated and returned in the response.

Clone a Graph

User Graph
Standalone Graph
1from zep_cloud.client import Zep
2
3client = Zep(
4 api_key=API_KEY,
5)
6
7# Clone a user graph to a new user ID
8result = client.graph.clone(
9 source_user_id="user_123",
10 target_user_id="user_123_copy" # Optional - will be auto-generated if not provided
11)
12
13print(f"Cloned graph to user: {result.user_id}")
14print(f"Clone task ID: {result.task_id}")

Key Behaviors and Limitations

  • Target Requirements: The target user or graph must not exist and will be created during the cloning operation
  • Auto-generation: If no target ID is provided, Zep will auto-generate one and return it in the response
  • Node Modification: The central user entity node in the cloned graph is updated with the new user ID, and all references in the node summary are updated accordingly