Source: smolagents API reference: Agents (v1.26.0)
Constructor parameters and defaults for MultiStepAgent, CodeAgent and ToolCallingAgent, run() options, AgentMemory, prompt templates and save/push_to_hub.
Contents
- What: official API reference
- Author: Hugging Face
- Date: read 2026-11-14 (v1.26.0)
- Original: https://huggingface.co/docs/smolagents/reference/agents
Summary
Reference for the agent classes. It labels smolagents an experimental API subject to change.
Key claims
MultiStepAgent:max_stepsdefault 20,planning_interval,instructions,managed_agents,step_callbacks,final_answer_checks,name/description(for managed agents),provide_run_summary,return_full_result(default False),add_base_tools(default False).CodeAgent:additional_authorized_imports,executor_typeinlocal(default),blaxel,e2b,modal,docker;executor_kwargs;max_print_outputs_length;stream_outputs;use_structured_outputs_internally(structured generation per step, default False);code_block_tags.ToolCallingAgent: uses the model’s native tool calling;max_tool_threadsfor parallel tool calls.run(task, stream, reset, images, additional_args, max_steps, return_full_result);additional_argsinjects Python objects (e.g. dataframes) into the run.AgentMemoryholds the system prompt andTaskStep/ActionStep/PlanningSteplist;return_full_code()concatenates all code actions;replay()pretty-prints.PromptTemplatescustomise system, planning, managed-agent and final-answer prompts.save()writes tools, managed agents,agent.json,prompt.yaml,app.pyand requirements;from_hubrequirestrust_remote_code=Truebecause it downloads and runs code.