# smolagents

Builds lightweight Python agents that execute actions as code or use structured tool calls.

Canonical profile: https://ki-agentenkompass.de/en/agents/smolagents/
Editor: [Michael Meierhoff](https://ki-agentenkompass.de/en/about/)
Sources reviewed: 2026-11-16
Basis: provider documentation. Examples are editorial suggestions, not hands-on product tests.

## Overview

Independent agent framework with its own execution loop.

- Provider: Hugging Face
- Product family: smolagents
- Profile type: Programmable agent framework
- Environment: Custom application using Python.
- Connections: Custom functions, provider adapters and documented MCP/API connections.
- Setup: Install the SDK, configure model access and tools, and set up persistence and operations.
- Pricing model: SDK source code without a stated usage fee; model, hosting, storage and optional cloud costs are separate.

## Key features

### CodeAgent and ToolCallingAgent

CodeAgent uses Python actions; ToolCallingAgent uses structured calls.

Source: https://github.com/huggingface/smolagents

### Sandbox execution

Generated code can run in documented sandbox backends.

Source: https://github.com/huggingface/smolagents

### Hub and MCP tools

Tools from MCP, LangChain or Hub Spaces can be connected.

Source: https://github.com/huggingface/smolagents

### Connect models flexibly

Inference Providers, API adapters and local models through Transformers or Ollama are documented.

Source: https://github.com/huggingface/smolagents

### Inspect agent steps

AgentMemory and replay expose planning, tool actions, observations and errors from a run.

Source: https://github.com/huggingface/smolagents

## Example workflows

### Embed a knowledge agent in a custom app

- Your input: Documents, defined read tools and model access.
- Possible result: A custom application answers questions through a configured agent loop.
- What to check: Test sources, user isolation and tool interfaces.

### Build a business process with approval

- Your input: Process steps, APIs and a mandatory approval policy.
- Possible result: An agent performs preparatory steps; the custom application controls approval.
- What to check: Verify failure paths, resumption and permissions using realistic cases.

## Requirements and limits

### Setup and access

Requirement: Install the SDK, configure model access and tools, and set up persistence and operations.

Source: https://github.com/huggingface/smolagents

### Requirements and limits

Limitation: Development, permissions and operations are the responsibility of the custom application. Documented components must be combined and verified for the use case.

Source: https://huggingface.co/docs/smolagents/index

### Constrain code execution

Limitation: CodeAgent generates and executes Python. Configure sandboxing, allowed imports and accessible tools for the specific deployment.

Source: https://github.com/huggingface/smolagents

## A good fit if …

- you want to integrate agents into a custom application and operate them yourself
- you can deliberately review results and permissions
- you want to explore Python code agents and their individual execution steps

## Less suitable if …

- you seek a fully managed service without development effort
- you want to execute generated code without configuring sandboxing and tools yourself

Editorial assessment based on provider documentation. Not a product test.

## Usable AI models

Open choice

Hugging Face Inference Providers, OpenAI/Anthropic APIs and LiteLLM; local models through Transformers or Ollama.

- Model families named: OpenAI (GPT), Anthropic (Claude) · Other models can be connected freely
- Model choice: You choose
- Your own API key: Yes
- Router or custom endpoint: Yes
- Local models: Yes

Partly documented · Sources accessed on: 2026-11-16

- [smolagents · Product](https://huggingface.co/docs/smolagents/index)

- [smolagents · Repository](https://github.com/huggingface/smolagents)

## Europe & regional availability

Access and data processing must be assessed separately.

Reviewed scope: smolagents · Access and processing
Reviewed on: 2026-11-16

### Access and regional conditions

With requirements

The source code or documented download is publicly available. Model providers, external connections and hosting have their own regional and privacy conditions. Uniform EU data residency is unspecified within the checked scope.

Region covered: EU/EEA, United Kingdom and Switzerland

Documented reason: The configured deployment and terms of connected services determine the applicable conditions.

Official source: https://huggingface.co/docs/smolagents/index
Official source: https://github.com/huggingface/smolagents

## Accounts & permissions

Based on provider documentation. Permissions depend on the account, integration and organization policies. Review the permissions actually requested before use.

Configuration covered: smolagents · Accounts and permissions
Sources reviewed: 2026-11-16

### Account used

Documented with conditions: Model and service access is assigned within the custom application.

Evidence: https://huggingface.co/docs/smolagents/index
Evidence: https://github.com/huggingface/smolagents

### Admin approval

Documented with conditions: Configure tool permissions and human approvals for the task; verify coverage for each tool.

Evidence: https://github.com/huggingface/smolagents

### Data access & team sharing

Documented with conditions: Custom functions, provider adapters and documented MCP/API connections.

Evidence: https://github.com/huggingface/smolagents

## Prices and included usage

Pricing checked: 2026-11-16

SDK source code without a stated usage fee; model, hosting, storage and optional cloud costs are separate.

### SDK / Source

SDK source code without a stated usage fee; model, hosting, storage and optional cloud costs are separate.

Documented product scope; verify external services and their billing separately.

Price source: https://github.com/huggingface/smolagents

Pricing details: https://github.com/huggingface/smolagents

## Operation & oversight

Based on public provider documentation. Assessments are editorial inferences from the stated properties. Actual time requirements and reliability have not been measured.

Deployment covered: smolagents · Documented execution scope
Sources reviewed: 2026-11-16

### Files and working state

Documented with conditions: AgentMemory holds planning, actions, observations and errors. Replay and programmable steps permit inspection and changes; durable persistence is defined by the application.

Evidence: https://github.com/huggingface/smolagents

### Sign-ins

Documented with conditions: Install the SDK, configure model access and tools, and set up persistence and operations.

Evidence: https://github.com/huggingface/smolagents

### Starting further runs

Documented with conditions: The custom application or an external scheduler starts further runs.

Evidence: https://github.com/huggingface/smolagents

### Human intervention

Documented with conditions: Integrate approvals, cancellation and questions into the custom interface and tool logic.

Evidence: https://github.com/huggingface/smolagents

### Detecting errors

Documented with conditions: Evaluate tool errors and execution results; use product-specific logs and traces for review.

Evidence: https://github.com/huggingface/smolagents

### Resuming after failures

Documented with conditions: Stored context supports further work. Verify automatic retries of failed actions and side effects separately.

Evidence: https://github.com/huggingface/smolagents

### Editorial assessment

Editorial operational assessment; reliable resumption depends on configuration and executed tools.

## Memory and conversation continuity

Scope: smolagents · documented product scope
Sources accessed: 2026-11-16

AgentMemory holds planning, actions, observations and errors. Replay and programmable steps permit inspection and changes; durable persistence is defined by the application.

### Storage and scope

Partly documented: AgentMemory holds planning, actions, observations and errors. Replay and programmable steps permit inspection and changes; durable persistence is defined by the application.

- [smolagents · Memory / Context](https://huggingface.co/docs/smolagents/tutorials/memory)

### Selection and timing

Partly documented: Planning, actions, results and errors are recorded as steps in AgentMemory.

- [smolagents · Memory / Context](https://huggingface.co/docs/smolagents/tutorials/memory)

### Inspect, edit and delete

Partly documented: The application can read and edit memory.steps and the system prompt; callbacks can remove older content.

- [smolagents · Memory / Context](https://huggingface.co/docs/smolagents/tutorials/memory)

### Agent and channel boundaries

Partly documented: Memory belongs to each agent object; configure shared cross-team persistence yourself.

- [smolagents · Memory / Context](https://huggingface.co/docs/smolagents/tutorials/memory)

### Retrieval

Partly documented: Execution uses recorded steps; replay makes the previous run inspectable.

- [smolagents · Memory / Context](https://huggingface.co/docs/smolagents/tutorials/memory)

### Session reset and compaction

Partly documented: Continuation and trimming are programmable; the checked tutorial does not configure a durable memory service.

- [smolagents · Memory / Context](https://huggingface.co/docs/smolagents/tutorials/memory)

## Context

Development, permissions and operations are the responsibility of the custom application. Documented components must be combined and verified for the use case.

Official sources checked. Features are provider claims; examples and suitability are editorial. Independent product testing is pending.

## Sources

- https://huggingface.co/docs/smolagents/index

- https://github.com/huggingface/smolagents

- https://huggingface.co/docs/smolagents/tutorials/memory

## Provider

Hugging Face develops smolagents in its official organization and documents it within its model and developer ecosystem. Repository on 2026-11-16: 30,397 stars, 3,220 forks; license identifier Apache-2.0; last push 2026-11-15.

- Operator: Hugging Face
- Organization: Software project and provider
- Website: https://huggingface.co/docs/smolagents/index
- Reviewed: 2026-11-16

- Provider source: https://huggingface.co/docs/smolagents/index

- Provider source: https://github.com/huggingface/smolagents

[Sources and method](https://ki-agentenkompass.de/en/sources/)
