What is an agent?
An agent is a named entity in AgentVista that groups all traces produced by a particular piece of logic. It might be a customer support bot, a lead qualification pipeline, a code review assistant, or any other automated workflow you want to observe independently. Agents are created automatically. The first time you send a trace with a newagent_name, AgentVista registers that agent in your account. There is nothing to provision or configure in advance — just start sending data.
"support-bot" without any conflict. Within your account, agent names are unique — sending traces with the same agent_name always groups them under the same agent.
The
agent_name you pass to @trace_agent or agentvista.run() is the agent’s display name in the dashboard. Choose a name that describes what the agent does, not how it’s implemented.What is a run?
A run is synonymous with a trace — one complete execution of your agent from start to finish. Every time your decorated function is called, or every time awith agentvista.run(...) block executes, AgentVista records a new run.
Each run captures:
- When it started and ended
- How long it took (
duration_ms) - Whether it succeeded (
success) - What the outcome was (
outcome) - Every span (LLM calls, tool calls, DB queries) inside it
- Total token usage and cost across all LLM spans
Agent statistics
The dashboard computes the following statistics across all runs for each agent:| Metric | Description |
|---|---|
| Total runs | Count of all traces recorded for this agent |
| Success rate | Percentage of runs where success = true |
| Average cost per run | Mean of total_cost_usd across completed runs |
| Total cost | Sum of total_cost_usd across all runs |
| p95 latency | 95th percentile of duration_ms across completed runs |
Creating runs
You have two ways to create a run, depending on how much control you need.Decorator
Use@agentvista.trace_agent when you want zero-friction instrumentation. Wrap your agent function and every call becomes a run automatically.
@agentvista.trace_agent without a name — the agent name defaults to the function name:
failed automatically if an unhandled exception propagates out of the function.
Context manager
Usewith agentvista.run(...) when you need to set an outcome or control the run’s lifecycle explicitly:
r.set_outcome() attaches success and outcome to the trace when the context manager exits. If you don’t call set_outcome(), those fields are left blank on the trace.
Record (v1 API)
For simple cases where you don’t need span-level detail,agentvista.record() creates a minimal single-span trace in one call:
Multiple agents
You can track as many agents as you need — there is no limit on the number of agents per account. Each agent appears as a separate entry in the dashboard and is tracked independently.Agent comparison
The dashboard lets you place two agents side-by-side to compare:- Success rate — which agent is more reliable?
- Average cost per run — which is more efficient?
- p95 latency — which is faster?