# EngineConfig
Source: https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/engineconfig/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

Defined in: [packages/engine/src/lib/config.ts:16](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L16)

Dependencies and optional policies used to construct an Engine.

## Properties

### agent?

> `readonly` `optional` **agent?**: [`AgentConfig`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentconfig/)

Defined in: [packages/engine/src/lib/config.ts:70](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L70)

Optional Agent Run configuration: the model or a per-run model factory, instructions, Server Tools, budgets and model-call retry. When omitted, connections keep the `ui_only` route. A static model, static budgets and tools are validated when the Engine is created, and invalid values throw. See [AgentConfig](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/agentconfig/).

The agent loop is experimental in 0.3 and may change in any minor release.

> [!WARNING]
> Experimental
> 
> This API should not be used in production and may be trimmed from a public release.

* * *

### history?

> `readonly` `optional` **history?**: [`HistoryConfig`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/historyconfig/)<`unknown`\>

Defined in: [packages/engine/src/lib/config.ts:43](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L43)

Optional history configuration. When omitted, chart\_request turns still process normally but nothing is recorded, and assistant\_message messages produce a validationError (‘history not configured’) since they have nowhere to be injected.

* * *

### instrument?

> `readonly` `optional` **instrument?**: [`Instrument`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/instrument/)

Defined in: [packages/engine/src/lib/config.ts:50](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L50)

Optional telemetry seam (defaults to `noopInstrument`). Stages receive it as `StageContext.instrument`; `pipeline` wraps every stage with `instrument.stage` per request, and stages report model calls and other events through `instrument.event`.

* * *

### logger?

> `readonly` `optional` **logger?**: [`Logger`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/logger/)

Defined in: [packages/engine/src/lib/config.ts:36](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L36)

Optional logger (defaults to consoleLogger). Stages receive it as `StageContext.logger`.

* * *

### planner

> `readonly` **planner**: [`ClarifyingPlanner`](https://docs.maelstrom-ai.co/dev/reference/engine/type-aliases/clarifyingplanner/)

Defined in: [packages/engine/src/lib/config.ts:27](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L27)

Produces the candidate response for every `chart_request`. Use a planner implementation as is, or compose stages with `pipeline` and `withFallback`. The Engine heals and validates whatever the planner returns against the request the client sent. Validation accepts a needs-clarification result only for a request that set `skipReply: true`. `Engine.handle` then ships a replyless response with `userMessage` absent. It still refuses a needs-clarification result with `Err(ValidationError)` on field `skipReply`.

* * *

### retry?

> `readonly` `optional` **retry?**: `false` | [`WithRetryOptions`](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/withretryoptions/)

Defined in: [packages/engine/src/lib/config.ts:60](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L60)

Retry policy the Engine wraps around [EngineConfig.planner](https://docs.maelstrom-ai.co/dev/reference/engine/interfaces/engineconfig/#planner) with `withRetry`. `{ max }` re-runs the planner up to `max` times while validation recommends a retry (`max` is a non-negative integer). `false` (or `{ max: 0 }`) runs the planner once; the Engine still heals and validates the candidate. Use `false` for planners that retry their own steps. Default `{ max: 1 }`. See the README’s Retry section for the full policy.

* * *

### validatePlan?

> `readonly` `optional` **validatePlan?**: [`PlanValidator`](https://docs.maelstrom-ai.co/dev/reference/engine/type-aliases/planvalidator/)

Defined in: [packages/engine/src/lib/config.ts:34](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/engine/src/lib/config.ts#L34)

Optional synchronous check of application requirements on the healed response. Issues use the configured retry budget. Unresolved issues return a ValidationError on `validatePlan`, including when retries are disabled. Without this hook, the existing healing and retry policy is unchanged.
