AI Agent memory
Wire a memory node to the Memory port of an AI Agent and the agent remembers the conversation. Before the agent plans its first step, FluidGrids loads the earlier messages of the conversation and puts them in front of the new prompt. After the agent answers, FluidGrids saves the new turn. A chat agent, a support bot or the chat deployment of a workflow can then carry on from where the last run stopped.
What each memory node does
| Node | The conversation lasts | Stored in | Use it for |
|---|---|---|---|
| Buffer Window Memory (this run only) | The current run | The run itself. It is dropped when the run ends. | An agent that loops, or is called several times in one run |
| Redis Chat Memory | Across runs, until the TTL expires (24 hours by default) | Your Redis, through the node's own connection | Chat and support agents |
| Postgres Memory | Across runs, until you delete it | Your Postgres, through the node's own connection | Conversations you need to keep or audit |
The older Buffer Window Memory node (version 1.0.0) is now run-scoped as well. It never kept history between runs, because it lived inside a sandbox that is discarded after the run.
Which conversation a run belongs to
The agent reads and writes one conversation, found by its session id. FluidGrids takes the first of these that is set:
- The Session ID input of the AI Agent node.
- The run's trigger data:
conversationId, thensessionId. A trigger or API call that starts the run with one of these fields supplies the conversation. The builder's Chat panel starts runs with Trigger Manually and sends no conversation id, so for a chat agent set the Session ID on the agent node. - The Session ID set on the memory node. Treat it as a default.
If none is set, the Buffer memory uses one conversation per run. Redis and Postgres memory have no conversation to use, so the agent runs without memory and the run log says why. Nothing is saved under an invented id.
Starting over in the Chat panel. The Chat panel's Clear chat only clears the panel. It does not clear a stored history, so a fixed Session ID keeps the old conversation. To start a fresh conversation, change the Session ID, or run Clear History on the memory node for that id.
Two runs that resolve to the same session id on the same connection share one history, even in different workflows. A session id gives access to that history, so use an id that cannot be guessed (for example a random UUID per conversation) and never an id a visitor can choose freely.
What is loaded and saved
- Window. The memory node's Window size is the number of messages loaded (default 10, at most 200). A user message and the agent's answer count as two. The window always starts at a user message.
- After the answer. The new user message and the agent's final answer are saved. If the run fails before the agent answers, nothing is saved.
- Tool calls. Turn on Remember tool calls to save each tool call and its result as soon as the tool has run. They are saved as plain text, so later turns can refer to them on any chat model. Without it only the user messages and answers are kept.
- Summarise older turns. Turn on Summarise older turns and the turns that fall outside the window are summarised by the agent's own chat model and added to the agent's instructions. This costs one more model call per run, counted in the run's AI usage and budget. The summary is made again on each run; it is not stored.
- Approval pauses. If the agent waits for a tool approval, the turn is saved when the run resumes and the agent answers.
When memory is not available
Memory is best effort. If the memory store cannot be read, the agent answers without the earlier conversation. If it cannot be written, the agent still gives its answer and that turn is not remembered. Both are written to the run log as warnings. They do not fail the node.
Run the memory yourself
The memory nodes keep their own operations, so a workflow can still read or change history directly: Get History and Clear History on all three, and Append Messages on Redis and Postgres memory. Use Clear History to start a conversation over.
Developers: the memory port
The agent talks to its memory through two calls:
load(sessionId, limit)returns the lastlimitmessages of the session, oldest first.append(sessionId, messages)saves messages at the end of the session, in order.
A message is { role, content } with role one of user, assistant or system. Redis and Postgres memory implement the port with two node operations: Get History (getHistory, with the limit as windowSize) and Append Messages (appendMessages, with sessionId and messages). Both run as sandboxed calls with the memory node's own connection. A memory node of your own backs the port by providing those two operations.