smolagents introduces a structurally different approach to agent action: instead of having the model emit JSON tool-call objects that are then translated into actions, smolagents’ CodeAgent writes actual Python code snippets as its reasoning steps. The code is executed in a sandbox, and the output feeds back into the next reasoning step. This code-as-action design uses 30% fewer steps than dictionary-based tool calling while achieving higher benchmark performance on coding and data tasks.
Key capabilities
Code-as-action architecture — Agents reason and act by writing Python code, not JSON. Each action is an executable snippet that runs in a local interpreter or sandboxed environment. This approach produces more interpretable agent behaviour — you can read what the agent is doing — and allows arbitrary Python expressions as single-step actions.
Minimal core — The entire agent logic is approximately 1,000 lines of code, making smolagents easy to audit, customise, and extend. The small surface area reduces the cognitive overhead of building on top of the framework.
MCP tool integration — Built-in support for the Model Context Protocol allows agents to use any MCP server as a tool provider, connecting to file systems, APIs, databases, or custom tools through a standard interface.
Multi-agent orchestration — Manager agents can delegate subtasks to worker agents, supporting hierarchical multi-agent workflows. Workers can be locally instantiated or called as API endpoints.
Autonomy level
Level 3 — Supervised agent. Agents execute task loops autonomously under defined parameters, with sandboxed code execution providing a safety layer. Human oversight is typically configured at the task definition level.
Strengths
- 27,800 GitHub stars and v1.26.0 released May 29, 2026 confirm active Hugging Face backing
- Code-as-action is measurably more efficient than JSON tool-calling
- Apache 2.0 licence; minimal core is easy to audit and customise
- MCP support connects to the broader tool ecosystem
- Hugging Face Hub integration allows model selection from thousands of open-weight models
Limitations
- Framework — requires development effort to build task-specific agents
- Not a turnkey coding assistant; requires Python expertise to configure
- Code execution in a sandbox introduces latency vs. direct tool calls
- Smaller community documentation than LangChain or CrewAI for software-specific use cases
- Most examples target general AI tasks; coding-specific crew templates are community-contributed