Overview
The Aigency Chat Memory node stores and manages chat history using the Aigency storage service. It is designed to keep track of past interactions in a conversational AI context, enabling models to access recent dialogue history as context for generating more coherent and relevant responses.
This node is beneficial in scenarios where maintaining conversation state across multiple turns is important, such as customer support bots, virtual assistants, or any interactive AI system that requires memory of previous exchanges.
For example, a chatbot can use this node to retrieve the last few messages exchanged with a user (based on a session ID) and provide those as context to an AI model, improving the quality of replies by referencing prior conversation.
Properties
| Name | Meaning |
|---|---|
| User ID | Numeric identifier representing the user whose chat history is being stored or retrieved. |
| Session ID | String identifier for the specific chat session to isolate conversation history. |
| Context Window Length | Number indicating how many past interactions (messages) are included as context for the model. |
Output
- The node outputs a memory buffer object keyed as
"chat_history". - This buffer contains the recent chat messages retrieved from Aigency storage, limited by the specified context window length.
- The output includes both input and output messages formatted as chat message objects, suitable for feeding into AI models expecting conversational context.
- No binary data output is produced by this node.
Dependencies
- Requires access to the Aigency API service for storing and retrieving chat messages.
- Needs an API key credential and API URL endpoint configured either via environment variables (
AIGENCY_API_KEYandAIGENCY_API_URL) or through n8n credentials configuration. - Uses JSON-RPC over HTTP POST requests to communicate with the Aigency backend.
- Depends on external libraries for chat message handling and memory buffering.
Troubleshooting
- Missing Credentials: If API key or URL are not set, the node will throw an error instructing to configure these either in environment variables or n8n credentials.
- Connection Issues: Errors during connection tests or API calls may indicate invalid credentials or unreachable API endpoints.
- API Errors: If the Aigency API returns errors (e.g., invalid session ID), the node throws application errors with the received message.
- Incorrect Property Values: Ensure
User IDis a number andSession IDis a non-empty string; otherwise, the node may fail to fetch or store messages correctly.
Links and References
- Aigency API Documentation (replace with actual URL if available)
- n8n Documentation - Creating Custom Nodes
- LangChain Chat Memory Concepts