Langtrace provides a powerful platform for tracing and monitoring AI model calls. By integrating Agno with Langtrace, you can gain insights into your agent’s performance and behavior.
This example demonstrates how to instrument your Agno agent with Langtrace.
Copy
Ask AI
from agno.agent import Agentfrom agno.models.openai import OpenAIChatfrom agno.tools.duckduckgo import DuckDuckGoToolsfrom langtrace_python_sdk import langtracefrom langtrace_python_sdk.utils.with_root_span import with_langtrace_root_span# Initialize Langtracelangtrace.init()# Create and configure the agentagent = Agent( name="Research Agent", model=OpenAIChat(id="gpt-4o-mini"), tools=[DuckDuckGoTools(search=True, news=True)], instructions="You are a research agent. Answer questions in the style of a professional researcher.", debug_mode=True,)# Use the agentagent.print_response("What is the latest news about artificial intelligence?")