Skip to content

AgentConfig

Defined in: packages/engine/src/lib/agent-session/agent-config.ts:65

The agent slot of the Engine config. When present, utterances run as Agent Runs that call the configured tools. Read once when the Engine is created.

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

readonly optional budgets?: Partial<AgentRunBudgets> | AgentBudgetResolver

Defined in: packages/engine/src/lib/agent-session/agent-config.ts:93

Caps for each run, as static values or a resolver called once per run. Fields left out default to 12 turns, 120,000 ms, 100,000 tokens and 24 tool calls. Every value must be a non-negative integer. maxTokens and maxElapsedMs also accept Infinity, which removes that cap. maxTurns and maxToolCalls must stay finite, so every run keeps a hard bound on its loop. Any other field is rejected, so a misspelled cap fails instead of falling back to its default. Static values are validated when the Engine is created.


readonly optional instructions?: string

Defined in: packages/engine/src/lib/agent-session/agent-config.ts:77

System instructions sent with every model turn. Defaults to an empty string. The Engine appends a capability index of the utterance Chart’s Vessels when the Chart has any.


readonly model: AnyTextAdapter | AgentModelFactory

Defined in: packages/engine/src/lib/agent-session/agent-config.ts:71

The text adapter serving every run, or a factory that picks one per run. A value of type function is treated as a factory. Any other value must be an object with a chatStream method, or Engine creation throws.


readonly optional retry?: object

Defined in: packages/engine/src/lib/agent-session/agent-config.ts:95

Rate-limit retry for each model call. Defaults to no retry.

maxRetries: number

Extra model calls after the first, for each model call of the run. 0 means no retry. The provider SDK does its own retries first, from the maxRetries of the adapter config.

optional maxWaitMs?: number

Longest wait time to accept, in milliseconds. Default 60 000.


readonly optional tools?: readonly RegistrableServerTool[]

Defined in: packages/engine/src/lib/agent-session/agent-config.ts:82

The Server Tools the model may call. Defaults to none. Every tool must define summarize, and names must be unique, or Engine creation throws.