> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/quick-start.md).

# Long-term memory quick start

Long-term memory works automatically once two conditions are met: memory is enabled for your character on the Convai dashboard, and the SDK is sending a stable user identifier. This guide walks through both conditions and shows you how to confirm they are working.

### Prerequisites

Before starting, verify:

* [ ] A `ConvaiCharacter` is in the scene with its Character ID set in the Inspector
* [ ] Long-term memory is enabled for your character on the [Convai dashboard](https://convai.com)

You do not need to write any code for the default LTM experience. The SDK's `DeviceEndUserIdProvider` generates a stable identifier automatically. See [End-user identity](/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/end-user-identity.md) if you have an authentication system and need to supply your own user IDs.

***

### Enable memory for a character

{% stepper %}
{% step %}

#### Enable memory on the dashboard

1. Sign in to [convai.com](https://convai.com) and open the character you want to use.
2. Select the **Memory** tab in the character's settings sidebar.
3. Toggle **Long-Term Memory** to **On**.
4. Save the character.

{% hint style="warning" %}
This setting applies globally to the character. Every application, SDK version, and deployment that connects to this character ID will send and receive memories. Coordinate with your team before enabling on a shared character.
{% endhint %}

<figure><img src="/files/lMbdzXBhmMfypO38r9Of" alt="Long-Term Memory toggle enabled in the Convai dashboard"><figcaption><p>Long-Term Memory toggle enabled in the Convai dashboard.</p></figcaption></figure>
{% endstep %}

{% step %}

#### Start a conversation in Play Mode

Run your scene in the Unity Editor. Start a conversation with the character and share information the character should remember — for example:

> "My name is Jordan and I'm a safety officer on the night shift."

Let the conversation complete naturally, then **stop Play Mode**. The session end triggers Convai to extract and store the facts you shared.
{% endstep %}

{% step %}

#### Re-enter Play Mode and verify recall

Enter Play Mode again and ask the character to reference what it learned:

> "Do you remember who I am?"

The character should acknowledge your name and role without you repeating them.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
If the character references details from the previous session, long-term memory is working correctly.
{% endhint %}

***

### How identity works in the editor

The SDK's default `DeviceEndUserIdProvider` handles identity automatically. In Play Mode, it reads or creates a persistent GUID stored in `PlayerPrefs` under the key `"convai.end_user_id"`. Every Play Mode session on the same machine uses the same GUID, so memories accumulate across sessions exactly as they would for a real user. When you stop Play Mode, Convai processes the conversation and extracts facts as `MemoryRecord` entries. On the next session, those records are injected into the character's context before it generates its first response.

The GUID persists as long as `PlayerPrefs` is not cleared. Clearing `PlayerPrefs` or reinstalling the application generates a new GUID, which the server treats as a new user — no memories carry over. See [End-user identity](/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/end-user-identity.md) for strategies that survive reinstalls.

***

### Identity in player builds

In a player build, `DeviceEndUserIdProvider` first tries `SystemInfo.deviceUniqueIdentifier`. If that value is unavailable or invalid, it falls back to the same `PlayerPrefs` GUID approach used in the editor.

| Context                              | Identity source                             |
| ------------------------------------ | ------------------------------------------- |
| Unity Editor                         | `PlayerPrefs` GUID — stable per project     |
| Player build (device ID available)   | `SystemInfo.deviceUniqueIdentifier`         |
| Player build (device ID unavailable) | `PlayerPrefs` GUID — stable until reinstall |

For applications where users log in with accounts, replace `DeviceEndUserIdProvider` with a custom provider that returns your account IDs. Device-based IDs will not follow a user who switches devices. See [End-user identity](/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/end-user-identity.md) for implementation details.

***

### Next steps

{% content-ref url="/pages/GQgbZSFMOcRCBLwo1vqX" %}
[End-user identity](/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/end-user-identity.md)
{% endcontent-ref %}

{% content-ref url="/pages/lG0GNEfMD5jvoHOjCCax" %}
[Configure memory for a character](/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/configure-memory-for-a-character.md)
{% endcontent-ref %}

{% content-ref url="/pages/vmFTDbOMYC0TTWNIC7Nw" %}
[How long-term memory works](/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/how-long-term-memory-works.md)
{% endcontent-ref %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/plugins-and-integrations/convai-unity-sdk/features/long-term-memory/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
