Optional usageTop-level usage ledger shorthand for backward compatibility.
When present, forwarded to observability.usageLedger internally.
Optional chainChain-of-thought reasoning instruction.
false — disable CoT injection.true (default for agents) — inject the default CoT instruction when tools are present.string — inject a custom CoT instruction when tools are present.Optional fallbackOrdered list of fallback providers to try when the primary provider fails with a retryable error (HTTP 402/429/5xx, network errors).
Applied to every generate(), stream(), and session.send() /
session.stream() call made through this agent.
Optional onCallback invoked when a fallback provider is about to be tried.
The error that triggered the fallback.
The provider identifier being tried next.
Optional routerModel router for intelligent provider selection per-call.
Optional onPre-generation hook, called before each LLM step.
Optional onPost-generation hook, called after each LLM step.
Optional onPre-tool-execution hook.
Optional memoryOptional memory provider. When provided:
session.send()/stream() calls memory.getContext() before each turn
and prepends results to the system prompt.session.send()/stream() calls memory.observe() after each turn
to encode the exchange into long-term memory.Optional skillsOptional skill entries to inject into the system prompt. Skill content is appended to the system prompt as markdown sections.
Optional modelModel identifier. Accepted in two formats:
"provider:model" — e.g. "openai:gpt-4o".provider is also set.Optional providerProvider name (e.g. "openai", "anthropic", "ollama").
Auto-detected from environment API keys when omitted.
Optional instructionsFree-form system instructions prepended to the system prompt.
Optional nameDisplay name for the agent, injected into the system prompt.
Optional apiOverride the provider API key instead of reading from environment variables.
Optional baseOverride the provider base URL (useful for local proxies or Ollama).
Optional personalityHEXACO-inspired personality trait overrides (0–1 scale). Encoded as a human-readable trait string appended to the system prompt.
Optional toolsTools available to the agent on every call.
Accepts:
ExternalToolRegistry (Record, Map, or iterable)ToolDefinitionForLLM[]Optional maxMaximum number of agentic steps (LLM calls) per invocation. Defaults to 5.
Optional memoryMemory configuration.
true — enable in-memory conversation history with default settings.false — disable memory; every call is stateless.MemoryConfig — full control over memory subsystems.Optional ragRetrieval-Augmented Generation configuration.
Optional discoveryRuntime capability discovery configuration.
Optional guardrailsGuardrail policy identifiers or structured config.
string[] — shorthand; applies to both input and output.GuardrailsConfig — full control with separate input/output lists.Optional securitySecurity tier controlling permitted tools and capabilities.
Optional permissionsFine-grained tool and resource permission overrides.
Optional hitlHuman-in-the-loop approval configuration.
Optional emergentEmergent agent synthesis configuration.
Optional voiceVoice interface configuration.
Optional avatarAvatar visual presentation configuration.
Optional channelsChannel adapter configurations keyed by channel name. Values are channel-specific option objects passed through opaquely.
Optional outputOutput schema for structured generation.
Accepts a Zod schema at runtime; typed as unknown here to avoid a
hard dependency on the zod package in the types layer.
Optional provenanceProvenance and audit-trail configuration.
Optional observabilityObservability and telemetry configuration.
Optional onEvent callbacks fired at various lifecycle points during the run.
Optional controlsResource limits (tokens, cost, time) applied to the entire run.
Optional dependsNames of other agents in the agency that must complete before this agent runs.
Used with strategy: 'graph' to build an explicit dependency DAG.
Agents with no dependsOn are roots and run first.
`dependsOn: ['researcher']` — this agent waits for `researcher` to finish.
Optional cognitiveCognitive mechanisms config — 8 neuroscience-backed memory mechanisms. All HEXACO-modulated (emotionality, conscientiousness, openness, etc.).
{} for sensible defaults (all 8 mechanisms enabled).Requires memory to be enabled (true or a MemoryConfig object).
If cognitiveMechanisms is set but memory is disabled, a warning is logged
and the mechanisms config is ignored.
Configuration options for the agent factory function.
Extends
BaseAgentConfigwith backward-compatible convenience fields. AllBaseAgentConfigfields (rag, discovery, permissions, emergent, voice, etc.) are accepted and stored in config but are not actively wired in the lightweight agent — they will be consumed byagency()and the full runtime.