Skip to main content
Memory components store and retrieve chat messages. They are distinct from vector store components because they are built specifically for storing and retrieving chat messages from external databases. Memory components provide access to their respective external databases as memory. This allows Large Language Models (LLMs) or agents to access external memory for persistence and context retention.

Use a memory component in a flow

This example flow stores and retrieves chat history from an LLMC Vector DB Chat Memory component with Store Message and Message history components. The Store Message helper component stores chat memories as Data objects, and the Message History helper component retrieves chat messages as Data objects or strings. Now Pn

AstraDBChatMemory Component

This component creates an AstraDBChatMessageHistory instance, which stores and retrieves chat messages using Astra DB, a cloud-native database service.
Inputs
NameTypeDescription
collection_nameStringThe name of the Astra DB collection for storing messages. Required.
tokenSecretStringThe authentication token for Astra DB access. Required.
api_endpointSecretStringThe API endpoint URL for the Astra DB service. Required.
namespaceStringThe optional namespace within Astra DB for the collection.
session_idMessageTextThe unique identifier for the chat session. Uses the current session ID if not provided.
Outputs
NameTypeDescription
message_historyBaseChatMessageHistoryAn instance of AstraDBChatMessageHistory for the session.

CassandraChatMemory Component

This component creates a CassandraChatMessageHistory instance, enabling storage and retrieval of chat messages using Apache Cassandra or DataStax Astra DB.
Inputs
NameTypeDescription
database_refMessageTextThe contact points for the Cassandra database or Astra DB database ID. Required.
usernameMessageTextThe username for Cassandra. Leave empty for Astra DB.
tokenSecretStringThe password for Cassandra or the token for Astra DB. Required.
keyspaceMessageTextThe keyspace in Cassandra or namespace in Astra DB. Required.
table_nameMessageTextThe name of the table or collection for storing messages. Required.
session_idMessageTextThe unique identifier for the chat session. Optional.
cluster_kwargsDictionaryAdditional keyword arguments for the Cassandra cluster configuration. Optional.
Outputs
NameTypeDescription
message_historyBaseChatMessageHistoryAn instance of CassandraChatMessageHistory for the session.

Mem0 Chat Memory

Redis Chat Memory

This component retrieves and stores chat messages from Redis.
Inputs
NameDisplay NameInfo
hosthostnameThe IP address or hostname.
portportThe Redis Port Number.
databasedatabaseThe Redis database.
usernameUsernameThe Redis username.
passwordPasswordThe password for the username.
key_prefixKey prefixThe key prefix.
session_idSession IDThe unique session identifier for the message.
Outputs
NameDisplay NameInfo
memoryMemoryThe Redis chat message history object