> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://help.getzep.com/v2/graphiti/working-with-data/crud-operations/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.getzep.com/_mcp/server. # CRUD Operations Graphiti defines two abstract base classes and nine concrete graph classes. | Base class | Concrete classes | | ---------- | ---------------------------------------------------------------------------------- | | `Node` | `EpisodicNode`, `EntityNode`, `CommunityNode`, `SagaNode` | | `Edge` | `EpisodicEdge`, `EntityEdge`, `CommunityEdge`, `HasEpisodeEdge`, `NextEpisodeEdge` | The `Graphiti` instance provides CRUD namespaces for these classes: * `graphiti.nodes.entity` * `graphiti.nodes.episode` * `graphiti.nodes.community` * `graphiti.nodes.saga` * `graphiti.edges.entity` * `graphiti.edges.episodic` * `graphiti.edges.community` * `graphiti.edges.has_episode` * `graphiti.edges.next_episode` Each namespace uses the configured `GraphDriver`. ## Save an entity node The entity namespace generates the name embedding before it saves the node. ```python from graphiti_core.nodes import EntityNode node = EntityNode( name="Acme", group_id="customer-123", summary="A customer organization", ) saved_node = await graphiti.nodes.entity.save(node) ``` ## Get an entity node ```python node = await graphiti.nodes.entity.get_by_uuid(saved_node.uuid) ``` You can also get multiple nodes by UUID or group: ```python nodes = await graphiti.nodes.entity.get_by_uuids(["uuid-1", "uuid-2"]) group_nodes = await graphiti.nodes.entity.get_by_group_ids( ["customer-123"], limit=100, ) ``` ## Delete an entity node ```python await graphiti.nodes.entity.delete(node) ``` The node namespaces also provide `delete_by_uuids` and `delete_by_group_id` methods. ## Save and get an entity edge The entity edge namespace generates the fact embedding before it saves the edge. ```python from datetime import datetime, timezone from graphiti_core.edges import EntityEdge from graphiti_core.nodes import EntityNode target_node = await graphiti.nodes.entity.save( EntityNode( name="Graphiti", group_id="customer-123", summary="A temporal knowledge graph framework", ) ) edge = EntityEdge( name="USES", fact="Acme uses Graphiti", group_id="customer-123", source_node_uuid=saved_node.uuid, target_node_uuid=target_node.uuid, created_at=datetime.now(timezone.utc), ) saved_edge = await graphiti.edges.entity.save(edge) loaded_edge = await graphiti.edges.entity.get_by_uuid(saved_edge.uuid) ``` Delete the edge through the same namespace: ```python await graphiti.edges.entity.delete(loaded_edge) ``` The entity edge namespace also provides methods to get edges between two nodes, get edges for one node, and operate on lists of UUIDs. > Zep unifies business data, documents, and conversations into shared, governed context that agents can retrieve for their tasks.