# `Jido.Composer.Orchestrator.Configure`
[🔗](https://github.com/lostbean/jido_composer/blob/main/lib/jido/composer/orchestrator/configure.ex#L1)

Runtime configuration API for orchestrator agents.

Orchestrators are defined declaratively via the DSL, but at runtime you
often need to override fields before calling `query_sync/3` — dynamic
system prompts, RBAC-filtered tools, per-mode model selection, pre-loaded
conversation history, or test cassette injection.

`configure/2` applies overrides after `new/0` but before `query_sync/3`.
It handles internal rebuilds (nodes → tools → name_atoms → schema_keys)
so callers never touch strategy internals.

## Usage

    agent = MyOrchestrator.new()

    agent = MyOrchestrator.configure(agent,
      system_prompt: dynamic_prompt,
      nodes: filtered_action_modules,
      model: "anthropic:claude-sonnet-4-20250514",
      temperature: 0.7,
      max_tokens: 8192,
      req_options: [plug: {ReqCassette, cassette: "test"}],
      conversation: preloaded_context
    )

    {:ok, _agent, result} = MyOrchestrator.query_sync(agent, user_message, ambient)

## Read-Filter-Write Pattern

Use `get_action_modules/1` and `get_termination_module/1` to inspect the
current configuration, filter it, then write it back:

    # Read what the DSL declared
    modules = MyOrchestrator.get_action_modules(agent)
    term_mod = MyOrchestrator.get_termination_module(agent)

    # Filter by user role
    filtered = Enum.filter(modules, &my_rbac_check/1)

    # Write back — handles node/tool/atom rebuild + termination tool dedup
    agent = MyOrchestrator.configure(agent, nodes: filtered)

## Overridable Keys

| Key              | Type                 | Behaviour                                            |
| ---------------- | -------------------- | ---------------------------------------------------- |
| `:system_prompt`  | `String.t()`         | Replaces the DSL system prompt                       |
| `:nodes`          | `[module()]`         | Rebuilds nodes, tools, name_atoms, schema_keys       |
| `:model`          | `String.t()`         | Replaces the model identifier                        |
| `:temperature`    | `float()`            | Replaces the temperature                             |
| `:max_tokens`     | `integer()`          | Replaces max tokens                                  |
| `:max_iterations` | `integer()`          | Replaces max ReAct loop iterations                   |
| `:req_options`    | `keyword()`          | Replaces HTTP options                                |
| `:conversation`   | `ReqLLM.Context.t()` | Sets or replaces conversation context                |

# `configure`

```elixir
@spec configure(
  Jido.Agent.t(),
  keyword()
) :: Jido.Agent.t()
```

Applies runtime overrides to an orchestrator agent's strategy state.

Accepts a keyword list with any combination of:

  * `:system_prompt` — replaces the system prompt
  * `:nodes` — list of action/agent modules; rebuilds ActionNode/AgentNode
    structs, tools, name_atoms, and schema_keys internally. Handles
    termination tool deduplication automatically.
  * `:model` — replaces the model identifier
  * `:temperature` — replaces the temperature
  * `:max_tokens` — replaces max tokens
  * `:max_iterations` — replaces max ReAct loop iterations
  * `:req_options` — replaces HTTP options (e.g. for cassette injection)
  * `:conversation` — sets or replaces conversation context

Returns the updated agent.

# `get_action_modules`

```elixir
@spec get_action_modules(Jido.Agent.t()) :: [module()]
```

Returns the list of action/agent modules currently configured as nodes.

# `get_termination_module`

```elixir
@spec get_termination_module(Jido.Agent.t()) :: module() | nil
```

Returns the termination tool module, or `nil` if none is configured.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
