AgentBox: A zero-dependency, local flight recorder for smolagents ✈️

Hi everyone

I’ve been experimenting a lot with smolagents lately (huge fan of the framework!), but I kept running into a friction point with observability. Every time I wanted to track token burn, execution paths, or latency for my local agents, I found myself needing to spin up heavy Docker containers, full Postgres databases, or rely on cloud API keys.

I really wanted something lightweight that stays entirely on my machine, so I built AgentBox to solve my own headache.

It’s a single-file, zero-dependency “flight recorder” optimized for smolagents. You just drop it into your project folder, and it automatically intercepts the agent logs, calculates fractional USD costs, and saves everything to a local SQLite database. It also spins up a live-refreshing HTML dashboard so you can monitor runs in real-time.

Here is how simple it is to instrument your agent:

Python

from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
from agentbox import record_agent

# The decorator automatically intercepts inputs, outputs, latencies, and costs
@record_agent(name="Search_Agent")
def run_my_agent(prompt):
    agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())
    return agent.run(prompt)

# Execute your agent loop
run_my_agent("What is the latest news in open-source AI?")

I just open-sourced it today. I would genuinely appreciate any harsh feedback, bug reports, or architectural advice from this community—especially regarding how you are all handling local telemetry and if there are better ways to parse the smolagents execution steps!

GitHub Repo: GitHub - pujaaaaaa/agentbox: Local-first AI agent flight recorder and telemetry dashboard · GitHub

Thank you for building such an awesome ecosystem!

1 Like