Memory
Persist conversation messages across workflow executions
The Memory block stores and retrieves conversation messages that persist across workflow executions. It is designed to work alongside Agent blocks, giving your agents long-term conversational context that survives between runs.
Overview
Add Memory: Store a message with a role (user, assistant, or system) under a named memory ID
Get Memory: Retrieve a single memory entry by its ID
Get All Memories: Fetch every stored memory for the current workflow
Delete Memory: Remove a memory entry by ID
How It Works
Memory entries are stored as chat-style messages with three required fields: an ID to scope the memory, a Role (user, assistant, or system), and the Content text. When you later retrieve memories and pass them into an Agent block's Memories input, the agent sees them as prior conversation turns -- enabling multi-turn dialogue across separate executions.
A typical conversational workflow uses three Memory blocks around an Agent:
- Memory (Add, role: user) -- save the incoming user message before the Agent runs
- Agent -- processes the message with retrieved memories as context
- Memory (Add, role: assistant) -- save the Agent's response after it runs
Memory IDs scope the conversation. Use the same ID across executions to build a continuous conversation history, or use different IDs to maintain separate threads.
Operations
Stores a new message in the memory store.
| Field | Required | Description |
|---|---|---|
| ID | Yes | Memory identifier -- groups messages into a conversation |
| Role | Yes | user, assistant, or system |
| Content | Yes | The message text to store |
Retrieves all messages stored under a specific memory ID.
| Field | Required | Description |
|---|---|---|
| ID | Yes | The memory identifier to retrieve |
Returns every memory entry for the current workflow. No additional fields required.
Removes a memory entry by ID.
| Field | Required | Description |
|---|---|---|
| ID | Yes | The memory identifier to delete |
Configuration
Outputs
| Output | Type | Description |
|---|---|---|
memories | json | The retrieved memory data (messages array) |
id | string | The memory identifier that was operated on |
Best Practices
- Use consistent IDs -- the memory ID is the key that groups messages into a conversation. Use a stable identifier (such as a user ID or session ID) so memories accumulate correctly across runs.
- Store both sides of the conversation -- add a
userrole message before the Agent and anassistantrole message after it so the full dialogue is preserved. - Clean up when needed -- use the Delete operation to clear stale conversations and prevent unbounded memory growth.