Open Agent Loops
API Reference

RunAgentOptions

@open-agent-loops/core


Defined in: primitives/loop.ts:200

Inputs for a single runAgent run.

Properties

PropertyTypeDescriptionDefined in
hooks?HooksLifecycle hooks for guardrails and context shaping.primitives/loop.ts:218
maxSteps?numberHard safety cap on model turns. Default 10.primitives/loop.ts:214
memoryMemoryThe history store the run loads from and appends to.primitives/loop.ts:204
modelModelClientThe LLM boundary the loop streams turns from.primitives/loop.ts:202
onEvent?EventSinkSink for observability/streaming events emitted during the run.primitives/loop.ts:222
prompt| string | Message | Message[]New input for this run: a string, a single message, or several.primitives/loop.ts:208
sessionIdstringSession key used to load/append this conversation's history.primitives/loop.ts:206
signal?AbortSignalCancel the run. Remarks Aborting rejects runAgent with the signal's reason (an AbortError), checked before each turn and right after each model stream. The signal is also forwarded to the model request and every tool's execute context, so a cooperating client/tool can abort in-flight work; the loop's own checks guarantee it stops even if they don't.primitives/loop.ts:233
stopWhen?StopConditionOptional early-stop predicate, evaluated after each turn's tools run.primitives/loop.ts:216
system?stringOptional system prompt prepended to the request.primitives/loop.ts:210
toolExecution?ExecutionModeForce sequential tool execution regardless of per-tool mode.primitives/loop.ts:220
tools?Tool<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>>[]Tools the model may call this run.primitives/loop.ts:212

On this page