> 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

Find guides for sending live scene state to Convai characters through the dynamic context relay, scripting API, and synced world-object properties.

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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/how-dynamic-context-works.md">How dynamic context works</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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/dynamic-context-quick-start.md">Dynamic context quick start</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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/relay-component-reference.md">Relay component reference</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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/static-context-at-connection-time.md">Static context at connection time</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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/sync-behavior-and-timing.md">Sync behavior and timing</a></td></tr><tr><td><strong>Dynamic context scripting API</strong><br>Full API reference for <code>ConvaiCharacter.DynamicContext</code>, including every method and the <code>ConvaiRespondMode</code> enum.</td><td><a href="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/dynamic-context-scripting-api.md">Dynamic context scripting API</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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/dynamic-context-usage-examples.md">Dynamic context usage examples</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="/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context/troubleshoot-dynamic-context.md">Troubleshoot dynamic context</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/plugins-and-integrations/convai-unity-sdk/features/dynamic-context.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
