Skip to main content

run_agent

Run an autonomous AI agent loop. The agent reasons about the prompt, decides which tools to call, executes them, and continues until it produces a final answer or hits max_steps.

Use this from any regular Python stage (Tasklet, Job, Hook, or Form logic) when the task requires multi-step reasoning, tool use, or autonomous decision-making. For single-shot completions, use prompt instead.

Parameters

NameDescriptionTypeDefault
prompt (required)Instruction(s) for the agent. A single string, a list of strings, or a list mixing strings, files (Path), and images. Files and images are forwarded to the LLM as multimodal input.strNone
toolsTools the agent may call. Each item is either a plain Python function (its name, type hints and docstring become the tool spec) or an AgentTools subclass instance (e.g. BrowserTools, TablesTools, FilesTools, ConnectorsTools). Defaults to None (no tools).OptionalNone
max_stepsMaximum number of reasoning/tool-use iterations before the agent is forced to stop. Defaults to 30.int30

Return Value

Dict[str, Any]