databricks-mlflow-evaluation
MLflow 3 GenAI agent evaluation. Use when writing mlflow.genai.evaluate() code, creating @scorer functions, using built-in scorers (Guidelines, Correctness, Safety, RetrievalGroundedness), building eval datasets from traces, setting up trace ingestion and production monitoring, aligning judges with MemAlign from domain expert feedback, or running optimize_prompts() with GEPA for automated prompt improvement.
What this skill does
# MLflow 3 GenAI Evaluation ## Scope vs upstream `mlflow/skills` The OSS `mlflow/skills` repo ships [`agent-evaluation`](https://github.com/mlflow/skills/tree/main/agent-evaluation) and related skills (`instrumenting-with-mlflow-tracing`, `analyze-mlflow-trace`, `retrieving-mlflow-traces`, `querying-mlflow-metrics`) that cover the generic MLflow GenAI evaluation workflow — `mlflow.genai.evaluate()`, scorers/judges, datasets, tracing setup, and the 5-step evaluation loop. This skill **layers Databricks-specific patterns on top of that workflow** rather than restating it. Use this skill when you need any of: - **Unity Catalog trace ingestion** — production traces written into UC tables, log-based monitoring (`patterns-trace-ingestion.md`). - **MemAlign judge alignment via UC SME labeling sessions** — aligning custom judges against domain-expert feedback collected in Databricks (`patterns-judge-alignment.md`). - **`optimize_prompts()` GEPA loop** — Databricks' automated prompt-optimization driver running on a UC dataset (`patterns-prompt-optimization.md`). - **Databricks-flavored scorer/dataset patterns** — UC-table-backed datasets, tagging traces in the Databricks UI for inclusion (`patterns-datasets.md`, `patterns-scorers.md`). For everything else — generic `mlflow.genai.evaluate()` calls, scorer authoring patterns, dataset creation outside Databricks, MLflow tracing setup that isn't UC-table-bound — the upstream `mlflow/skills/agent-evaluation` skill is the canonical source and is kept current by the MLflow team. ## Before Writing Any Code 1. **Read GOTCHAS.md** - 15+ common mistakes that cause failures 2. **Read CRITICAL-interfaces.md** - Exact API signatures and data schemas ## End-to-End Workflows Follow these workflows based on your goal. Each step indicates which reference files to read. ### Workflow 1: First-Time Evaluation Setup For users new to MLflow GenAI evaluation or setting up evaluation for a new agent. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Understand what to evaluate | `user-journeys.md` (Journey 0: Strategy) | | 2 | Learn API patterns | `GOTCHAS.md` + `CRITICAL-interfaces.md` | | 3 | Build initial dataset | `patterns-datasets.md` (Patterns 1-4) | | 4 | Choose/create scorers | `patterns-scorers.md` + `CRITICAL-interfaces.md` (built-in list) | | 5 | Run evaluation | `patterns-evaluation.md` (Patterns 1-3) | ### Workflow 2: Production Trace -> Evaluation Dataset For building evaluation datasets from production traces. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Search and filter traces | `patterns-trace-analysis.md` (MCP tools section) | | 2 | Analyze trace quality | `patterns-trace-analysis.md` (Patterns 1-7) | | 3 | Tag traces for inclusion | `patterns-datasets.md` (Patterns 16-17) | | 4 | Build dataset from traces | `patterns-datasets.md` (Patterns 6-7) | | 5 | Add expectations/ground truth | `patterns-datasets.md` (Pattern 2) | ### Workflow 3: Performance Optimization For debugging slow or expensive agent execution. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Profile latency by span | `patterns-trace-analysis.md` (Patterns 4-6) | | 2 | Analyze token usage | `patterns-trace-analysis.md` (Pattern 9) | | 3 | Detect context issues | `patterns-context-optimization.md` (Section 5) | | 4 | Apply optimizations | `patterns-context-optimization.md` (Sections 1-4, 6) | | 5 | Re-evaluate to measure impact | `patterns-evaluation.md` (Pattern 6-7) | ### Workflow 4: Regression Detection For comparing agent versions and finding regressions. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Establish baseline | `patterns-evaluation.md` (Pattern 4: named runs) | | 2 | Run current version | `patterns-evaluation.md` (Pattern 1) | | 3 | Compare metrics | `patterns-evaluation.md` (Patterns 6-7) | | 4 | Analyze failing traces | `patterns-trace-analysis.md` (Pattern 7) | | 5 | Debug specific failures | `patterns-trace-analysis.md` (Patterns 8-9) | ### Workflow 5: Custom Scorer Development For creating project-specific evaluation metrics. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Understand scorer interface | `CRITICAL-interfaces.md` (Scorer section) | | 2 | Choose scorer pattern | `patterns-scorers.md` (Patterns 4-11) | | 3 | For multi-agent scorers | `patterns-scorers.md` (Patterns 13-16) | | 4 | Test with evaluation | `patterns-evaluation.md` (Pattern 1) | ### Workflow 6: Unity Catalog Trace Ingestion & Production Monitoring For storing traces in Unity Catalog, instrumenting applications, and enabling continuous production monitoring. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Link UC schema to experiment | `patterns-trace-ingestion.md` (Patterns 1-2) | | 2 | Set trace destination | `patterns-trace-ingestion.md` (Patterns 3-4) | | 3 | Instrument your application | `patterns-trace-ingestion.md` (Patterns 5-8) | | 4 | Configure trace sources (Apps/Serving/OTEL) | `patterns-trace-ingestion.md` (Patterns 9-11) | | 5 | Enable production monitoring | `patterns-trace-ingestion.md` (Patterns 12-13) | | 6 | Query and analyze UC traces | `patterns-trace-ingestion.md` (Pattern 14) | ### Workflow 7: Judge Alignment with MemAlign For aligning an LLM judge to match domain expert preferences. A well-aligned judge improves every downstream use: evaluation accuracy, production monitoring signal, and prompt optimization quality. This workflow is valuable on its own, independent of prompt optimization. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Design base judge with `make_judge` (any feedback type) | `patterns-judge-alignment.md` (Pattern 1) | | 2 | Run evaluate(), tag successful traces | `patterns-judge-alignment.md` (Pattern 2) | | 3 | Build UC dataset + create SME labeling session | `patterns-judge-alignment.md` (Pattern 3) | | 4 | Align judge with MemAlign after labeling completes | `patterns-judge-alignment.md` (Pattern 4) | | 5 | Register aligned judge to experiment | `patterns-judge-alignment.md` (Pattern 5) | | 6 | Re-evaluate with aligned judge (baseline) | `patterns-judge-alignment.md` (Pattern 6) | ### Workflow 8: Automated Prompt Optimization with GEPA For automatically improving a registered system prompt using `optimize_prompts()`. Works with any scorer, but paired with an aligned judge (Workflow 7) gives the most domain-accurate signal. For the full end-to-end loop combining alignment and optimization, see `user-journeys.md` Journey 10. | Step | Action | Reference Files | |------|--------|-----------------| | 1 | Build optimization dataset (inputs + expectations) | `patterns-prompt-optimization.md` (Pattern 1) | | 2 | Run optimize_prompts() with GEPA + scorer | `patterns-prompt-optimization.md` (Pattern 2) | | 3 | Register new version, promote conditionally | `patterns-prompt-optimization.md` (Pattern 3) | ## Reference Files Quick Lookup | Reference | Purpose | When to Read | |-----------|---------|--------------| | `GOTCHAS.md` | Common mistakes | **Always read first** before writing code | | `CRITICAL-interfaces.md` | API signatures, schemas | When writing any evaluation code | | `patterns-evaluation.md` | Running evals, comparing | When executing evaluations | | `patterns-scorers.md` | Custom scorer creation | When built-in scorers aren't enough | | `patterns-datasets.md` | Dataset building | When preparing evaluation data | | `patterns-trace-analysis.md` | Trace debugging | When analyzing agent behavior | | `patterns-context-optimization.md` | Token/latency fixes | When agent is slow or expensive | | `patterns-trace-ingestion.md` | UC trace setup, monitoring | When setting up trace storage or production monitoring | | `patterns-judge-alignment.md` | MemAlign judge alignment, labeling sessions, SME feedback | When aligning judges to domain expert preferences | | `patterns-prompt-o
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.