This example shows how to enable tracing for an agent in AgentOS. Simply set tracing=True and all agent runs, model calls, and tool executions are automatically captured.
1
Create a Python file
basic_agent_tracing.py
Copy
Ask AI
from agno.agent import Agentfrom agno.db.sqlite import SqliteDbfrom agno.models.openai import OpenAIResponsesfrom agno.os import AgentOSfrom agno.tools.hackernews import HackerNewsTools# Set up databasedb = SqliteDb(db_file="tmp/traces.db")agent = Agent( name="HackerNews Agent", model=OpenAIResponses(id="gpt-5.2"), tools=[HackerNewsTools()], instructions="You are a hacker news agent. Answer questions concisely.", markdown=True, db=db,)# Setup AgentOS with tracing enabledagent_os = AgentOS( description="Example app for tracing HackerNews", agents=[agent], tracing=True, # Enable tracing for all agents)app = agent_os.get_app()if __name__ == "__main__": agent_os.serve(app="basic_agent_tracing:app", reload=True)