Actions9
Overview
The "Add Fact Triple" operation of the Zep AI node allows users to add a specific fact relationship (a triple) to a knowledge graph. This involves defining a relationship (fact) between two entities (source and target nodes) within a graph, optionally specifying which graph to modify. It is useful for building or enriching structured knowledge graphs by explicitly stating relationships such as "WORKS_AT", "KNOWS", or other custom relations.
Practical examples:
- Adding a relationship that "Alice WORKS_AT CompanyX" where "Alice" is the source node, "CompanyX" is the target node, and "WORKS_AT" is the fact name.
- Defining social connections like "Bob KNOWS Carol".
- Enriching a domain-specific knowledge graph with facts linking entities.
This operation helps maintain and expand semantic data in knowledge management systems, AI assistants, or any application leveraging graph-based knowledge representation.
Properties
| Name | Meaning |
|---|---|
| Graph ID | The ID of the graph to modify. Optional; if not provided, the user's default graph is used. |
| Fact | The description of the fact/relationship (max 50 characters). |
| Fact Name | The name of the relationship type (e.g., WORKS_AT, KNOWS). |
| Source Node Name | The name of the source entity in the relationship (optional). |
| Target Node Name | The name of the target entity in the relationship (max 50 chars). Required. |
Output
The output JSON object includes:
success: Boolean indicating if the operation was successful.fact: The fact/relationship description provided.factName: The name of the relationship.sourceNode: The source entity name (if provided).targetNode: The target entity name.response: The full response from the API call adding the fact triple, containing details about the created triple or any metadata returned by the service.
No binary data output is involved in this operation.
Dependencies
- Requires an API key credential for authenticating requests to the Zep AI service.
- 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 required fields: If required properties like
fact,factName, ortargetNodeNameare missing, the API call will fail. Ensure all required inputs are provided. - Invalid Graph ID or User Graph: If no Graph ID is provided and the user does not have a default graph, the operation may fail or add the fact to an unintended graph.
- API Authentication errors: Errors related to authentication usually indicate invalid or missing API credentials. Verify the API key credential setup.
- Fact or Node name length limits: Inputs exceeding 50 characters may cause errors. Keep these values within specified limits.
- Network or API downtime: Temporary connectivity issues or service outages can cause request failures. Retry after some time or check service status.
Links and References
- Zep AI Documentation
- Knowledge Graph Concepts: https://en.wikipedia.org/wiki/Knowledge_graph
- General n8n HTTP Request Node Usage: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/