Zep v3 icon

Zep v3

Interact with Zep Cloud v3 API

Overview

The "Add Fact Triple" operation on the Graph resource allows users to add a fact triple (an edge with associated nodes) into a knowledge graph managed by Zep Cloud v3 API. This operation creates or references two nodes (source and target) and connects them with an edge that represents a fact relationship between these nodes.

This node is beneficial in scenarios where you want to build or enrich a semantic knowledge graph, such as representing relationships between people, organizations, events, or concepts. For example, you can represent "John works at Acme Corporation" as a fact triple linking the person "John" to the organization "Acme Corporation" with the relationship "WORKS_AT".

Practical examples:

  • Adding employee-company relationships in a corporate knowledge base.
  • Representing social connections like "Alice KNOWS Bob".
  • Modeling event participation, e.g., "Conference2024 HOSTED_BY OrganizationX".

Properties

Name Meaning
Graph ID The unique identifier of the graph where the fact triple will be added. Required for most operations but optional if using User ID instead.
Fact The textual fact describing the relationship between the two nodes (max 50 characters). Example: "John works at Acme Corporation".
Fact Name The name of the edge representing the fact. Should be uppercase snake case (max 50 characters). Examples: "WORKS_AT", "RELATES_TO", "KNOWS".
Target Node Name The name of the target node in the fact triple (max 50 characters). Example: "Acme Corporation".
Source Node Name The name of the source node in the fact triple (max 50 characters). Example: "John Doe".
Source Node Summary A brief summary or description of the source node (max 500 characters). Example: "Software engineer with 5 years of experience".
Target Node Summary A brief summary or description of the target node (max 500 characters). Example: "Technology company specializing in cloud solutions".
Source Node UUID UUID of an existing source node. If provided, the node will be reused instead of creating a new one.
Target Node UUID UUID of an existing target node. If provided, the node will be reused instead of creating a new one.
Fact UUID UUID to assign to the edge (fact) itself. If provided, this UUID will be used for the edge.
Created At Timestamp when the fact was created, in ISO 8601 format. Example: "2024-01-15T10:30:00Z".
Valid At Timestamp indicating when the fact becomes true, in ISO 8601 format. Example: "2024-01-15T10:30:00Z".
Invalid At Timestamp indicating when the fact stops being true, in ISO 8601 format. Example: "2024-12-31T23:59:59Z".
Expired At Timestamp indicating when the edge expires, in ISO 8601 format. Example: "2024-12-31T23:59:59Z".

Output

The output JSON contains the response from the Zep Cloud API after adding the fact triple. It typically includes details about the created or updated edge and nodes, including their UUIDs and metadata.

The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating with the Zep Cloud v3 API.
  • The node makes HTTP POST requests to the endpoint https://api.getzep.com/api/v2/graph/add-fact-triple.
  • Proper configuration of the API authentication credential in n8n is necessary.

Troubleshooting

  • Missing Graph ID or User ID: If neither Graph ID nor User ID is provided (when required), the operation may fail. Ensure you provide the correct identifiers.
  • Invalid UUID formats: Providing malformed UUIDs for nodes or edges may cause errors. Validate UUID strings before use.
  • Fact or Fact Name length limits: Exceeding the max character limits (50 chars for fact and fact name) will likely cause validation errors.
  • API Authentication Errors: Ensure the API key credential is valid and has sufficient permissions.
  • Timestamp format issues: Timestamps must be in ISO 8601 format; otherwise, the API may reject the request.

If errors occur, check the error message returned by the API for guidance and verify all input parameters conform to expected formats and constraints.

Links and References

Discussion