Skip to content

Cassandra Chat Memory

Cassandra Chat Memory stores the message history of a conversation in a table of an Apache Cassandra database owned by your company and retrieves it when needed. This way, components that answer questions take into account what was said before, and the history stays in your database.

Each history is identified by a Session ID: messages with the same identifier form one conversation.

When to use it

  • Your company already works with Cassandra and wants its assistants’ history stored there.
  • You expect a large volume of conversations and your IT team prefers Cassandra for it.
  • Your data policy requires the history to stay in your own database.

Configuration

Before you start you need a Cassandra database that NappAI can reach and a credential of the Cassandra DB service with the database identifier (or the addresses of the cluster nodes), the user and the password or token. See Credentials.

FieldWhat it does
Credential (required)The credential of the Cassandra DB service. Pick one with Choose an option or create one with Add new credential.
Keyspace (required)The Cassandra keyspace (the space that groups tables) that holds the history table.
Table Name (required)The name of the table where messages are stored.

Advanced options

FieldWhat it does
Session IDThe identifier of the history. Type it or connect it, for example to the customer number. Conversations with the same Session ID share their history.
Cluster argumentsOptional. Extra connection settings for the cluster, as name and value pairs. Fill it in only if your IT team tells you to.

Output

Memory is the conversation history. Connect it to the External Memory input of Retrieval QA History, which reads the history before answering and saves each question and answer to it, or of Chat Memory, which reads the stored messages to use them elsewhere in the flow. If you connect it to Chat Memory, the Session ID of Chat Memory is used.

It does not connect to the Memory input of agents. To make an agent remember the conversation, turn on Use memory in the agent.

Example

Telecom Rivera uses an assistant to answer customer questions about its plans:

  1. Create a Cassandra DB credential with the connection details your IT team gives you.
  2. Add Cassandra Chat Memory, choose that credential and type atencion in Keyspace and historial_chat in Table Name.
  3. Connect the customer’s line number to Session ID.
  4. Connect Memory to the External Memory input of Retrieval QA History.

Every question and answer is stored in Telecom Rivera’s database, and the assistant follows the thread when the customer asks “and with fibre included?”.

Good practices

  • Use a different Session ID for each customer or case so histories don’t mix.