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

Dynamic context quick start

Push a state property and a context event to a connected Convai character in Blueprint and verify the update reaches the context pipeline.

Push one state and one event to a Convai character from Blueprint, then confirm the update is stored locally before you test it in conversation.

Dynamic context walkthrough
Term
Meaning
Example

State

A current fact that can be replaced

Health is 50

Event

A one-time moment in the session

Alarm triggered in sector 4

Prerequisites

Before starting, verify:

Push a state update

Track the player's health so the character can reference it when asked.

1

Open the character Blueprint

Open the Blueprint for the Actor that owns the Convai Chatbot component — for example, BP_ConvaiCharacter. Navigate to the Event Graph.

2

Add a test entry point

Right-click the graph and add a Custom Event node. Name it TestHealthUpdate. You can call this event from the Level Blueprint, a trigger volume, or another Actor to fire the update during Play In Editor.

3

Get the Convai Chatbot component

Drag the Convai Chatbot component from the Components panel into the graph to create a Get reference node.

4

Call Set Context State

Drag from the Convai Chatbot reference pin and search for Set Context State. Connect it to the TestHealthUpdate event execution pin.

Set the node pins as follows:

Pin
Value

Name

Health

Value

50

Should Respond

Never

Leave bFlushImmediately at its default (false).

Should Respond = Never stores the value without requesting a spoken response on every health change.

5

Confirm the local tracker accepted the value

Drag from the output execution pin of Set Context State and add Get Context State Value. Set Name to Health, then print OutValue and the boolean return value with Print String.

Compile the character Blueprint. At runtime, the return value should be true and OutValue should read 50. This confirms the local tracker accepted the update before any network flush.

Push an event update

Notify the character that an alarm has been triggered. Events record one-time moments; they are not replaced like state values.

1

Chain Add Context Event

Drag from the output execution pin of the Set Context State node. Search for Add Context Event and connect it.

2

Configure the event

Set the Text pin to Alarm triggered in sector 4. Set Should Respond to Auto.

Trigger the update from gameplay

Call TestHealthUpdate from any Blueprint graph that already has access to the character Actor.

1

Get a reference to the character Actor

Use your project's usual Blueprint pattern to reference the Actor that owns the Convai Chatbot component — for example, a placed BP_ConvaiCharacter reference or a variable set by your spawn logic.

2

Call TestHealthUpdate during setup

Call TestHealthUpdate after the character Actor reference is valid. For a basic test, call it from the same startup flow that prepares your level.

3

Compile the Blueprint

Compile the Blueprint that calls TestHealthUpdate.

Test in Play In Editor

1

Enter Play In Editor and wait for connection

Run the level in Play In Editor. Wait for the character session to connect — when bAutoInitializeSession is enabled, the session starts automatically.

Your gameplay graph fires TestHealthUpdate, staging the state update and the context event.

2

Check local values and allow the debounce window

Check the debug output from Get Context State Value. The return value should be true and OutValue should read 50.

By default, the plugin waits 0.5 s (ContextDebounceWindow) after the last staged update before sending to Convai. Allow at least one debounce cycle before the conversation test that depends on this context.

3

Verify in conversation

Speak to the character or use text input. Ask How is my health? or What is happening in the facility? as an end-to-end runtime test after the debounce window has elapsed. Exact response wording depends on the character configuration.

If the character does not reference either value, see Troubleshoot dynamic context.

Next steps

Read How dynamic context works for the mental model, then Dynamic context usage examples for more Blueprint patterns.

How dynamic context worksDynamic context usage examplesDynamic context Blueprint reference

Last updated

Was this helpful?