Zep AI icon

Zep AI

AI Tool for interacting with Zep memory and knowledge graph. Provides operations to store/retrieve conversation memory, search knowledge graphs, and manage user context.

Overview

The "Get User Context" operation of the Zep AI node retrieves comprehensive contextual information related to a specific conversation thread. This includes summarized or basic context, relevant facts, and entities associated with the thread. It is useful in scenarios where you want to understand the current state or background of a user’s conversation, enabling more informed AI responses or analytics.

Practical examples:

  • A chatbot that adapts its replies based on the user's previous interactions within a conversation thread.
  • An AI assistant that summarizes key points from a long conversation for quick review.
  • Systems that track user context to personalize recommendations or support.

Properties

Name Meaning
Thread ID Unique identifier for the conversation thread (e.g., "thread-def456"). Required.
User ID The unique identifier of the user involved in the thread (e.g., "user-123"). Required for some operations but not specifically for this one.
Minimum Fact Rating Minimum rating threshold (0.0 to 1.0) to filter relevant facts when retrieving context. Only applies if searching edges. Default is 0.
Context Mode Mode of context retrieval:
- Summary: Provides a summarized context (default).
- Basic: Provides basic context with lower latency.

Output

The output JSON contains the following fields:

  • threadId: The ID of the conversation thread queried.
  • context: A string containing the retrieved context summary or basic context text.
  • facts: An array of fact objects related to the thread, filtered by minimum fact rating if specified.
  • entities: An array of entity objects associated with the thread.
  • response: The full raw response object returned from the API call, which may include additional metadata.

This output allows downstream nodes or workflows to utilize detailed user context data for further processing or decision-making.

Dependencies

  • Requires an active connection to the Zep AI API service.
  • Needs an API authentication token configured in n8n credentials (referred generically as an API key credential).
  • The base URL used for requests is https://api.getzep.com.
  • Proper permissions on the API key to access thread context endpoints.

Troubleshooting

  • Common issues:

    • Invalid or missing Thread ID will cause the API request to fail.
    • Insufficient API permissions or expired API keys can result in authentication errors.
    • Providing an invalid value for Minimum Fact Rating (outside 0.0–1.0) may cause unexpected filtering results.
    • Using Context Mode values other than "summary" or "basic" will be rejected.
  • Error messages:

    • "Unknown operation": Indicates the selected operation is not supported; ensure "getUserContext" is chosen.
    • "Invalid JSON in user metadata": Not applicable here but common in user creation; ensure JSON inputs are valid.
    • HTTP 401 Unauthorized: Check API key validity and permissions.
    • HTTP 404 Not Found: Likely caused by non-existent thread ID; verify the thread exists.

Links and References

Discussion