> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/agent/context-graphs/dynamic-behaviors.md).

# Dynamic Behaviors

Dynamic behavior sets are a Classic API capability. They adapt how a Classic agent operates for one turn without changing its underlying Context Graph. When a caller's message semantically matches a configured trigger, the Classic runtime can inject an instruction, change the available tool candidates, or do both.

{% hint style="warning" %}
The Platform API does not expose or execute dynamic behavior sets. On Platform services, author conditional behavior in Context Graph states, transitions, entry guidance, exit conditions, turn policies, and eligible tools. Do not migrate a Classic behavior set by assuming a like-for-like Platform resource exists.
{% endhint %}

{% hint style="info" %}
**Classic API name:** `dynamic_behavior_set`. See [Dynamic Behaviors](https://docs.amigo.ai/developer-guide/classic-api/core-api/dynamic-behaviors) in the developer guide for the current Classic contract.
{% endhint %}

## Classic Behavior Model

A Classic Context Graph defines the workflow structure. A dynamic behavior set adds reusable turn-level adaptation outside that graph. This can be useful when one semantic condition should affect several states without duplicating the same instruction or tool change in each state.

This separation is specific to the Classic runtime. Platform safety and scope boundaries belong in the authored agent and Context Graph rather than in a separate dynamic-behavior layer.

## Anatomy of a Behavior

Each Classic dynamic behavior defines:

* **Triggers** - Natural-language descriptions of the conversation patterns that activate the behavior. At each turn, the platform matches the caller's message against these triggers by semantic similarity, so a trigger describes an intent ("the caller mentions chest pain") rather than an exact phrase.
* **Actions** - What the behavior does when it fires. At least one action is required, and two types are supported:
  * **Instruction injection** - Adds an instruction to the agent's guidelines for the turn. The behavior can either append to the state's existing guidelines or override them entirely.
  * **Tool candidate changes** - Changes the tools available to the agent for the turn. The behavior can either add tools to the current state's set or replace that set.

Behaviors are grouped into named, versioned sets. A Classic service version set can reference the desired behavior-set versions alongside its other Classic configuration.

## Classic Version Sets

Classic dynamic behavior sets are applied to services through version sets. A conversation created against a given Classic version set evaluates the behavior sets bound to it. Test the exact version-set combination before updating a release alias.

See [Version Sets and Promotion](https://docs.amigo.ai/developer-guide/operations/devops/version-sets-best-practices) for the broader release workflow.

## Relationship to Context Graphs

In Classic, a matching behavior changes the current turn without changing graph topology. The state and transition structure stays intact while the behavior adjusts guidance or tool candidates.

In Platform, place the equivalent logic explicitly in the Context Graph or agent configuration. Safety-sensitive rules should be visible in the authored state and transition model so they can be reviewed and simulated directly.

## Migrating to Platform

When moving a Classic service to Platform:

* Move safety and scope rules into explicit states, entry guidance, exit conditions, and escalation instructions.
* Move reusable factual guidance into the agent's authored instructions or supported knowledge sources.
* Add conditional tool availability to the relevant state's tool specifications.
* Rebuild simulations around the resulting Platform graph instead of expecting Classic behavior-set versions to migrate.

## Related Pages

{% content-ref url="/pages/b9dT9LVnevpo6xLqrEfo" %}
[Context Graphs](/agent/context-graphs.md)
{% endcontent-ref %}

For Platform per-state configuration, see [Context Graphs](/agent/context-graphs.md) and [Reasoning Engine](/agent/reasoning-engine.md#per-state-configuration-turnpolicy).


---

# 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.amigo.ai/agent/context-graphs/dynamic-behaviors.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.
