Skip to content

iterationProgressHint

iterationProgressHint(options?): AgentHooks

Defined in: agent/hints.ts:154

Creates a proactive hint that informs the LLM about iteration progress.

This hint is injected before each LLM call (via beforeLLMCall controller), helping the LLM understand how much “budget” remains for completing the task.

IterationHintOptions

Configuration options

AgentHooks

AgentHooks that can be merged with other hooks

// Basic usage - show on every iteration
const hooks = iterationProgressHint();
// Show only when running low on iterations
const hooks = iterationProgressHint({ timing: "late" });
// Custom template
const hooks = iterationProgressHint({
template: "Turn {iteration} of {maxIterations}. {remaining} turns left.",
});