> 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/memory-isolation-across-users-and-workflows.md).

# Memory Isolation Across Users and Workflows

Memory scope determines which stored messages a request can reuse. Authentication determines who is allowed to access resources. These concerns must remain separate.

![Separate conversation scope from authentication](https://1957915746-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2FLCYaTgfCmnIxonwmUWfp%2Fmemory-isolation-across-users-and-workflows.png?alt=media)

Illustrative backend boundary, not StackAI SDK syntax. Resolve ownership before forwarding a supported conversation identifier. Use the identity fields documented for your chosen interface or API version; do not invent a universal session field.

<details>

<summary>Copy the example</summary>

```python
caller = authenticate_request(request)
conversation = conversations.get_for_user(
    caller.user_id, requested_conversation_id
)

# Forward only the conversation this caller can access.
invoke_with_supported_conversation_fields(conversation)

# A conversation ID alone never authenticates the caller.
```

</details>

## Before you begin

Control over the conversation identifiers used by your interface or API client.

## Key concepts

| Term           | Definition                                                                                                                                                                 |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Memory scope   | The project, node, and conversation context in which earlier exchanges can be reused. Keep unrelated users and conversations separate using the supported identity fields. |
| Conversation   | Related messages grouped into one interaction history. Several runs can belong to one conversation.                                                                        |
| User identity  | The authenticated person or application acting on a resource. It determines access; a display name or conversation ID does not authenticate a caller.                      |
| Child workflow | The project executed by a project node or project-execution tool. Review its input contract, selected version, permissions, and run details.                               |

## Separate users’ conversation memory

1. Assign a consistent identifier to requests that belong to the same conversation.
2. Use a different scope for unrelated users or conversations.
3. Inspect child workflows and loops for their own memory behavior.

Requests reuse the intended history without treating a conversation key as an account credential.

## Behavior and limitations

Memory belongs to the configured project, node, and conversation scope. Beta loop mode keeps each item’s conversation separate. Use the supported identity and conversation fields for your interface; omitting a field is not a reliable way to create a private new conversation. Resource access still depends on authentication and permissions.

## 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/memory-isolation-across-users-and-workflows.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.
