For the complete documentation index, see llms.txt. This page is also available as Markdown.

Long-term memory quick start

Set up long-term memory for an Unreal character, assign a stable player identity, and confirm recall across Play In Editor sessions.

Set up long-term memory for a working Convai character, then confirm that the character recalls the same player in a later Play In Editor session.

Prerequisites

  • The Convai Unreal Engine plugin version 4.0.0-beta.21 is installed and the API key is configured. See Install the Convai Unreal Engine plugin.

  • A level contains a UConvaiChatbotComponent on the AI character and a UConvaiPlayerComponent on the player Actor.

  • The chatbot component has a valid CharacterID from the Convai dashboard.

This tutorial uses the Speaker ID workflow. For account ID or device fallback strategies, see End-user identity. Memory is disabled by default for new characters in the Convai dashboard — enable it before testing recall.

Enable memory and connect with identity

1

Enable LTM for the character

In a development Blueprint, add Convai Set LTM Status from the Convai|LTM category.

Set Character ID to the character ID from the Convai dashboard. Set B Enable to true. Connect On Success to a Print String node so you can confirm the request completed.

For ongoing verification, use Convai Get LTM Status with the same Character ID.

2

Get a stable EndUserID

Call Convai Create Speaker ID the first time a player uses your project. On On Success, save the returned SpeakerID from FConvaiSpeakerInfo in a SaveGame or account profile.

On later launches, load the saved SpeakerID instead of creating a new record. For the full create, list, and delete workflow, see Speaker ID management.

3

Assign identity and start the session

Before calling StartSession, assign the saved SpeakerID as EndUserID on both components:

  • Set EndUserID on the Convai Chatbot component in the Details panel or from Blueprint.

  • Set EndUserID on the Convai Player component in the Details panel or from Blueprint.

The chatbot EndUserID is the value sent to Convai at connect time. Call StartSession on the chatbot component after both values are set.

Verify cross-session recall

  1. Press Play.

  2. Tell the character a persistent fact, such as My name is Alex, and I inspect safety valves.

  3. Let the conversation continue long enough for the character to respond.

  4. Stop Play In Editor.

  5. Press Play again.

  6. Restore the same EndUserID on the chatbot and player components before StartSession.

  7. Ask Do you remember what I inspect?

The character should respond using the earlier fact. If it starts fresh, see Troubleshoot long-term memory.

Next steps

How long-term memory worksEnd-user identityConfigure memory for a character

Last updated

Was this helpful?