Agno AgentOS now gives your homepage daily metrics through six routes under /os/metrics/*: sessions, runs, tokens, users, models and latency. Each route covers the last 30 days unless you pass starting_date and ending_date. The sessions, runs and tokens views list every day in the window and compare its total with the window of the same length before it.
AgentOS builds these numbers from the sessions and runs you already store, and it keeps them in three new tables:
agno_component_metricskeeps a row per day, user and agent, team or workflow.agno_aggregate_metricskeeps daily and monthly totals per user and for everyone.agno_metrics_refreshesholds the lock that lets one process refresh at a time.
A background task refreshes every database at startup and then every metrics_calculation_interval_seconds, recalculating only the days whose runs changed. The routes only read, so a page load never triggers a calculation. Every database class Agno ships gets the same tables and builder, from SQLite and Postgres to MongoDB, DynamoDB and the in-memory store.
from agno.os import AgentOS
from agno.os.settings import AgnoAPISettings
agent_os = AgentOS(
db=db,
agents=[support],
settings=AgnoAPISettings(metrics_calculation_interval_seconds=300),
)One request reads every database the AgentOS serves and sums them. db_ids names the databases that answered and skipped_db_ids the ones that failed or ran past timeout_seconds, and a repeatable db_id parameter narrows the read. When the databases live on a remote AgentOS, the gateway forwards the whole view there in one request. Each answer carries an ETag, so a dashboard that sends it back in If-None-Match gets 304 Not Modified until the rows behind it change.
We seeded four stored runs across two SQLite databases with upsert_session and upsert_run (no model call), triggered POST /os/metrics/refresh, and read the routes with FastAPI's TestClient:
GET /os/metrics/runs {"total_runs": 4, "status_metrics": {"COMPLETED": 3, "ERROR": 1}, "success_rate": 75.0, "db_ids": {"support-db": ..., "research-db": ...}}
GET /os/metrics/sessions with If-None-Match: <its ETag> 304, empty bodyAfter one more stored session and a second refresh, the same conditional request returned 200 with a new ETag and four sessions.

See the cookbook, and learn more about AgentOS in the documentation.
Frequently asked questions
The homepage reads six GET routes: /os/metrics/sessions, /os/metrics/runs, /os/metrics/tokens, /os/metrics/users, /os/metrics/models and /os/metrics/latency. POST /os/metrics/refresh starts a refresh on demand, and GET /os/metrics/refresh/status reports it per database.
The users view counts people in the AgentOS user directory. Without one, the route answers 503 and asks you to pass a user_directory to AgentOS. The other five views work without it.
Every database class Agno ships supports them, from SQLite and Postgres to MongoDB, DynamoDB and the in-memory store. Each one gets the same tables and builder, and one request to /os/metrics/* sums the numbers across every database the AgentOS serves. Use the repeatable db_id parameter to narrow the read.
AgentOS recalculates once at startup and then every metrics_calculation_interval_seconds, which defaults to 60. Set metrics_calculation_enabled to False to stop calculating and keep serving the rows already built. One lock row lets only one process calculate at a time, even across several servers.


