---
title: Chat Memory
description: Lets an agent remember the conversation, across runs or within one run
---

Lets an agent remember the conversation, across runs or within one run.

## What it does

Chat Memory gives an agent a conversation history. Plug it into the **Memory** slot of a [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/), a [RAG Agent](/nodes/builtin/ai/aiagents/ragnode/) or a [Chat Trigger](/nodes/builtin/trigger/chat/). Before calling the model, the agent reads the earlier messages from the memory; after answering, it saves your message and its reply.

Conversations are stored **in your browser**, on this device. Every saved conversation is listed on the [Memory page](/app/memory/overview/), where you can read, search, export or clear it.

* **With a Chat Trigger**, connect the **same** Chat Memory to the trigger and to its agent. The chat window then shows the history and reopening it continues the conversation. With **This run only**, or a **Key** that is an expression, the conversation isn't known before a run, so the chat window keeps no history.
* **When you publish or share** the workflow, the picked **Conversation** is cleared (it only exists on your device). Whoever installs it gets a fresh, empty conversation. Keys are kept.
* **When you delete a workflow**, AWFlow offers to delete its own conversations. **Shared** keys, and conversations another workflow uses, are kept.

It replaces Local Memory, Persistent Chat Memory and Window Buffer Memory. Workflows that use them keep working and are turned into Chat Memory when you save them:

| Old node | Becomes Chat Memory with |
| --- | --- |
| [Local Memory](/nodes/builtin/ai/aidependencies/chatmemories/localmemory/) | **Conversation** storage, the same conversation. |
| [Persistent Chat Memory](/nodes/builtin/ai/aidependencies/chatmemories/persistentmemory/) | **Key** storage, the same key, **Shared** scope. |
| [Window Buffer Memory](/nodes/builtin/ai/aidependencies/chatmemories/windowbuffermemory/) | **This run only**, **Last N messages** with N = 2 × the old window size. |

## When to use it

* A chatbot built with a [Chat Trigger](/nodes/builtin/trigger/chat/).
* An agent that runs again and again (on a schedule, on page load) and should remember earlier runs.
* One conversation **per user or per thread**, with a key such as `{{ $input.userId }}`.
* An agent that calls several tools in one run and should remember the exchange only for that run.

## Inputs and settings

The fields change with **Storage** and **History sent to the model**.

**Storage** decides where the conversation is kept:

| Storage | The conversation… | Good for |
| --- | --- | --- |
| **Conversation** (default) | is one saved conversation: the one you pick in **Conversation**, or this node's own when you pick none. | A single chatbot, a recurring agent. |
| **Key** | is named by **Key**. Every run with the same key continues the same conversation. | One conversation per user, per ticket, per page. |
| **This run only** | lives only while the workflow runs. Nothing is saved. | Multi-step reasoning inside one run. |

**Key scope** (with **Key**): **This workflow** (default) keeps the key private to this workflow, so two workflows using `inbox` don't mix. **Shared** lets several workflows continue the same conversation.

**History sent to the model**:

* **As much as fits** (default): the newest messages that fit the connected model's context window, keeping room for the reply.
* **Last N messages**: at most **Messages** messages (20 by default; a question and its answer are two).

**Summarise older messages** (on by default): messages that no longer fit are folded into a short summary the model still sees. It costs an extra model call now and then.

**Remember tool results** (on by default): the agent's tool calls and results are saved with its replies, so a later message can refer to them ("what was the price you found?") without running the tools again.

## Outputs

This node has no output port. It plugs into a slot on another node instead of passing items along.

* **Memory** slot of [Chat Trigger](/nodes/builtin/trigger/chat/), [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/), [RAG Agent](/nodes/builtin/ai/aiagents/ragnode/)

Chat Memory has no output. It hands its memory to the node it is connected to.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

1. A [Chat Trigger](/nodes/builtin/trigger/chat/) with **Assistant name** `Shopping helper`.
2. A [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/) with **Prompt** `{{ $input.chatInput }}`, a chat model such as [Chat OpenAI](/nodes/builtin/ai/aidependencies/llm/openai/) in its **Model** slot, and [Web Search](/nodes/builtin/ai/aidependencies/tools/web-search/) in its **Tools** slot.
3. One Chat Memory, **Storage** `Conversation`, connected to **both** the Chat Trigger's and the agent's **Memory** slot.
4. Chat with it: ask for a product, then "which one was cheapest?". The agent remembers the earlier answer and its search results.

## Common issues

* **The agent forgets between runs.** **Storage** is **This run only**, which forgets everything when the run ends. Use **Conversation** or **Key**.
* **"Pick a conversation, or save the workflow to give this memory its own."** With **Conversation** storage and none picked, the node needs a saved workflow. Save it, or pick a conversation.
* **"Conversation Key is required".** **Storage** is **Key** but **Key** is empty, or its expression gave nothing. Fill it in.
* **"This workflow is not saved yet, so the key cannot be scoped to it: memory lasts for this run only."** Save the workflow so a **This workflow** key can be kept.
* **The chat window stays empty.** The trigger and the agent must use the same Chat Memory node, with **Conversation** storage or a fixed **Key**.

## Related nodes

* [Chat Trigger](/nodes/builtin/trigger/chat/): a chat window that runs your workflow.
* [Tools Agent](/nodes/builtin/ai/aiagents/toolsagentnode/) and [RAG Agent](/nodes/builtin/ai/aiagents/ragnode/): the agents that accept it.
* [Memory page](/app/memory/overview/): read, slim, export or clear saved conversations.
* [Memory & Context](/concepts/ai/memory-context/): how memory and context windows work.