Skip to main content

Integrating Agno with MLflow

MLflow provides built-in GenAI tracing so you can capture, explore, and analyze LLM and agent traces. Agno integrates directly with MLflow via a single call to mlflow.agno.autolog().

Prerequisites

  1. Install Dependencies Ensure the required packages are installed:
  2. Start the MLflow tracking server Start the MLflow tracking server to view traces as you run your code:
    For more information on how to host an MLflow server, see the MLflow documentation.
    If you don’t want to self-host an MLflow server, you can use Managed MLflow offered by various cloud providers.

Set Environment Variables

Set the environment variables for the MLflow server URL and experiment name:
Alternatively, you can set these in your code using Python APIs. If you do this, you must call this before calling mlflow.agno.autolog().

Enable Automatic Tracing in Your Code

Call mlflow.agno.autolog() once at startup, then use your Agno agent as usual. MLflow will automatically record traces of model/tool calls and agent steps.

View Traces

Access the MLflow UI to view the traces. If you started the UI locally, open http://127.0.0.1:5000 in your browser. If you are using a managed MLflow server, you can access the UI at the URL provided by the cloud provider.
Agno traces in MLflow

AgentOS example

You can instrument your AgentOS application with MLflow by using the same approach as above. Simply call mlflow.agno.autolog() before creating your AgentOS instance.
agno_assist.py
Then run your AgentOS application following the instructions. MLflow will automatically record traces of model/tool calls and agent steps.
Agno traces in MLflow

Notes

  • Ensure your model provider credentials (for example, OPENAI_API_KEY) are set in the environment.
  • For best results, use the latest MLflow version that includes the Agno autolog integration.