AgentDefinition
AgentDefinition<
ToolProviderContext,Tools,TOutput> =object
Defined in: packages/core/src/agent/types.ts:57
Type Parameters
Section titled “Type Parameters”ToolProviderContext
Section titled “ToolProviderContext”ToolProviderContext = unknown
Tools extends ToolSet = ToolSet
TOutput
Section titled “TOutput”TOutput = string
Properties
Section titled “Properties”id:
string
Defined in: packages/core/src/agent/types.ts:62
memory?
Section titled “memory?”
optionalmemory?:AgentMemoryConfig
Defined in: packages/core/src/agent/types.ts:92
model?
Section titled “model?”
optionalmodel?:LanguageModel
Defined in: packages/core/src/agent/types.ts:65
Required unless AdlRuntimeConfig.defaults.model is set.
outputSchema?
Section titled “outputSchema?”
optionaloutputSchema?:z.ZodType<TOutput>
Defined in: packages/core/src/agent/types.ts:84
Default Zod schema for structured output on every episode.
When set, AgentRunResult.output is inferred from the schema; when omitted,
TOutput is string and output is the episode text.
stopWhen?
Section titled “stopWhen?”
optionalstopWhen?:AgentStopWhen
Defined in: packages/core/src/agent/types.ts:91
AI SDK stopWhen for this agent’s
run / stream. Overridable per call via AgentRunInput.stopWhen.
Defaults to DEFAULT_AGENT_STOP_WHEN (stepCountIs(20)).
Pass stepCountIs(1) when a workflow should own each model step.
systemPrompt
Section titled “systemPrompt”systemPrompt:
AgentSystemPrompt
Defined in: packages/core/src/agent/types.ts:63
titleWorkflow?
Section titled “titleWorkflow?”
optionaltitleWorkflow?:Workflow<ConversationTitleInput,ConversationTitleOutput>
Defined in: packages/core/src/agent/types.ts:103
Optional workflow that names the conversation after the first successful episode
on a new memoryScope. It receives the transcript and must return { title: string }.
Pin those types with adl.createWorkflow<ConversationTitleInput, ConversationTitleOutput>
(Zod input / output are optional). Failures are ignored.
The runtime runs this workflow with { isolated: true } so it is a separate
persisted run and is not nested inside another workflow’s tree. Omit it from
adl.config workflows if it should not appear in the inspection UI.
tools?
Section titled “tools?”
optionaltools?:Tools|ToolProvider<Tools,ToolProviderContext>
Defined in: packages/core/src/agent/types.ts:78
A fixed tool set, or a provider resolved once per call — typed directly against
ExtendedToolProviderContext<ToolProviderContext> since a definition (unlike the
per-call AgentRunInput.tools override) is never widened into a heterogeneous
AnyAgent[] registry, so it’s safe to keep ToolProviderContext
fully generic here. Overridable per call via AgentRunInput.tools.
The framework never parses or validates toolProviderContext — a ToolProvider that
wants Zod validation/defaults calls .parse() itself inside getTools (see
createToolProvider’s doc comment for the recipe). Combine several providers, each with
their own context needs, via combineToolProviders.