> ## Documentation Index
> Fetch the complete documentation index at: https://docs.llmcontrols.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory components in LLM Controls

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](/Components/Agents) to access external memory for persistence and context retention.

## **Use a memory component in a flow**[**​**](https://docs.langflow.org/components-memories#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](/Concepts/LLMCobjects) objects, and the **Message History** helper component retrieves chat messages as [Data](/Concepts/LLMCobjects) objects or strings.

<img src="https://mintcdn.com/devrel/9PuWEwunOBJ8KxNm/images/now.png?fit=max&auto=format&n=9PuWEwunOBJ8KxNm&q=85&s=d6d5282b9e14fdfcd263112f59e064dc" alt="Now Pn" width="2694" height="1558" data-path="images/now.png" />

## **AstraDBChatMemory Component**[**​**](https://docs.langflow.org/components-memories#astradbchatmemory-component)

This component creates an `AstraDBChatMessageHistory` instance, which stores and retrieves chat messages using Astra DB, a cloud-native database service.

<Accordion title="Parameters">
  **Inputs**

  | **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. |

  **Outputs**

  | **Name**         | **Type**               | **Description**                                           |
  | :--------------- | :--------------------- | :-------------------------------------------------------- |
  | message\_history | BaseChatMessageHistory | An instance of AstraDBChatMessageHistory for the session. |
</Accordion>

## **CassandraChatMemory Component**[**​**](https://docs.langflow.org/components-memories#cassandrachatmemory-component)

This component creates a `CassandraChatMessageHistory` instance, enabling storage and retrieval of chat messages using Apache Cassandra or DataStax Astra DB.

<Accordion title="Parameters">
  **Inputs**

  | **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.  |

  **Outputs**

  | **Name**         | **Type**               | **Description**                                             |
  | :--------------- | :--------------------- | :---------------------------------------------------------- |
  | message\_history | BaseChatMessageHistory | An instance of CassandraChatMessageHistory for the session. |

  ## **Mem0 Chat Memory**
</Accordion>

## **Redis Chat Memory**

This component retrieves and stores chat messages from Redis.

<Accordion title="Parameters">
  **Inputs**

  | **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. |

  **Outputs**

  | **Name** | **Display Name** | **Info**                              |
  | :------- | :--------------- | :------------------------------------ |
  | memory   | Memory           | The Redis chat message history object |
</Accordion>
