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

Configure memory for a character

Explains how to turn long-term memory on or off for a character from the dashboard or from script, and what its global scope means for shared characters.

Long-term memory is disabled by default (MemorySettings.IsEnabled = false). No facts are extracted or stored until you explicitly enable it. You can enable or disable memory through the Convai dashboard or programmatically via client.Characters.


Enable or disable memory

This is the recommended approach for most teams. Changes take effect immediately without requiring a code update or redeployment.

  1. Sign in at convai.com.

  2. Open the character you want to configure.

  3. Select the Memory tab in the character's settings sidebar.

  4. Toggle Long-Term Memory to On.

  5. Click Save.

To disable, repeat the same steps and toggle Long-Term Memory to Off.

Use client.Characters when you need programmatic control — for example, in automated test setups, build pipelines, or runtime admin panels. ConvaiRestClient.Characters is marked [Obsolete] in favor of ConvaiCharacterApiClient, so this code compiles with a CS0618 warning; it remains the only typed accessor for reading and writing this setting today.

Check current state

using Convai.RestAPI;
using UnityEngine;

public class MemoryAdmin : MonoBehaviour
{
    private async void Start()
    {
        using var client = new ConvaiRestClient(ConvaiSettings.Instance.ApiKey);

        bool isEnabled = await client.Characters.GetMemoryEnabledAsync("your-character-id");
        Debug.Log($"LTM enabled: {isEnabled}");
    }
}

Enable memory

using Convai.RestAPI;
using UnityEngine;

public class MemoryAdmin : MonoBehaviour
{
    private async void Start()
    {
        using var client = new ConvaiRestClient(ConvaiSettings.Instance.ApiKey);

        await client.Characters.SetMemoryEnabledAsync("your-character-id", true);
        Debug.Log("Long-term memory enabled.");
    }
}

Disable memory


Disable memory without deleting records

To purge all memories for a user–character pair before disabling, use client.Memory.DeleteAllAsync followed by SetMemoryEnabledAsync. DeleteAllAsync removes memories for one specific user–character pair. To remove all end-user records across all characters instead, use client.EndUsers.DeleteAsync(endUserId). See Manage end-user records.

See Long-term memory usage examples for a complete reset pattern.


Next steps

End-user identityManage end-user records

Last updated

Was this helpful?