Skip to content

Agno

Agno (formerly Phidata) is a framework for building multi-agent systems with memory, knowledge, and tools. You can send full traces of every agent run, tool call, and model request to Logfire.

Agno works with Logfire via the OpenInference instrumentor. Because logfire.configure() sets up the global OpenTelemetry tracer provider, the instrumentor’s spans are exported to Logfire automatically.

Installation

Terminal
pip install logfire agno openai openinference-instrumentation-agno

Usage

Call logfire.configure() and then AgnoInstrumentor().instrument() before creating and running your agent:

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.duckduckgo import DuckDuckGoTools
from openinference.instrumentation.agno import AgnoInstrumentor

import logfire

logfire.configure()
AgnoInstrumentor().instrument()

agent = Agent(
    name='Web Search Agent',
    model=OpenAIChat(id='gpt-4o'),
    tools=[DuckDuckGoTools()],
    instructions='Answer questions concisely, using web search when helpful.',
    markdown=True,
)
agent.print_response('What is Pydantic Logfire, in one sentence?')

You’ll see a trace in Logfire with the agent run at the top and the underlying tool calls and model requests nested beneath it. Agno agents also appear in the specialized Agents view with per-run token counts; the support matrix shows which columns each view populates.

Managed prompts

Keep your agents’ instructions in Prompt Management and fetch them at runtime:

Terminal
pip install 'logfire[variables]'
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from pydantic import BaseModel

import logfire

logfire.configure()


class InstructionInputs(BaseModel):
    audience: str


instructions_var = logfire.template_var(
    name='prompt__assistant_instructions',
    type=str,
    default='Answer questions concisely.',
    inputs_type=InstructionInputs,
)

with instructions_var.get(InstructionInputs(audience='developers'), label='production') as resolved:
    instructions = resolved.value

agent = Agent(
    name='Assistant',
    model=OpenAIChat(id='gpt-4o'),
    instructions=instructions,
)

See Use Prompts in Your Application for the full workflow.