> 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/technical-reference/models-agents-and-skills/conversation-memory-and-context-windows.md).

# Conversation Memory and Context Windows

Conversation memory makes earlier exchanges available to later requests. The model still has a finite context window, so retained history and context sent for one response are not identical.

{% embed url="<https://1957915746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2Fg1mFg4WSQIcmR17UFNEP%2Fconversation-memory-and-context-windows.mp4?alt=media&token=e812131c-ffa1-4be3-915c-9f78dff22766>" %}
A short walkthrough of conversation memory and context windows.
{% endembed %}

## Before you begin

A memory-enabled node and a consistent conversation or memory identifier for related requests.

## How conversation memory works

| Term                | Definition                                                                                                                                                            |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Conversation memory | Earlier exchanges made available for later requests in the configured scope. Saved messages and the context used for an individual response are not identical.        |
| Context window      | The amount of information a model can consider for a request. Instructions, history, source passages, and tool results compete for this capacity.                     |
| Sliding window      | A memory configuration that retains a bounded portion of recent conversation history for use. Older material can leave the active context as new exchanges are added. |
| Token               | A unit used by a model to process text or other supported input and output. Token counts do not map to a fixed number of words across content and models.             |

## Memory settings

| Setting                 | What it does                                                                                |
| ----------------------- | ------------------------------------------------------------------------------------------- |
| Memory                  | Includes conversation history in later requests within the configured memory scope.         |
| Source of User Messages | Selects the input used as the user message in the saved conversation.                       |
| View Memory             | Opens the retained conversation messages for inspection.                                    |
| Clear                   | Removes memory in the selected scope. It does not remove instructions or knowledge sources. |

## Configure conversation memory

1. Open the node’s settings and expand **Conversation Memory**. Enable **Memory** and select the memory configuration.
2. Set **Source of User Messages** to the input that contains the user’s message. Use the same intended memory scope for related requests.
3. Send related requests, then select **View Memory** to inspect the retained messages. Check the response to confirm that the required earlier information is available.

<figure><img src="https://1957915746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FyKdqVdlEzlRITHdu8rpC%2Fconversation-memory.png?alt=media" alt="Conversation memory controls in StackAI" width="800"><figcaption><p>Enable Memory to include conversation history in later requests. Source of User Messages selects the input used as the user message in that history. Use View Memory to inspect the retained messages. Clear removes memory in the selected scope; it does not remove the workflow’s instructions or its knowledge sources.</p></figcaption></figure>

Later responses can use relevant earlier exchanges in the same scope.

## Behavior and limitations

Older exchanges can be omitted from a request when the conversation exceeds the model’s context limit. Retained conversation history is not a guarantee that every earlier detail remains available to the model. Keep durable business records in an appropriate data source rather than relying only on chat memory.

## Related resources

[Model Settings and Supported Capabilities](https://docs.stackai.com/technical-reference/models-agents-and-skills/model-settings-and-supported-capabilities.md)


---

# 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/technical-reference/models-agents-and-skills/conversation-memory-and-context-windows.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.
