DynamoDB Chat Memory
Overview
The DynamoDB Chat Memory feature allows you to store and retrieve conversation history using Amazon DynamoDB. This powerful integration enables long-term persistence of chat messages, making it ideal for applications that require durable and scalable conversation storage.
Key Benefits
- Persistent Storage: Safely store conversation history in a reliable and scalable AWS service.
- Seamless Integration: Easily incorporate long-term memory into your AnswerAI workflows.
- Flexible Configuration: Customize settings to match your specific DynamoDB setup and requirements.
How to Use
-
Add the "DynamoDB Chat Memory" node to your AnswerAI canvas.
-
Configure the node with the following required parameters:
- Table Name: The name of your DynamoDB table
- Partition Key: The primary key for your table
- Region: The AWS region where your table is located (e.g., "us-east-1")
-
(Optional) Set additional parameters:
- Session ID: A unique identifier for the conversation (if not specified, a random ID will be generated)
- Memory Key: The key used to store the chat history (default is "chat_history")
-
Connect your AWS credentials:
- Click on the "Connect Credential" option
- Select or create a credential of type "dynamodbMemoryApi"
- Provide your AWS Access Key ID and Secret Access Key
-
Connect the DynamoDB Chat Memory node to other nodes in your workflow that require access to conversation history.
Tips and Best Practices
- Ensure your DynamoDB table is set up with the correct partition key before using this feature.
- Use a consistent session ID across interactions to maintain continuity in long-running conversations.
- Implement proper security measures to protect your AWS credentials and access to the DynamoDB table.
- Monitor your DynamoDB usage to optimize cost and performance.
Troubleshooting
-
Connection Issues:
- Verify that your AWS credentials are correct and have the necessary permissions to access the DynamoDB table.
- Check if the specified AWS region matches the location of your DynamoDB table.
-
Data Not Persisting:
- Ensure the table name and partition key are correctly specified.
- Verify that the session ID is consistent across interactions if you're trying to retrieve previous conversation history.
-
Performance Concerns:
- If you experience slow response times, consider optimizing your DynamoDB table's read and write capacity units.
For more advanced usage and integration details, refer to the AnswerAI API documentation on DynamoDB Chat Memory implementation.