> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://help.getzep.com/v2/sdk-reference/graph/add-fact-triple/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.getzep.com/_mcp/server. # Add Fact Triple POST https://api.getzep.com/api/v2/graph/add-fact-triple Content-Type: application/json Add a fact triple for a user or group Reference: https://help.getzep.com/sdk-reference/graph/add-fact-triple ## Request ### Body (application/json) This endpoint expects a graphiti.AddTripleRequest. - `fact` (string, required) — The fact relating the two nodes that this edge represents - `fact_name` (string, required) — The name of the edge to add. Should be all caps using snake case (eg RELATES_TO) - `target_node_name` (string, required) — The name of the target node to add - `created_at` (string, optional) — The timestamp of the message - `expired_at` (string, optional) — The time (if any) at which the edge expires - `fact_uuid` (string, optional) — The uuid of the edge to add - `group_id` (string, optional) - `invalid_at` (string, optional) — The time (if any) at which the fact stops being true - `source_node_name` (string, optional) — The name of the source node to add - `source_node_summary` (string, optional) — The summary of the source node to add - `source_node_uuid` (string, optional) — The source node uuid - `target_node_summary` (string, optional) — The summary of the target node to add - `target_node_uuid` (string, optional) — The target node uuid - `user_id` (string, optional) - `valid_at` (string, optional) — The time at which the fact becomes true ## Response ### 200 Resulting triple - `edge` (graphiti.EntityEdge, optional) - `source_node` (graphiti.EntityNode, optional) - `target_node` (graphiti.EntityNode, optional) ## Errors ### 400 Bad Request Error Bad Request - `message` (string, optional) ### 500 Internal Server Error Internal Server Error - `message` (string, optional) ## Types ### graphiti.EntityEdge - `created_at` (string, required) — Creation time of the edge - `fact` (string, required) — Fact representing the edge and nodes that it connects - `name` (string, required) — Name of the edge, relation name - `source_node_uuid` (string, required) — UUID of the source node - `target_node_uuid` (string, required) — UUID of the target node - `uuid` (string, required) — UUID of the edge - `attributes` (map from string to any, optional) — Additional attributes of the edge. Dependent on edge types - `episodes` (list of string, optional) — List of episode ids that reference these entity edges - `expired_at` (string, optional) — Datetime of when the node was invalidated - `invalid_at` (string, optional) — Datetime of when the fact stopped being true - `valid_at` (string, optional) — Datetime of when the fact became true ### graphiti.EntityNode - `created_at` (string, required) — Creation time of the node - `name` (string, required) — Name of the node - `summary` (string, required) — Regional summary of surrounding edges - `uuid` (string, required) — UUID of the node - `attributes` (map from string to any, optional) — Additional attributes of the node. Dependent on node labels - `labels` (list of string, optional) — Labels associated with the node ## Examples **Request** ```json { "fact": "is_manager_of", "fact_name": "IS_MANAGER_OF", "target_node_name": "Engineering Team" } ``` **Response** ```json { "edge": { "created_at": "2024-06-01T09:00:00Z", "fact": "is_manager_of", "name": "IS_MANAGER_OF", "source_node_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "target_node_uuid": "f0e1d2c3-b4a5-6789-0abc-def123456789", "uuid": "123e4567-e89b-12d3-a456-426614174000", "attributes": {}, "episodes": [ "episode-1234" ], "expired_at": "2025-06-01T09:00:00Z", "invalid_at": "2025-06-01T09:00:00Z", "valid_at": "2024-06-01T09:00:00Z" }, "source_node": { "created_at": "2023-01-15T08:30:00Z", "name": "Alice Johnson", "summary": "Senior software engineer and team lead", "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "attributes": {}, "labels": [ "User", "Employee" ] }, "target_node": { "created_at": "2022-11-20T10:00:00Z", "name": "Engineering Team", "summary": "Team responsible for product development and maintenance", "uuid": "f0e1d2c3-b4a5-6789-0abc-def123456789", "attributes": {}, "labels": [ "Group", "Department" ] } } ``` > Zep unifies business data, documents, and conversations into shared, governed context that agents can retrieve for their tasks.