> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/guides-and-quickstarts/workflow-builder/conversation-memory.md).

# Conversation memory

Conversation memory supplies earlier messages to a model. Use it when users need to ask follow-up questions without repeating information.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FPYklLvmL5TLC1h8fr9hI%2FG030.mp4?alt=media&token=ef259b08-1731-4d3b-a3ad-57f24a9c0e53>" %}

## Enable conversation memory

Open Settings → Conversation Memory and enable Memory. Choose the retention method and configure its settings.

![Conversation Memory retention settings](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/sSAZMOvrkEZAaqMo15CJ/assets/g030-g030-01-memory-settings.png)

Memory supplies earlier messages from the same conversation to the model.

## Use earlier messages

Send information that a later message will refer to.

![Initial message for a later follow-up](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/BltGBSQHCbryAartoDDL/assets/g030-g030-02-first-message.png)

Conversation memory makes earlier exchanges available beyond the current message.

Ask a follow-up that depends on the earlier exchange.

![Follow-up response using earlier messages](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/qz0roYupDXguUP4HntpC/assets/g030-g030-03-recalled-answer.png)

Inspect whether the answer uses the relevant conversation context.

## Inspect stored messages

Open View Memory to inspect the stored messages and responses.

![Stored conversation in View Memory](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/m0SdyJcMOfbcUJWDGSre/assets/g030-g030-04-history.png)

This helps explain which earlier information is available to the model.

## Clear builder memory

Select Clear Test Memory when you want to clear the conversation stored by the builder.

![Clear Test Memory action](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/sNC9EhIs881Mhif7vV8t/assets/g030-g030-05-empty-memory.png)

This removes the earlier context used by subsequent requests in that builder conversation.

After clearing memory, send a new request.

![New request after clearing builder memory](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/qyniGbRYVs1UBmrtPj1L/assets/g030-g030-06-reset-result.png)

Include any information the model needs again, because the removed messages are no longer available.

## Important behavior

Messages must belong to the same conversation to share its memory. A new conversation has separate context.

Window Size controls how much history remains available. Eviction Stride controls how much is removed as the sliding window advances.

## Choose an initial retention size

For sliding-window memory, **Window Size** is measured in stored messages, not days. **Eviction Stride** is the number of oldest messages removed together when the window is full. For example, a stride of 2 removes two older messages in a batch; it does not mean two days of retention. Check **View Memory** after a short exchange to see which messages are present. Use a size that retains the context your task needs and test a follow-up near the limit.

Clearing builder test memory is separate from organization-wide data retention. See [Data retention](https://docs.stackai.com/guides-and-quickstarts/organization-administration/data-retention.md) for the organization’s storage policy.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/guides-and-quickstarts/workflow-builder/conversation-memory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
