Skip to main content
Holo4 is trained on tasks that cross interfaces, so it does not need a separate agent per tool. This cookbook starts from the browser agent and adds the Python runner from the code agent. Asked to find two dates and compute the gap between them, Holo reads the dates off the page and leaves the arithmetic to Python.
This example runs model-written code on your machine with subprocess. Outside a demo, run it in a container or a sandbox with no network and no secrets.
1

Start from the browser agent

Install and save browser_agent.py, then make the edits below. Nothing else changes.
2

Add the runner

Import subprocess and sys, and register run_python next to the screen tools:
browser_agent.py
3

Route the call

Handle run_python first in execute, before the screen actions:
browser_agent.py
4

Update the prompt and task

browser_agent.py
5

Run it

Output
Two screen steps to read the dates, one code step to count the days.

How it works

  • One loop, one toolbox. The model sees every tool on every step and chooses by what the step needs. There is no router and no second agent.
  • Screenshots keep coming. Every step still sends a fresh screenshot, including after run_python. The page has not changed, and the model keeps its view of it.
  • Add more interfaces the same way. MCP tools from the MCP agent slot into the same tools list; route their names to session.call_tool.

Next steps

Function calling

Mixing screen, code, and MCP tools.

Core concepts

The loop conventions Holo is trained on.