AI Pulse by Inblix

Hugging Face brings sight to smolagents, unlocking visual web browsing for AI

Hugging Face Blog · Jan 24, 2025 · 2 min read · Read original article →

Curated by the Inblix editorial team


Featured image for article: Hugging Face brings sight to smolagents, unlocking visual web browsing for AI

Hugging Face just tore down a major wall for AI agents. Their lightweight agent framework, smolagents, can now see, which sounds simple but fundamentally changes what these systems can do in the real world. The update adds native support for vision language models directly inside agentic pipelines.

The core problem was straightforward: text-only agents are practically blind on the modern web. A site’s layout, the color of a button, an icon’s meaning, the spatial relationship between elements—all of that is lost when you just scrape the raw text. For tasks like autonomous web browsing, vision isn’t a nice-to-have. It’s a superpower. Hugging Face’s solution lets agents process what’s actually on the screen, not just a stripped-down text representation of it.

The team built this in two ways. For static tasks like analyzing a PDF full of charts, you can now pass a list of images directly into the agent’s run method. The images get stored as part of the initial task and fed to the model. The more interesting engineering is for dynamic scenarios. By tapping into the agent’s step_callbacks—a function that fires at the end of every ReAct cycle—developers can inject fresh screenshots into the agent’s memory. So after a browser agent clicks a button, a callback snaps a new image of the viewport and logs it as an observation for the next step. It’s a clean, event-driven way to keep the agent’s visual context current without cluttering its core logic.

The accompanying demo uses helium, a selenium wrapper, to let agents directly manipulate web pages. Instead of building a dozen custom tools for clicking and typing, the agent writes helium commands like click('top 10') itself. The team only needed two small helper tools: one to go back to the previous page, and another to close those annoying pop-ups that lack proper text labels on their dismiss buttons. That parsimony is classic smolagents—give the model the right primitives and get out of its way. This puts genuinely useful visual web agents within reach without the bloat of heavier frameworks.

💡 Key Takeaways

  1. Vision is now a first-class input in smolagents, passed either upfront for tasks like document analysis or dynamically via callbacks for real-time web browsing.
  2. The dynamic image injection uses the existing `step_callbacks` hook, logging screenshots as observation images in the agent's ActionStep after each cycle.
  3. The web browsing demo relies on helium for browser automation, requiring only two minimal custom tools, which keeps the agent's toolset lean and focused.

Keep reading: See related articles below for more coverage on this topic.

Get smarter about AI

The sharpest AI news, curated daily. Delivered free to your inbox.

Learn more

Glossary terms

← Back to all articles