actorTurnCallback? | AxAgentActorTurnCallback | Called after each actor turn is recorded with both the raw runtime result and the formatted action-log output. |
agentStatusCallback()? | (message: string, status: "success" | "failed") => void | Promise<void> | Called when the executor signals task progress via reportSuccess(message) or reportFailure(message). |
bubbleErrors? | ReadonlyArray<(…args: any[]) => Error> | Error classes that should bubble up instead of being caught and returned to the LLM. |
contextFields? | readonly AxContextFieldInput[] | Input fields used as context. - string: runtime-only (legacy behavior) - { field, promptMaxChars }: runtime + conditionally inlined into the distiller prompt - { field, keepInPromptChars, reverseTruncate? }: runtime + truncated string excerpt in the distiller prompt |
contextMap? | AxAgentContextMapConfig | Optional persistent context map for recurring long-context work. When configured, Ax injects the map into the distiller prompt and updates it once after each successful completed run. Use onUpdate to persist the updated snapshot. |
contextOptions? | AxStageOptions | Forward options for the context distiller stage. Configures the REPL/turn loop and forward-to-LLM options for the context-understanding stage that runs before the executor. Set ai to override the AI service for this stage only — falls back to forward(ai, ...) when not set. |
contextPolicy? | AxContextPolicyConfig | Context replay, checkpointing, and runtime-state policy. |
debug? | boolean | - |
executorModelPolicy? | AxExecutorModelPolicy | Ordered executor-model overrides keyed by consecutive error turns or namespace matches. Later entries take precedence over earlier ones. |
executorOptions? | AxStageOptions | Forward options for the task executor stage. Set ai to override the AI service for this stage only — falls back to forward(ai, ...) when not set. |
functionDiscovery? | boolean | Enables runtime callable discovery (modules + on-demand definitions). |
functions? | AxAgentFunctionCollection | Tools registered under their configured namespace globals. May contain AxFunction / AxAgentFunction entries, grouped function modules, or AxAgentic instances — agents are auto-converted via .getFunction() and land under their agentIdentity.namespace (or utils if unset), exactly like a plain function. Pass an AxAgent here to use it as a child tool. |
inputUpdateCallback? | AxAgentInputUpdateCallback<IN> | Called before each executor turn with current input values. Return a partial patch to update in-flight inputs for subsequent executor/responder steps. |
judgeOptions? | AxAgentJudgeOptions | Default options for the built-in judge used by optimize(). |
maxBatchedLlmQueryConcurrency? | number | Maximum parallel llmQuery calls in batched mode (default: 8). |
maxEvidenceChars? | number | Maximum serialized characters for a final(task, evidence) evidence object crossing the host boundary (default: 50000). Oversized evidence throws inside the actor turn so the model narrows and retries. |
maxRuntimeChars? | number | Maximum characters to keep from runtime output and console/log replay. |
maxSubAgentCalls? | number | Global cap on recursive sub-agent calls across all descendants (default: 100). |
maxTurns? | number | Maximum Actor turns before forcing Responder (default: 10). |
memoriesCatalog? | readonly AxAgentMemoryResult[] | Static memory catalog. When set and no onMemoriesSearch callback is provided, ax backs recall(...) with a built-in deterministic local search over the catalog — memories work batteries-included with zero host search code. A host onMemoriesSearch always takes precedence for search; the catalog still powers the advisory relevance hint (with relevanceRanking). Catalog content is NOT preloaded into the prompt — entries load only when recalled. To preload specific memories for a run, pass them as the memories input value at forward time: forward(ai, { ..., memories: [{ id, content }] }). |
onContextEvent? | AxAgentOnContextEvent | Called when AxAgent measures context pressure or creates/clears compacted context. Use for observability and evaluation; failures are ignored. |
onFunctionCall? | AxAgentOnFunctionCall | Fired whenever any function registered on the agent is invoked from the runtime. kind is 'external' for user-registered functions, 'internal' for agent-injected ones (child agents, skills/memories loaders, discovery globals). |
onLoadedMemories()? | (results: readonly AxAgentMemoryResult[]) => void | Promise<void> | Optional callback fired whenever recall(...) loads memories. Receives the matched { id, content }[] from onMemoriesSearch. Use this for load telemetry, cache warming, or feedback loops on retrieval relevance — it does not mean the actor used every memory in its final reasoning. |
onLoadedSkills()? | (results: readonly AxAgentSkillResult[]) => void | Promise<void> | Optional callback fired whenever discover({ skills }) loads skills. Receives the matched { id?, name, content }[] from onSkillsSearch. Use this for analytics, telemetry, or feedback loops on skill relevance — it does not affect runtime behaviour. |
onMemoriesSearch? | AxAgentMemoriesSearchFn | Optional memories search callback. When set, the distiller and executor stages gain a recall(searches: string[]): void global, and both stages get a memories input field. The callback receives the raw search strings plus a snapshot of inputs.memories already loaded for the current run (alreadyLoaded), and returns matched memories ({ id, content }); the runtime appends matched entries to inputs.memories (deduped by id, sorted) so the next turn’s prompt includes them. Use alreadyLoaded to skip work for entries the actor already has — e.g. filter your vector search by id NOT IN alreadyLoaded. recall() itself returns nothing — the actor reads inputs.memories next turn to see what landed. Memories loaded by the distiller thread to the executor automatically; the responder does not receive the memories field. Memories live for one .forward() call; persist them externally to carry across calls. |
onSkillsSearch? | AxAgentSkillsSearchFn | Optional skills search callback. When set, the executor runtime gains a discover({ skills }) path. The callback receives the raw search strings and returns matched skills ({ id?, name, content }); each returned skill’s content is rendered into the executor system prompt for subsequent turns (sorted by id to keep the prefix cache stable). discover(...) itself returns nothing — the actor inspects the Loaded Skills section of the next turn’s prompt to see what landed. |
onUsedMemories? | AxAgentUsedMemoriesCallback | Optional callback fired once per agent forward when memory usage tracking is enabled. Receives actor-declared memories that actually influenced the distiller or executor ({ id, reason?, stage }). Unknown ids are dropped. |
onUsedSkills? | AxAgentUsedSkillsCallback | Optional callback fired once per agent forward when skill usage tracking is enabled. Receives actor-declared skills that actually influenced the executor ({ id, name, reason?, stage }). Unknown ids are dropped. |
promptLevel? | "default" | "detailed" | Actor prompt verbosity and scaffolding level (default: ‘default’). |
recursionOptions? | AxAgentRecursionOptions | Default forward options for recursive llmQuery sub-agent calls. Set ai to route recursive sub-agent calls to a different AI service than the one used for the parent agent. Falls back to the parent forward(ai, ...) argument when ai is not set. |
relevanceRanking? | | boolean | { minScore?: number; topK?: number; } | Advisory local relevance ranker — ON by default (set false to opt out). Enabled by default since its A/B gate passed (substance-judged, n=49/variant/model: small model discover-precision 24%->90% and answer substance 14%->29%; frontier-model control substance 63%->88% with fewer turns). TS-first: the 5 non-TS ports do not ship the ranker yet, so cross-language behavior diverges here until they catch up. When enabled, a cheap deterministic token-overlap ranker scores this agent’s discoverable capabilities against the task and injects a non-authoritative “Likely Relevant” hint into the executor turn. Ranked domains light up with their prerequisites: modules require functionDiscovery; skills/memories require their catalogs. The hint lands in a dynamic, non-cached field, so it does not affect the prompt cache; the full lists and the discover()/recall() flows are unchanged and the model may still choose anything. Pass an object to tune topK (default 3) / minScore (default 0.08). |
responderOptions? | AxStageOptions | Forward options for the final responder stage. Set ai to override the AI service for this stage only — falls back to forward(ai, ...) when not set. |
runtime? | AxCodeRuntime | Code runtime for the REPL loop (default: AxJSRuntime). |
skills? | readonly AxAgentSkillResult[] | Skills to preload into the executor prompt at startup, in the same shape returned by onSkillsSearch ({ id?, name, content }). Useful when the caller already knows which skills are relevant and wants to skip the actor’s discover({ skills }) round-trip. Merged with skills passed at forward()-time (forward overrides by id). Does NOT fire onLoadedSkills — that callback is for runtime-loaded skills. |
skillsCatalog? | readonly AxAgentCatalogSkill[] | Static skill catalog. When set and no onSkillsSearch callback is provided, ax backs discover({ skills }) with a built-in deterministic local search over the catalog — skills work batteries-included with zero host search code. A host onSkillsSearch always takes precedence for search; the catalog still powers the advisory relevance hint (with relevanceRanking). Unlike skills, catalog content is NOT preloaded into the prompt — entries load only when matched. |
summarizerOptions? | Omit<AxProgramForwardOptions<string>, "functions"> | Default options for the internal checkpoint summarizer. |