Skip to main content

Integrating Agno with LangDB

LangDB provides an AI Gateway platform for comprehensive observability and tracing of AI agents and LLM interactions. By integrating Agno with LangDB, you can gain full visibility into your agent’s operations, including agent runs, tool calls, team interactions, and performance metrics. For detailed integration instructions, see the LangDB Agno documentation.
langdb-agno finance team observability

Prerequisites

  1. Install Dependencies Ensure you have the necessary packages installed:
  2. Setup LangDB Account
    • Sign up for an account at LangDB
    • Create a new project in the LangDB dashboard
    • Obtain your API key and Project ID from the project settings
  3. Set Environment Variables Configure your environment with the LangDB credentials:

Sending Traces to LangDB

Example: Basic Agent Setup

This example demonstrates how to instrument your Agno agent with LangDB tracing.

Example: Multi-Agent Team Coordination

For more complex workflows, you can use Agno’s Team class with LangDB tracing:

Sample Trace

View a complete example trace in the LangDB dashboard: Finance Reasoning Team Trace
langdb-agno finance team observability

Advanced Features

LangDB Capabilities

  • Virtual Models: Save, share, and reuse model configurations—combining prompts, parameters, tools, and routing logic into a single named unit for consistent behavior across apps
  • MCP Support: Enhanced tool capabilities through Model Context Protocol servers
  • Multi-Provider: Support for OpenAI, Anthropic, Google, xAI, and other providers

Notes

  • Initialization Order: Always call init() before creating any Agno agents or teams
  • Environment Variables: With LANGDB_API_KEY and LANGDB_PROJECT_ID set, you can create models with just LangDB(id="model_name")

Resources

By following these steps, you can effectively integrate Agno with LangDB, enabling comprehensive observability and monitoring of your AI agents.