Zep v3 icon

Zep v3

Interact with Zep Cloud v3 API

Overview

The "Add Data in Batch Mode" operation for the Graph resource allows users to add multiple episodes of data to a knowledge graph in a single batch request. This is useful when you have several pieces of structured or unstructured information (episodes) that you want to ingest into the graph simultaneously, improving efficiency and reducing the number of API calls.

Typical use cases include:

  • Importing a collection of text or JSON documents representing events or interactions related to a user or graph.
  • Bulk uploading conversation episodes or logs to build or update a knowledge graph.
  • Efficiently adding multiple data points for analysis or querying within the graph.

For example, if you have a set of customer interaction transcripts or event logs, you can add them all at once as episodes to the graph, specifying their type (text or JSON), which helps organize and structure the data for later retrieval or analysis.

Properties

Name Meaning
User ID The unique identifier of the user. Optional if Graph ID is provided. Used to associate data with a specific user.
Graph ID The unique identifier of the graph. Required for most operations unless User ID is used instead. Specifies the target graph for the data.
Data Type The type of data being added. Options: Text, JSON, Message. Determines how the data is interpreted.
Episodes A collection of episodes to add in batch mode. Each episode includes:
- Data: The content of the episode (string).
- Type: The type of episode data (Text or JSON).

Output

The node outputs a JSON object representing the response from the Zep Cloud API after adding the batch of episodes to the graph. This typically includes confirmation details such as IDs of created episodes or status messages.

No binary data output is involved in this operation.

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-batch.
  • Proper configuration of the API authentication credential in n8n is necessary.

Troubleshooting

  • Missing Graph ID or User ID: The operation requires either a Graph ID or a User ID to be specified. If neither is provided, the node will throw an error indicating that one must be supplied.
  • Invalid Episode Data: Each episode must have non-empty data and a valid type (text or json). Omitting required fields or providing invalid types may cause API errors.
  • API Authentication Errors: Ensure the API key credential is correctly configured and has sufficient permissions.
  • Payload Size Limits: Sending very large batches might hit API limits or timeouts; consider splitting data into smaller batches if issues occur.

Links and References


Summary of execute() logic for "Graph" resource and "Add Data in Batch Mode" operation:

  • Retrieves input parameters: episodes array, graphId, userId.
  • Validates that either graphId or userId is provided.
  • Constructs a request body with episodes mapped to objects containing data and type.
  • Adds graphId or userId to the request body accordingly.
  • Sends a POST request to /api/v2/graph-batch endpoint with the constructed body.
  • Returns the API response as JSON output.

Discussion