Valiqor automatically traces Agno Agent.arun() calls, capturing the full
agent lifecycle including model interactions, tool executions, and MCP
tool schemas.
Agno tracing requires the agno package to be installed separately.
There is no valiqor[agno] extra — install agno directly alongside
valiqor.
Install
Zero-Config (Recommended)
Add a single import at the top of your app — all Agno agent runs are
automatically traced:
import valiqor.auto # ← Add this line
from agno.agent import Agent
from agno.models.openai import OpenAIChat
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
description="You are a helpful research assistant",
instructions=["Be concise", "Cite sources"]
)
# Async agent run — automatically traced
import asyncio
response = asyncio.run(agent.arun("What are the latest AI trends?"))
print(response.content)
Selective Instrumentation
If you only want Agno tracing:
from valiqor.trace import agno_autolog
agno_autolog()
When your Agno agent uses tools, each tool execution is captured as a
child span with full details:
import valiqor.auto
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[DuckDuckGoTools()],
description="You are a research assistant with web search"
)
import asyncio
response = asyncio.run(agent.arun("Search for recent news about AI safety"))
Each tool call span captures:
| Field | Description |
|---|
tool_name | Name of the tool |
call_id | Unique tool call identifier |
arguments | Raw and parsed arguments |
result | Tool output content |
error | Error info (if failed) |
description | Tool description |
execution_metrics | Performance data |
Agno’s MCP (Model Context Protocol) tool integration is automatically
detected. When your agent uses MCP tools, Valiqor captures the MCP
server metadata and tool schemas:
import valiqor.auto
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[MCPTools(server_name="my-server", transport="sse", url="http://localhost:8080")]
)
MCP-specific data captured includes server name, transport type, URL,
and tool parameter schemas.
What Gets Captured
Each traced Agno agent call records:
| Field | Description |
|---|
model | Model name from agent instance |
message | User input message |
response | Agent response content |
prompt_tokens | Input token count |
completion_tokens | Output token count |
total_tokens | Combined token count |
cost | Estimated cost in USD |
tool_calls | Full tool call details (see above) |
mcp_tools | MCP server info and tool schemas (if any) |
duration_ms | Total agent run latency |
status | Success or error |
With Workflows
Group multiple agent interactions into a single trace:
import valiqor.auto
from valiqor.trace import trace_workflow
from agno.agent import Agent
from agno.models.openai import OpenAIChat
researcher = Agent(model=OpenAIChat(id="gpt-4o"), description="Research agent")
writer = Agent(model=OpenAIChat(id="gpt-4o"), description="Writing agent")
async def main():
with trace_workflow("research-and-write"):
# Step 1: Research
research = await researcher.arun("Find key facts about quantum computing")
# Step 2: Write article
article = await writer.arun(f"Write an article based on: {research.content}")
import asyncio
asyncio.run(main())
Both agent calls appear as child spans under the research-and-write trace.
Disabling
from valiqor.trace import disable_autolog
disable_autolog("agno") # Disable Agno only
disable_autolog() # Disable all providers
Limitations
- Async only — only
Agent.arun() (async) is traced. Synchronous
Agent.run() is not instrumented. Use asyncio.run() for sync
entry points.
- Streaming is not instrumented.
- Team orchestration — multi-agent team runs are traced at the
individual agent level, not at the team coordination level.
Next Steps