LLM-Ops: Evaluating LangGraph Agents and Graphs with MLflow GenAI Evaluate.
Companion code for the Medium article "LLM-Ops and Evaluation of LangGraph Agents and Graphs with MLflow".
- Python 3.12+
- Poetry
- An Azure AI Foundry endpoint with a deployed GPT model (or any other LLM provider, swap the LangChain client and config in
evaluate.py, e.g.ChatOpenAI,ChatAnthropic, etc.) - Azure credentials configured (e.g.
az login; only needed when using Azure AI Foundry)
# Install dependencies
poetry install
# Copy the env template and fill in your values
cp .env.example .env# 1. Start the MLflow tracking server
poetry run mlflow server --host 127.0.0.1 --port 5050
# 2. In another terminal, run the evaluation
poetry run python evaluate.pyOpen http://127.0.0.1:5050 to explore experiments, runs, and traces.
- Builds a LangGraph agent that extracts company names from remittance advice emails
- Runs the agent against 12 diverse evaluation samples (multi-language, varied formats)
- Scores each output with three custom MLflow scorers:
- exact_match: strict case-insensitive string equality
- contains_company: substring check (tolerates extra text)
- llm_judge: LLM-as-a-judge for semantic correctness
- Generates classification reports and confusion matrix visualizations
- Saves results to
eval_results.png