Database Memory
Database memory components provide persistent chat memory storage using various database systems for scalable conversation history management.
AstraDB Chat Memory
This component creates an AstraDBChatMessageHistory
instance, which stores and retrieves chat messages using Astra DB, a cloud-native database service.
Inputs
collection_name
String
Name of the Astra DB collection for storing messages. Required.
token
SecretString
Authentication token for Astra DB access. Required.
api_endpoint
SecretString
API endpoint URL for the Astra DB service. Required.
namespace
String
Optional namespace within Astra DB for the collection.
session_id
MessageText
Chat session ID. Uses current session ID if not provided.
Outputs
message_history
BaseChatMessageHistory
An instance of AstraDBChatMessageHistory for the session.
Cassandra Chat Memory
This component creates a CassandraChatMessageHistory
instance, enabling storage and retrieval of chat messages using Apache Cassandra or DataStax Astra DB.
Inputs
database_ref
MessageText
Contact points for Cassandra or Astra DB database ID. Required.
username
MessageText
Username for Cassandra (leave empty for Astra DB).
token
SecretString
Password for Cassandra or token for Astra DB. Required.
keyspace
MessageText
Keyspace in Cassandra or namespace in Astra DB. Required.
table_name
MessageText
Name of the table or collection for storing messages. Required.
session_id
MessageText
Unique identifier for the chat session. Optional.
cluster_kwargs
Dictionary
Additional keyword arguments for Cassandra cluster configuration. Optional.
Outputs
message_history
BaseChatMessageHistory
An instance of CassandraChatMessageHistory for the session.
Redis Chat Memory
This component retrieves and stores chat messages from Redis.
Inputs
host
hostname
IP address or hostname.
port
port
Redis Port Number.
database
database
Redis database.
username
Username
The Redis user name.
password
Password
The password for username.
key_prefix
Key prefix
Key prefix.
session_id
Session ID
Session ID for the message.
Outputs
memory
Memory
The Redis chat message history object
Usage Notes
Scalable Storage: Database solutions provide scalable memory storage for high-volume applications
Persistent Memory: Messages persist across sessions and application restarts
Multi-session Support: Each component supports multiple concurrent chat sessions
Enterprise Ready: Astra DB and Cassandra offer enterprise-grade features
High Performance: Redis provides fast in-memory storage for real-time applications
Flexible Deployment: Options for cloud-managed (Astra DB) or self-hosted (Cassandra, Redis) deployments
Last updated