> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory capabilities

> Persist conversation context across messages with automatic session memory retrieval.

## Overview

Session memory lets AI nodes in chat-driven workflows access previous messages from the current
conversation. When enabled, FlowX automatically retrieves recent conversation history and injects it
into the LLM's context — giving the AI agent awareness of what was discussed earlier in the session.

Memory is **per-session** (identified by Chat Session ID) and managed entirely by FlowX. You don't
need to build any memory retrieval logic — just toggle it on per node.

<CardGroup cols={2}>
  <Card title="Automatic retrieval" icon="clock-rotate-left">
    The recent conversation history is retrieved and attached on each message
  </Card>

  <Card title="Verbatim context" icon="align-left">
    The last 30 turns are sent to the model in full, oldest to newest — no lossy summarization
  </Card>

  <Card title="Per-node control" icon="toggle-on">
    Turn memory on per AI (Custom Agent) or Intent Classification node with the **Use conversation memory** toggle
  </Card>

  <Card title="Memory tab in console" icon="terminal">
    Inspect the conversation context that was sent to the model in the workflow console log
  </Card>
</CardGroup>

***

## How memory works

<Steps>
  <Step title="User sends a message">
    The Chat component sends the message + `chatSessionId` to the chat-driven workflow.
  </Step>

  <Step title="Memory retrieval">
    FlowX retrieves the recent conversation history for the session — the last 30 turns (each a user
    message and the agent's response).
  </Step>

  <Step title="Context injection">
    For each node with **Use conversation memory** enabled, the retrieved turns are added to the LLM
    prompt in full (oldest to newest), giving the AI agent context from earlier in the session.
  </Step>

  <Step title="Response and storage">
    After the AI generates a response, FlowX stores both the user message and the agent response,
    so they're available as memory on the next message.
  </Step>
</Steps>

***

## What gets sent to the model

When memory is enabled, the recent turns are wrapped in a `<history>` block and added to the prompt,
introduced as "Prior conversation between the user and the assistant (oldest to newest)":

```
<history>
<turn>
<user>How do I verify my account?</user>
<assistant>Navigate to Settings and select Verification.</assistant>
</turn>
<turn>
<user>What documents do I need?</user>
<assistant>You need a valid ID and proof of address.</assistant>
</turn>
</history>
```

* The last **30 turns** are included **in full** — there is no summarization or truncation of older
  turns within that window.
* A turn the user cancelled mid-response is marked as cancelled rather than dropped.

<Tip>
  Only user messages and agent responses are included in memory. Internal workflow data, routing
  decisions, and intermediate node outputs are not part of the memory.
</Tip>

***

## Enabling memory

<Frame>
  ![AI node with the Use conversation memory toggle enabled](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/5.6/custom_agent_use_memory.png)
</Frame>

Memory is controlled per node with the **Use conversation memory** toggle, in the node's **Background**
section. It's available on:

* **AI (Custom Agent)** nodes — for context-aware AI responses
* **Intent Classification** nodes — for more accurate classification using conversation history

**Default:** OFF

When enabled, the node sends the `chatSessionId` with its request; FlowX retrieves the recent turns
and attaches them to the LLM call.

<Warning>
  Memory is only available in **conversational** workflows. The toggle does not appear on nodes in
  output-focused workflows.
</Warning>

***

## Inspecting memory in the console

<Frame>
  ![Memory tab in the workflow console showing the conversation context sent to the model](https://s3.eu-west-1.amazonaws.com/docx.flowx.ai/5.6/memory_tab_workflow_console.png)
</Frame>

When an AI node with **Use conversation memory** enabled completes, the workflow console log includes
a **Memory** tab showing the conversation context that was available to the model for that run:

* A **Conversation Summary** heading followed by the conversation's title.
* The most recent user/agent turns from the session.

The node returns this as a `memoryUseSummary` object:

```json theme={"dark"}
{
  "summary": "Account setup",
  "chatMessages": [
    {
      "messageId": "msg-003",
      "userMessage": "What documents do I need?",
      "agentResponse": "You need a valid ID and proof of address."
    },
    {
      "messageId": "msg-002",
      "userMessage": "How do I verify my account?",
      "agentResponse": "Navigate to Settings and select Verification."
    }
  ]
}
```

<Note>
  The **Memory** tab is a preview of recent turns for debugging; the `summary` field carries the
  conversation's title, and `chatMessages` lists the most recent turns. The full set of turns sent to
  the model (up to 30) is what the AI node actually receives — see [What gets sent to the
  model](#what-gets-sent-to-the-model).
</Note>

<Tip>
  The Memory tab only appears when `memoryUseSummary` data exists for the workflow instance. If you
  don't see it, verify that **Use conversation memory** is enabled on at least one node.
</Tip>

***

## Storage

| Data             | Storage                          | Details                                                |
| ---------------- | -------------------------------- | ------------------------------------------------------ |
| Session ID       | Browser storage + FlowX Database | Links the client chat instance to the server session   |
| Message history  | FlowX Database                   | Complete record of user and agent messages per session |
| Session metadata | FlowX Database                   | Timestamps, workflow reference, user info              |

Session memory is tied to the `chatSessionId` — the same session ID retrieves the same memory across
workflow runs. The Chat component manages session IDs automatically.

***

## Limitations

* Memory is **session-scoped** — there is no cross-session or cross-user memory.
* The last **30 turns** are sent to the model; turns older than that window are not included.
* Memory cannot be manually edited or cleared from the Designer UI.
* Only **user messages** and **agent responses** are stored — internal workflow data is excluded.

***

## Related resources

<CardGroup cols={2}>
  <Card title="Chat-driven workflows" icon="comments" href="/5.9/ai-platform/chat-driven-workflows">
    Full guide to building chat-driven workflows with memory and intent routing
  </Card>

  <Card title="Chat component" icon="message" href="/5.9/ai-platform/chat-component">
    Runtime behavior, session management, and display modes
  </Card>

  <Card title="Intent Classification" icon="bullseye" href="/5.9/ai-platform/agent-builder/intent-classification">
    Route conversations based on detected user intent with optional memory
  </Card>

  <Card title="Custom Agent node" icon="robot" href="/5.9/docs/platform-deep-dive/integrations/custom-agent-node">
    Configure AI nodes with memory, chat reply, and response settings
  </Card>
</CardGroup>


## Related topics

- [FlowX.AI 5.6.0 Release Notes](/release-notes/v5.x/v5.6.0-march-2026/v5.6.0-march-2026.md)
- [FlowX.AI 5.9.0 Release Notes](/release-notes/v5.x/v5.9.0-june-2026/v5.9.0-june-2026.md)
- [Chat-driven workflows](/5.9/ai-platform/chat-driven-workflows.md)
- [UI Flows](/5.9/docs/building-blocks/ui-flows.md)
- [ModPod setup](/5.9/setup-guides/modpod-setup.md)
