﻿---
title: Workflow
description: How people use judy day to day, from the first measurement to a gate in CI. A typical loop on a search change: Keep a results file from the main branch:...
url: https://docs-v3-preview.elastic.dev/workflow
---

# Workflow
How people use judy day to day, from the first measurement to a gate in CI.

| Step                             | Command                               | Page                                                                                                                        |
|----------------------------------|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| Measure a target                 | `judy run`                            | [Getting started](https://docs-v3-preview.elastic.dev/getting-started)                                                      |
| Decide whether a change is real  | `judy compare`                        | [Comparing changes](https://docs-v3-preview.elastic.dev/workflow/compare)                                                   |
| Stop regressions                 | gates, `--max-regression`, exit codes | [In CI](https://docs-v3-preview.elastic.dev/workflow/ci)                                                                    |
| Fill the unjudged gaps           | `judy judge`, `judy review`           | [LLM as a judge](https://docs-v3-preview.elastic.dev/llm)                                                                   |
| Understand and fix bad queries   | `judy diagnose`, `judy suggest`       | [Diagnose](https://docs-v3-preview.elastic.dev/llm/diagnose) and [suggest](https://docs-v3-preview.elastic.dev/llm/suggest) |
| Measure queries your code builds | a `builder` target                    | [Dynamic query building](https://docs-v3-preview.elastic.dev/workflow/dynamic-queries)                                      |
| Choose between retrieval modes   | `judy modes`                          | [Modes](https://docs-v3-preview.elastic.dev/concepts/modes)                                                                 |

A typical loop on a search change:
1. Keep a results file from the main branch: `judy run set.yaml --target prod`.
2. Change the query. Run the same set against the new query.
3. `judy compare` the two results. Read the most regressed queries, not only the mean.
4. If the new target returns documents nobody judged (`judged@k` dropped), run `judy judge` and compare again.
5. In CI, gate on `ndcg` and fail the build on a regression.