> 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-unreal-engine-plugin/features/long-term-memory/end-user-identity.md).

# End-user identity

End-user identity tells Convai which player is speaking to the character. Set a stable `EndUserID` on the chatbot component before `StartSession` so memory from one user does not appear in another user's conversation.

### Key terms

| Term              | Role                                                                                                                         |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `EndUserID`       | The identity string your project sends to Convai at connect time. Set it on `UConvaiChatbotComponent` before `StartSession`. |
| `SpeakerID`       | A Convai-assigned identifier from a Speaker ID record. Save it and reuse it as `EndUserID`.                                  |
| `EndUserMetadata` | Optional JSON context sent alongside `EndUserID`. Set it on the chatbot component.                                           |

For the WebRTC `StartSession` flow, the plugin reads `EndUserID` from `UConvaiChatbotComponent` through `IConvaiConnectionInterface`. Also set the same value on `UConvaiPlayerComponent` so both components stay in sync in your project.

### Choose an identity strategy

| Strategy        | Use when                                                                                          | Notes                                                                                                                                                                                                                       |
| --------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Speaker ID      | Your project needs a Blueprint-managed identity record that can be listed or deleted from Unreal. | Call **Convai Create Speaker ID** once, then save the returned `SpeakerID`. See [Speaker ID management](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/long-term-memory/speaker-id-management.md). |
| Account ID      | Your project already has login or profile IDs.                                                    | Assign your stable account ID directly as `EndUserID`.                                                                                                                                                                      |
| Device fallback | One local device maps to one player.                                                              | Leave chatbot `EndUserID` empty and the plugin derives a device identifier at connect time.                                                                                                                                 |

For shared-device, training, and onboarding projects, use a Speaker ID or your own account ID. Device fallback can merge memory for multiple users on the same machine.

### Assign identity before StartSession

{% stepper %}
{% step %}

#### Set the chatbot identity

On `UConvaiChatbotComponent`, set `EndUserID` to the saved `SpeakerID` or account ID.

If you want to pass player context, set `EndUserMetadata` to a JSON string:

```json
{"name": "Alex", "role": "trainee", "course": "fire-safety"}
```

{% endstep %}

{% step %}

#### Match the player component

On `UConvaiPlayerComponent`, set `EndUserID` to the same value.

If you are sending metadata, set `EndUserMetadata` to the same JSON string on the player component.
{% endstep %}

{% step %}

#### Start the chatbot session

Call `StartSession` on the chatbot component after identity values are set.

The plugin sends `EndUserID` and `EndUserMetadata` at connect time. Convai uses that identity with the character ID to load the correct memory scope.
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
Set identity before `StartSession`. If identity is assigned after the session opens, Convai may not associate the conversation with the intended user record.
{% endhint %}

### Use device fallback only when appropriate

If chatbot `EndUserID` is empty at connect time, the plugin calls `UConvaiUtils::GetDeviceUniqueIdentifier()`. The helper tries `FPlatformMisc::GetDeviceId()`, then `FPlatformMisc::GetOperatingSystemId()`, then `FPlatformMisc::GetLoginId()`.

This works for a single local user. It is not enough for:

* Shared classroom or lab machines.
* Training kiosks used by multiple learners.
* Projects where memory must follow a signed-in user across devices.

### Verify the identity

Before `StartSession`, print these values:

* `UConvaiChatbotComponent.EndUserID`
* `UConvaiPlayerComponent.EndUserID`

Both values should match. The chatbot value is the one sent to Convai at connect time.

### Next steps

{% content-ref url="/pages/xIpC6mQGKNJNnXc3TQWn" %}
[Speaker ID management](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/long-term-memory/speaker-id-management.md)
{% endcontent-ref %}

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

{% content-ref url="/pages/mwNxFe292Uo2iGpZiLAp" %}
[LTM Blueprint reference](/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/long-term-memory/ltm-blueprint-reference.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, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/plugins-and-integrations/convai-unreal-engine-plugin/features/long-term-memory/end-user-identity.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
