Use this file to discover all available pages before exploring further.
MLflow is a versatile, open-source platform for managing workflows and artifacts across the machine learning and generative AI lifecycle. It has built-in integrations with many popular AI and ML libraries, but can be used with any library, algorithm, or deployment tool.
Tracing: Visualize data flows through your LangChain components with one line of code (mlflow.langchain.autolog())
Experiment Tracking: Log artifacts, code, and metrics from your LangChain runs
Model Management: Version and deploy LangChain applications with dependency tracking
Evaluation: Measure the performance of your LangChain applications
Note: MLflow tracing is available in MLflow versions 2.14.0 and later.This short guide focuses on MLflow’s tracing capability for LangChain and LangGraph applications. You’ll see how to enable tracing with one line of code and view the execution flow of your applications. For information about MLflow’s other capabilities and to explore additional tutorials, please refer to the MLflow documentation for LangChain. If you’re new to MLflow, check out the Getting Started with MLflow guide.
MLflow’s tracing capability helps you visualize the execution flow of your LangChain applications. Here’s how to enable it.
import mlflow# Optional: Set an experiment to organize your tracesmlflow.set_experiment("LangChain MLflow Integration")# Enable tracingmlflow.langchain.autolog()
MLflow also supports tracing LangGraph applications:
import mlflowfrom langchain.tools import toolfrom langchain.agents import create_agent# Enable MLflow tracingmlflow.langchain.autolog()# Define a tool@tooldef count_words(text: str) -> str: """Counts the number of words in a text.""" word_count = len(text.split()) return f"This text contains {word_count} words."# Create a LangGraph agentllm = ChatOpenAI(model="gpt-5.4")tools = [count_words]graph = create_agent(llm, tools)# Run the agentresult = graph.invoke( {"messages": [{"role": "user", "content": "Write me a 71-word story about a cat."}]})
To view the trace, run mlflow ui in your terminal and navigate to the Traces tab in the MLflow UI.