Create Graph

Create standalone graphs for advanced use cases

Overview

While most use cases benefit from user-centric graphs that automatically integrate with users and threads, Zep also supports creating standalone graphs. Standalone graphs are useful for specific scenarios where you need independent knowledge graphs that aren’t tied to individual users.

When to Use Standalone Graphs

Consider using standalone graphs when you need to:

  • Create shared knowledge bases across multiple users
  • Build domain-specific knowledge graphs independent of user context
  • Maintain separate graphs for testing or experimentation
  • Implement custom graph architectures for specialized use cases

For most applications, we recommend using user graphs (created automatically when you add a user) as they provide seamless integration with Zep’s context retrieval and memory systems.

Creating a Standalone Graph

1from zep_cloud.client import Zep
2
3client = Zep(
4 api_key=API_KEY,
5)
6
7# Create a standalone graph with a custom ID
8result = client.graph.create(
9 graph_id="my_custom_graph"
10)
11
12print(f"Created graph with ID: {result.graph_id}")

Working with Standalone Graphs

Once created, you can work with standalone graphs using the same methods as user graphs:

Customizing Graph Structure

Standalone graphs can be customized with entity and edge types just like user graphs. See Customizing Graph Structure for details on how to define custom ontologies for your graph.

Next Steps