> 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-unity-sdk/features/dynamic-context.md).

# Dynamic context

Dynamic context gives Convai characters real-time awareness of what is happening in a Unity scene. A character can reference a trainee's current station, an item recently picked up, or an alarm that fired, and weave that information into dialogue as it happens. Two entry points write to the same tracked state and produce identical network behavior: the `ConvaiDynamicContextRelay` Inspector component for event-driven bindings, and the `DynamicContext` property on `ConvaiCharacter` for code-driven systems.

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>How dynamic context works</strong><br>Understand the tracked state and event model, batching behavior, and how acknowledgement results reach your code.</td><td><a href="/pages/Oyh83QIsfM02w8hOnerK">/pages/Oyh83QIsfM02w8hOnerK</a></td></tr><tr><td><strong>Dynamic context quick start</strong><br>Add <code>ConvaiDynamicContextRelay</code> to an NPC and verify context-aware dialogue in a few steps.</td><td><a href="/pages/c83fd507c05d6353540d730017d6b1681c7bb60d">/pages/c83fd507c05d6353540d730017d6b1681c7bb60d</a></td></tr><tr><td><strong>Relay component reference</strong><br>Field-by-field reference for <code>ConvaiDynamicContextRelay</code> and the <code>ConvaiRespondMode</code> values it accepts.</td><td><a href="/pages/tCnCpnGAXfuegK7SIPBn">/pages/tCnCpnGAXfuegK7SIPBn</a></td></tr><tr><td><strong>Static context at connection time</strong><br>Configure initial dynamic info sent once at connection for facts that do not change during a session.</td><td><a href="/pages/wuITWZtDYpGKPOC2GUTI">/pages/wuITWZtDYpGKPOC2GUTI</a></td></tr><tr><td><strong>Sync behavior and timing</strong><br>How Replace, Append, and Reset messages batch and flush, including the <code>DynamicContextBatchDelaySeconds</code> window.</td><td><a href="/pages/jLDVtNvrQQtepjrSEeAv">/pages/jLDVtNvrQQtepjrSEeAv</a></td></tr><tr><td><strong>Dynamic context scripting API</strong><br>Full API reference for <code>ConvaiCharacter.DynamicContext</code>, including the <code>ConvaiRespondMode</code> migration from reaction modes.</td><td><a href="/pages/Pwb170m39yjzkfAghzLG">/pages/Pwb170m39yjzkfAghzLG</a></td></tr><tr><td><strong>Dynamic context usage examples</strong><br>End-to-end scenarios covering safety drills, onboarding, guided tours, and synced world-object tracking.</td><td><a href="/pages/3UWNhGolZFLe1BduX0bt">/pages/3UWNhGolZFLe1BduX0bt</a></td></tr><tr><td><strong>Troubleshoot dynamic context</strong><br>Investigation checklist, symptom table, and Console log reference for the relay and tracker flow.</td><td><a href="/pages/7ij66qcsYVpiLPUZFGvh">/pages/7ij66qcsYVpiLPUZFGvh</a></td></tr></tbody></table>

### Synced world-object context

A `ConvaiObjectMetadata` component can expose tracked properties on a scene object. Each tracked property maps to a dynamic context state that every connected character receives automatically, without an explicit `SetState` call in your code. See [Scene metadata](/api-docs/plugins-and-integrations/convai-unity-sdk/features/scene-metadata.md) for how to register objects and configure tracked properties.

### Next steps

Start with [Dynamic context quick start](/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/dynamic-context-quick-start.md) to get context-aware dialogue running. Then read [How dynamic context works](/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/how-dynamic-context-works.md) to understand the tracked state and event model before moving into the reference pages.


---

# 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-unity-sdk/features/dynamic-context.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.
