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.
AstraDBChatMemory Component
This component creates anAstraDBChatMessageHistory instance, which stores and retrieves chat messages using Astra DB, a cloud-native database service.
Parameters
Parameters
Inputs
Outputs
| Name | Type | Description |
|---|---|---|
| collection_name | String | The name of the Astra DB collection for storing messages. Required. |
| token | SecretString | The authentication token for Astra DB access. Required. |
| api_endpoint | SecretString | The API endpoint URL for the Astra DB service. Required. |
| namespace | String | The optional namespace within Astra DB for the collection. |
| session_id | MessageText | The unique identifier for the chat session. Uses the current session ID if not provided. |
| Name | Type | Description |
|---|---|---|
| message_history | BaseChatMessageHistory | An instance of AstraDBChatMessageHistory for the session. |
CassandraChatMemory Component
This component creates aCassandraChatMessageHistory instance, enabling storage and retrieval of chat messages using Apache Cassandra or DataStax Astra DB.
Parameters
Parameters
Inputs
Outputs
| Name | Type | Description |
|---|---|---|
| database_ref | MessageText | The contact points for the Cassandra database or Astra DB database ID. Required. |
| username | MessageText | The username for Cassandra. Leave empty for Astra DB. |
| token | SecretString | The password for Cassandra or the token for Astra DB. Required. |
| keyspace | MessageText | The keyspace in Cassandra or namespace in Astra DB. Required. |
| table_name | MessageText | The name of the table or collection for storing messages. Required. |
| session_id | MessageText | The unique identifier for the chat session. Optional. |
| cluster_kwargs | Dictionary | Additional keyword arguments for the Cassandra cluster configuration. Optional. |
| Name | Type | Description |
|---|---|---|
| message_history | BaseChatMessageHistory | An instance of CassandraChatMessageHistory for the session. |
Mem0 Chat Memory
Redis Chat Memory
This component retrieves and stores chat messages from Redis.Parameters
Parameters
Inputs
Outputs
| Name | Display Name | Info |
|---|---|---|
| host | hostname | The IP address or hostname. |
| port | port | The Redis Port Number. |
| database | database | The Redis database. |
| username | Username | The Redis username. |
| password | Password | The password for the username. |
| key_prefix | Key prefix | The key prefix. |
| session_id | Session ID | The unique session identifier for the message. |
| Name | Display Name | Info |
|---|---|---|
| memory | Memory | The Redis chat message history object |