Chat Memory
Chat Memory stores and reads the messages of a conversation in the memory you choose in Provider: NappAI’s own (Conversation, no credential), Redis, Postgres, Cassandra, AstraDB, Upstash Redis or Zep. Inside, it works exactly like that provider’s memory component.
The difference is that switching provider does not mean switching node: you change it in the field, or the application that calls the flow changes it through the API.
When to use it
- You start with NappAI’s memory and want to be able to move to your own database without rebuilding the flow.
- Your application serves several customers and each one stores the conversations in its own database.
If the memory will not change, use its own component, such as Redis Chat Memory or Postgres Chat Memory.
Configuration
| Field | What it does |
|---|---|
| Provider | Where the conversation is stored. Default: Conversation, NappAI’s memory, which needs no credential or database. Choose it first: when you change it, the node asks for that provider’s credential. |
| Credential (required if the provider uses one) | The connection to the chosen provider’s database. The list only shows that provider’s credentials. See Credentials. |
The node remembers the credential you choose for each provider: when you go back to a provider you already set up, its credential comes back by itself.
Advanced options
| Field | What it does |
|---|---|
| Session ID | The conversation that is stored and read. Empty: the flow’s current session. Type it or connect it, for example with the customer number. |
| Provider Settings | Other fields of the provider’s own component, each with its own name, such as the table name. Fields the provider does not have are ignored. |
| Credentials by Provider | The credential the node remembers for each provider. It fills itself in when you choose a credential. |
Switching the provider through the API
From another application, change the provider and the session with tweaks, using the node’s ID:
"tweaks": { "MultiProviderChatMemory-m4t8w": { "provider": "Postgres", "session_id": "customer-42" }}The provider must have been set up on the canvas before, with its credential; otherwise, send credential_id too. More in Changing fields for one call.
Output
Memory is the conversation’s history. Connect it to the External Memory input of the Chat Memory in Helpers or of Retrieval QA History.
It does not connect to agents. For an agent to remember the conversation, turn it on in the agent’s own memory.
Example
An online shop tests its help assistant with NappAI’s memory and, when it goes live, wants to store the conversations in its own Postgres database.
- Add Chat Memory and connect Memory to External Memory of Retrieval QA History.
- While testing, leave
Conversationin Provider. - For the launch, switch to
Postgresand choose its database credential. Nothing else in the flow needs to change.
Good practices
- Each provider keeps its own messages: when you switch provider, the earlier conversation does not follow.
- Use the same Session ID for all the messages of one customer so the flow remembers what was already said.
Related components
- Chat Memory (Helpers): reads the history to use it in the flow.
- Conversation Chat Memory: NappAI’s memory with a fixed provider.
- Language Model and Vector Store: other components where you choose the provider.