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

Static context at connection time

Configure fixed scenario facts a character receives once at the start of a conversation, separate from updates sent while the conversation is running.

Every Convai character has two fields — Initial Dynamic Info Text and Initial Dynamic Info Keep In Context — that inject a fixed block of context into the session request at the moment the conversation connects. This context is delivered to Convai once, before the first response, and is separate from runtime Dynamic Context updates.

Use this mechanism for facts that are true before the conversation begins and will not change during the session: the facility name, the character's role, the training scenario type, or the starting conditions of a drill. Use runtime Dynamic Context (ConvaiDynamicContextRelay or IConvaiDynamicContext) for everything that evolves as the session progresses.

Inspector configuration

Both fields are on the ConvaiCharacter component under the Dynamic Info (Connection Request) header.

Unity Inspector showing the Dynamic Info (Connection Request) section on ConvaiCharacter with Initial Dynamic Info Text and Initial Dynamic Info Keep In Context fields
Dynamic Info fields on ConvaiCharacter — Initial Dynamic Info Text is delivered once at session start; enable Keep In Context to retain these facts across all LLM turns for the duration of the session.
Field
Type
Default
Description

Initial Dynamic Info Text

string

(empty)

Free-text block sent as part of the session connection request. No format constraints — write plain sentences or key-value lines.

Initial Dynamic Info Keep In Context

bool

false

When true, Convai retains this text across all LLM turns for the duration of the session. When false, the text informs only the first response.

Example configuration

For a fire suppression certification drill, set Initial Dynamic Info Text to:

Enable Initial Dynamic Info Keep In Context.

The character will reference these facts throughout the conversation. You do not need to re-send them via runtime Dynamic Context — they persist for the life of the session.

Relationship to runtime Dynamic Context

Initial context and runtime Dynamic Context are complementary — not alternatives.

Initial Dynamic Info
Runtime Dynamic Context

When sent

Once, at ConnectAsync

During the session, on demand

Content

Fixed facts set at design time

Live state and events set at runtime

Suitable for

Facility name, scenario type, character role

Trainee location, equipment state, hazard level

Modifiable at runtime

No — sent once per connection

Yes — via SetState, AddEvent, Reset

Both mechanisms feed into the character's awareness simultaneously. Initial context provides a stable foundation; runtime Dynamic Context layers live updates on top.

What Reset() does and does not clear

Calling Reset() on the runtime Dynamic Context layer clears all tracked states and events. By default it leaves initial dynamic info in place:

  • Initial Dynamic Info Text was sent at connection time and is untouched by Reset() unless the caller opts in: Reset(removeStatic: true) also asks Convai to remove the static initial dynamic context for the current session. The default Reset() (equivalent to Reset(removeStatic: false)) does not touch it, and there is no way to re-send or replace it mid-session — only clear it.

  • System prompt facts on the Convai dashboard are not part of the Dynamic Context layer. No SDK call affects them at runtime.

  • In-session LLM memory — the character retains conversational context across turns within the same session. Reset() clears the Dynamic Context tracker and sends a Reset message to Convai, but it does not clear the model's in-session conversational memory.

To change the initial context for a new session, end the current conversation, update the Initial Dynamic Info Text field, and reconnect. Initial context is sent once per ConnectAsync call.

Scripting access

Both fields are readable via C# properties on ConvaiCharacter:

These properties are read-only at runtime. Set the values in the Inspector before the scene is played, or via SerializedObject in a custom Editor tool.

Next steps

Relay component referenceDynamic context scripting APISync behavior and timing

Last updated

Was this helpful?