# smolagents

> Lightweight open-source Python library for building code-writing and vision AI agents

smolagents is Hugging Face's lightweight agent framework that lets AI agents write and execute code actions rather than relying solely on JSON tool-calling. With added support for Vision-Language Models (VLMs), developers can create autonomous web-browsing agents that view screenshots, dismiss popups, and interact with live web pages dynamically.

Website: https://huggingface.co/blog/smolagents-can-see

## What it is for

- Build autonomous browser agents to navigate web apps and extract data visually
- Inspect web pages and extract data hidden behind dynamic JavaScript or visual elements
- Dismiss modal popups, cookie banners, and interact with complex page elements via automated actions
- Process multi-page visual documents like PDFs using vision models in an agent loop

## Features

- Native support for Vision-Language Models (VLMs) via step callbacks and screenshot logging
- CodeAgent architecture where models output executable Python code instead of fixed JSON schemas
- Easy integration with browser automation tools like Helium and Selenium
- Dynamic memory management that prunes old screenshots to keep model contexts lean
- Built-in support for open-source VLMs (SmolVLM, Qwen2-VL) as well as proprietary vision models

## Pricing

Open source. Free and open-source (Apache-2.0 license); underlying model API calls may incur standard provider fees

## Details

- Type: Web app
- Category: [Development](https://xiry.app/topics/development.md)
- Topic: [Agent Frameworks](https://xiry.app/topics/ai/agent-frameworks.md)
- Open source: yes
- Platforms: Code library, Linux, macOS, Windows
- For: Python developers and AI engineers building autonomous web scraping and multi-modal agents
- Alternative to: OpenAI Operator, Browser Use, LangChain, CrewAI
- Tags: smolagents, huggingface, ai agents, browser automation, vision models, vlm, python

## Why it was saved

- [@mervenoyann, 26 January 2025](https://x.com/mervenoyann/status/1883517509904875687): Lets you build autonomous browser agents in Python: CodeAgent + browser tools (get\_driver, scroll\_down, click, close\_popups, final\_answer), with a prompt pattern giving stepwise instructions and helium\_instructions baked in. Demo in the video: agent navigates GitHub Trending, opens a repo, inspects the author profile and returns '308' commits in a year.
- [@mervenoyann, 26 January 2025](https://x.com/mervenoyann/status/1883517509904875687): Companion guide linked by the author explaining the VLM browser-agent capability shown in the demo.

## Compare

- [Alternatives to browser-use](https://xiry.app/alternatives/browser-use.md)
- [Alternatives to OpenAI Operator](https://xiry.app/alternatives/openai-operator.md)
- [Alternatives to LangChain](https://xiry.app/alternatives/langchain.md)
- [Alternatives to CrewAI](https://xiry.app/alternatives/crewai.md)

## Related

- [ai-hedge-fund](https://xiry.app/resources/ai-hedge-fund): Proof-of-concept AI multi-agent trading system with paper trading and backtesting. (GitHub repo, Open source)
- [Eliza](https://xiry.app/resources/eliza): Open-source multi-agent framework for building autonomous social and on-chain AI agents (GitHub repo, Open source)
- [memary](https://xiry.app/resources/memary): Open-source persistent memory layer for autonomous AI agents using knowledge graphs (GitHub repo, Open source)
- [Self-Improving Agent Loop via skill.md](https://xiry.app/resources/self-improving-agent-loop-via-skill-md): A workflow pattern where agents document completed tasks into reusable shortcuts (Tip, Free)
- [awesome-llm-apps](https://xiry.app/resources/awesome-llm-apps): Open-source collection of runnable AI agent, skill, and RAG templates (GitHub repo, Open source)
- [Browser Use Cloud](https://xiry.app/resources/browser-use-cloud): Cloud-hosted stealth browser infrastructure and execution platform for AI agents. (Web app, Freemium)

Updated 10 October 2026. Page: https://xiry.app/resources/smolagents

Make your own library: Xiry takes your saved reels, tweets, Reddit bookmarks and Watch Later videos, makes them searchable and pulls the useful stuff out, like this library. It's invite-only for now; join the waitlist at https://xiry.app/#waitlist.
