> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/academy/tier-2-core-skills/m08-evals-human-review/lab-2-build-and-run-an-offline-evaluation.md). Agents can also search and read this documentation through its [MCP server](https://docs.uptiq.ai/~gitbook/mcp).

# Lab 2: Build and run an offline evaluation dataset

Hands-on lab for lesson 2 of module M08, build and run an offline evaluation dataset.

{% @uptiq-training/training-labels content="Module 8 | brand
Lesson 2 of 6 | brand
Lab 2 | success
22 minutes | neutral
Bloom level Apply | neutral" %}

{% @uptiq-training/training-navigator title="M08 Evals & Human Review" content="Lesson 1: Understand the evals framework, offline vs online | soon
Lesson 2: Build and run an offline evaluation dataset | soon
Lab 2: Build and run an offline evaluation dataset | current
Lesson 3: Configure and validate online faithfulness evaluation | soon
Lab 3: Configure and validate online faithfulness evaluation
Lesson 4: Run per-evaluator evaluations and inspect score detail | soon
Lab 4: Run per-evaluator evaluations and inspect score detail
Lesson 5: Review and resolve human review tasks | soon
Lab 5: Review and resolve human review tasks
Lesson 6: Track eval costs and interpret judge vs jury model constraints | soon" %}

## Lab overview

**Exercise title:** Build and Run an Offline Evaluation Dataset

**Difficulty level:** Apply (Bloom Level 3 — you will perform the task, not just recognize it)

**Estimated hands-on time:** 22 minutes

**What you will build:** You will create an offline evaluation dataset for the borrower onboarding agent you built in M03. The dataset will contain five test cases — three you enter manually and two generated by AI. You will then run an evaluation against the dataset, observe the run through its status transitions, and interpret the results on the Runs tab and the Evaluation Run page. Finally, you will identify one Suggested Change from the completed run.

### Prerequisites

* The borrower onboarding agent from M03 must exist in your project and be accessible in Agent Builder.
* A sample policy document is pre-staged in your sandbox environment (see [Your Sandbox Environment](#your-sandbox-environment)). You do not need to prepare this file.
* You must be able to open Agent Builder and navigate to Agent Config for the borrower onboarding agent.

## Your sandbox environment

**Environment access URL:** `<provided by your instructor>`

### Pre-provisioned resources

You do not need to set these up:

* **Borrower onboarding agent (from M03):** Your agent is already present in your project. You will open it in Agent Builder at the start of this lab.
* **Sample policy document:** A sample policy document is pre-staged in your sandbox and will be available to upload during dataset creation. Your instructor will confirm the file name and location before you begin.

### Connection details

| Field                         | Where to find it                                                    |
| ----------------------------- | ------------------------------------------------------------------- |
| **Agent Builder access**      | Navigate to your project in the console, then open Agent Builder    |
| **Borrower onboarding agent** | Listed in your Agent Builder agents list under the project from M03 |
| **Sample policy document**    | Pre-staged in your sandbox — confirm file name with your instructor |

{% hint style="warning" %}
The borrower onboarding agent from M03 must exist in your project before you begin. If you do not see it in Agent Builder, stop and contact your instructor — the remaining steps depend on it.
{% endhint %}

## Configuration template

This lab does not use a configuration file. All setup is performed through the Agent Builder UI. The test case fields you will complete during the lab are described below for reference.

### Test case fields

Manual entry — three cases required:

| Field                           | Description                                               | Your value                                                            |
| ------------------------------- | --------------------------------------------------------- | --------------------------------------------------------------------- |
| **Question**                    | The question the agent will be asked                      | `<YOUR-VALUE>` — write a question answerable from the policy document |
| **Expected answer**             | The correct answer you expect the agent to return         | `<YOUR-VALUE>` — write the answer as it should appear                 |
| **Document context (optional)** | A reference to the uploaded document or a passage from it | `<YOUR-VALUE>` — optional; leave blank if not needed                  |

{% hint style="info" %}
Write test case questions that are directly answerable from the sample policy document you upload. Vague or out-of-scope questions will produce low scores and may not give you meaningful results to interpret.
{% endhint %}

## Step-by-step instructions

### Procedure 1 — Navigate to the Evals Section

{% stepper %}
{% step %}
**Open the borrower onboarding agent in Agent Builder**

Open Agent Builder in your project. Locate the borrower onboarding agent you built in M03 and open it.

You should see the agent's configuration canvas.

| *Agent Builder canvas open with the borrower onboarding agent loaded, showing the agent name in the toolbar and the Agent Config panel visible* |
| ----------------------------------------------------------------------------------------------------------------------------------------------- |

{% hint style="warning" %}
Make sure you are in the correct project. If you have multiple projects, confirm the project switcher in the top navigation shows the project where you built the M03 agent.
{% endhint %}
{% endstep %}

{% step %}
**Open the Test section of Agent Config**

In Agent Config, locate and open the Test section.

{% hint style="info" %}
The Test section of Agent Config is where offline Evals lives. Offline Evals lets you test your agent against a scored dataset before deploying it to production — think of it as a quality gate. The dataset is your test suite; the run is the test execution; the score is the pass/fail verdict.
{% endhint %}

{% hint style="warning" %}
The exact navigation path within Agent Config to reach the Evals dataset creation screen has not been confirmed from source documentation (PKB Gap G2). Your instructor will walk you through the specific tab or menu item that leads to the Evals section if it is not immediately visible. Look for a Test section or tab within Agent Config, then locate the Evals or Datasets area within it.
{% endhint %}

You should see the Evals datasets list for this agent.

| *Agent Builder Evals datasets list, showing the empty state or any existing datasets for the borrower onboarding agent* |
| ----------------------------------------------------------------------------------------------------------------------- |

{% hint style="success" %}
**Checkpoint:** Confirm you can see the Evals datasets area before continuing. If you see a different section of Agent Config, navigate back and locate the Test section.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 2 — Create the Evaluation Dataset

{% stepper %}
{% step %}
**Start a new offline evaluation dataset**

On the Evals datasets screen, select the option to create a new dataset. This opens the October 4 in-page creation screen.

{% hint style="info" %}
Each agent can have up to 100 datasets. A dataset in this context is a collection of eval test cases — it is not the same as a knowledge dataset. The term "dataset" here refers exclusively to eval test cases.
{% endhint %}
{% endstep %}

{% step %}
**Upload the sample policy document**

On the dataset creation screen, select the option to upload a document. Upload the sample policy document that has been pre-staged in your sandbox.

You should see the document accepted and the creation screen ready for test cases.

| *Add test cases — upload file panel, showing the file upload area* |
| ------------------------------------------------------------------ |

{% hint style="info" %}
A document upload can produce up to 500 test cases. The system reads the test cases from the document — they can be listed explicitly in the document, or the document can describe the scenarios to cover. In this lab, you will add test cases manually and via AI generation rather than having them read from the document, so the document serves as the source context for your test cases.
{% endhint %}

{% hint style="warning" %}
If the upload fails or the document format is not recognized, add your test cases manually in the next step. The lab can proceed without a successful document upload — the manual and AI-generated test cases are what matter for the run.
{% endhint %}
{% endstep %}

{% step %}
**Add three test cases manually**

Add three test cases manually. For each test case, complete the following fields:

* **Question:** A question answerable from the policy document (write your own based on the document content)
* **Expected answer:** The correct answer you expect the agent to return
* **Document context (optional):** A reference to the uploaded document or a relevant passage (leave blank if not needed)

Add all three test cases one at a time.

You should see three test cases listed in the dataset after completing this step.

{% hint style="success" %}
**Checkpoint:** Confirm three test cases are visible in the dataset before moving to the next step.
{% endhint %}

{% hint style="success" %}
**Best practice:** Write expected answers that are specific and verifiable — not just "yes" or "no." The LLM scorer compares the agent's actual response to your expected answer, so the more precise your expected answer, the more meaningful the score.
{% endhint %}
{% endstep %}

{% step %}
**Generate two additional test cases using AI**

On the dataset creation screen, select the AI-generated test case option. The system will generate between 1 and 50 test cases. From the generated cases, select two to add to your dataset.

You should see the AI-generated test cases available for selection.

| *Add test cases — generate with AI panel, showing the AI generation option and generated test cases available for selection* |
| ---------------------------------------------------------------------------------------------------------------------------- |

{% hint style="info" %}
The AI-generated test case option is useful when you don't have a pre-existing test library — it bootstraps coverage quickly. The generation produces between 1 and 50 cases; you choose which ones to keep.
{% endhint %}
{% endstep %}

{% step %}
**Confirm the dataset contains five test cases**

You should see five test cases listed in the dataset.

{% hint style="success" %}
**Checkpoint:** Count the test cases in your dataset. You must have exactly five before proceeding to run the evaluation. If you have fewer, add additional manual test cases to reach five.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 3 — Run the Evaluation

{% stepper %}
{% step %}
**Select Run Evaluation and note the initial status**

Select the Run Evaluation button.

Immediately after selecting it, note the run status. It should show Pending.

You should see a success toast confirming: “Evaluation run started.” The run status should display as Pending (warning badge).

{% hint style="warning" %}
Note the Pending status immediately after clicking Run Evaluation — the run may transition quickly depending on your sandbox environment. Pending means the run is queued but background processing has not started yet.
{% endhint %}

{% hint style="info" %}
Up to 3 test cases execute concurrently during a run. The system resolves document references, triggers the agent, passes each question to the agent, extracts the agent's actual answer, and scores it using an LLM scorer (Gemini 3 Flash) on a 0–10 scale. A score of 7 or higher passes.
{% endhint %}
{% endstep %}

{% step %}
**Observe the status transition to Completed**

Watch the run status transition from Pending to Running to Completed.

* **Pending** (warning badge): the run is queued, waiting to start
* **Running** (animated spinner): background processing is in progress; a progress bar shows completed items out of total items; a Stop button is available
* **Completed** (green badge): all test cases have been scored; pass/fail counts and average score are available

You should see the run reach Completed status with a green badge.

{% hint style="info" %}
The UI polls every 3 seconds while a run is in progress and stops automatically when the run completes. You do not need to refresh the page.
{% endhint %}

{% hint style="warning" %}
If the run shows Failed (red badge), hover over the status to read the failure reason. See [Troubleshooting Quick Reference](#troubleshooting) for common failure causes and fixes.
{% endhint %}
{% endstep %}
{% endstepper %}

### Procedure 4 — Review the Results (Independent Phase)

The following steps are the independent phase of this lab. You will complete them without step-by-step prompting. Use what you have learned to navigate the results and interpret them.

{% stepper %}
{% step %}
**Open the Runs tab and read the run card**

Navigate to the Runs tab for this agent's Evals section. Locate the run card for the evaluation you just completed.

Read the following fields on the run card:

* **Dataset name:** the name of the dataset you evaluated
* **Status:** should show Completed (green badge)
* **Passed:** the number of test cases that scored 7 or higher
* **Failed:** the number of test cases that scored below 7
* **Avg score:** the average score across all test cases

You should be able to read all five fields from the run card.

| *Evals runs list showing the completed run card with dataset name, status, Passed/Failed counts, and Avg score visible* |
| ----------------------------------------------------------------------------------------------------------------------- |

{% hint style="success" %}
**Checkpoint:** Confirm you can read the Passed count, Failed count, and Avg score from the run card before opening the Evaluation Run page.
{% endhint %}
{% endstep %}

{% step %}
**Open the Evaluation Run page and review per-test-case results**

Select the run card to open the Evaluation Run page. Review the per-test-case results and scores.

For each test case, note:

* The question that was asked
* The agent's actual answer
* The score (0–10) assigned by the LLM scorer
* Whether the test case passed (score ≥ 7) or failed (score < 7)
* The scorer's reasoning for the score

You should see individual results for all five test cases.

| *Evaluation Run page showing per-test-case results with scores, pass/fail status, and scorer reasoning* |
| ------------------------------------------------------------------------------------------------------- |

{% hint style="info" %}
The LLM scorer (Gemini 3 Flash) assigns each response a score from 0 to 10 along with its reasoning. Scores of 7 or higher pass. The scorer compares the agent's actual answer to your expected answer and evaluates how well the agent's response matches.
{% endhint %}
{% endstep %}

{% step %}
**Identify one Suggested Change**

Suggested Changes can target one of four areas:

* **Instructions** — how the agent is prompted to behave
* **Skills** — the tools and capabilities the agent uses
* **Knowledge** — the documents and data sources the agent draws from
* **Guardrails** — the safety and compliance constraints on the agent

Note which area your identified Suggested Change targets and what it recommends.

{% hint style="info" %}
Suggested Changes can be applied directly from the run results without manually editing the agent. You do not need to apply the change in this lab — just identify and note it.
{% endhint %}

{% hint style="success" %}
**Best practice:** After a real evaluation run, review all Suggested Changes before applying any of them. Some suggestions may conflict with each other or with your agent's intended behavior. Apply changes one at a time and re-run the evaluation to confirm improvement.
{% endhint %}

{% hint style="success" %}
**Checkpoint:** Confirm you have identified at least one Suggested Change and noted which of the four areas (instructions, skills, knowledge, or guardrails) it targets. This is your final checkpoint for the lab.
{% endhint %}
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>Fixes for common problems in this lab</summary>

| Symptom                                                                | Cause                                                                             | Fix                                                                                                                                                                                    |
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Run Evaluation button is not available or appears disabled**         | The dataset has no test cases, or the dataset creation is not complete            | Add at least one test case before attempting to run. Confirm the dataset was saved after adding test cases.                                                                            |
| **Document upload fails or test cases are not read from the document** | The document format is not recognized, or the document structure is not parseable | Add test cases manually instead. The lab can proceed without a successful document upload.                                                                                             |
| **Run status stays on Pending for an extended time**                   | Background processing is queued; this is normal for short periods                 | Wait — the UI polls every 3 seconds. If Pending persists beyond a few minutes, contact your instructor.                                                                                |
| **Run shows Failed (red badge)**                                       | Scoring encountered an error                                                      | Hover over the Failed status to read the failure reason. Common causes: agent executor error, document reference resolution failure. Contact your instructor if the reason is unclear. |
| **Run shows Stopped (red badge)**                                      | The Stop button was selected during the run                                       | Partial results are available. Re-run the evaluation from the dataset to get complete results.                                                                                         |
| **AI-generated test cases do not appear**                              | Generation may take a moment; the system produces between 1 and 50 cases          | Wait for generation to complete. If no cases appear after a reasonable wait, add additional manual test cases to reach five total.                                                     |
| **Runs tab shows no run card after clicking Run Evaluation**           | The run may still be initializing, or you may be on the wrong tab                 | Confirm you are on the Runs tab (not the Datasets tab). Refresh the page if the card does not appear within 30 seconds.                                                                |
| **Suggested Changes section is empty after a completed run**           | The scorer did not generate suggestions for this run                              | This can occur when all test cases pass with high scores. Review the per-test-case results and note the scores — the absence of suggestions is itself a result.                        |
| **Evals section not visible in Agent Config**                          | Navigation path within Agent Config varies; PKB Gap G2 applies                    | Ask your instructor to confirm the exact tab or menu item that leads to the Evals section in your sandbox environment.                                                                 |

</details>

## Checkpoints and validation

### Embedded Checkpoints (Formative)

The following checkpoints appear inline in the Step-by-Step Instructions above. They are summarized here for quick reference.

#### Checkpoint 1 — Evals section accessible (after Step 2)

Confirm you can see the Evals datasets area in Agent Config before creating a dataset. If you cannot find it, ask your instructor for the navigation path.

#### Checkpoint 2 — Three manual test cases added (after Step 5)

Confirm three test cases are visible in the dataset. If you have fewer than three, add additional manual test cases before using the AI generation option.

#### Checkpoint 3 — Five test cases confirmed (after Step 7)

Count the test cases in your dataset. You must have exactly five (three manual, two AI-generated) before running the evaluation. If you have fewer, add additional manual test cases to reach five.

#### Checkpoint 4 — Run card readable (after Step 10)

Confirm you can read the Passed count, Failed count, and Avg score from the run card on the Runs tab before opening the Evaluation Run page.

#### Checkpoint 5 — Suggested Change identified (after Step 12)

Confirm you have identified at least one Suggested Change from the completed run and noted which of the four areas (instructions, skills, knowledge, or guardrails) it targets.

### Summative Assessment

No summative assessment is embedded in this lesson. EO-1 is assessed in the module summative for M08.

## Solution reference

<details>

<summary>The completed state of your work</summary>

The following describes the completed state of your lab environment when all procedures have been successfully executed.

### Completed Dataset

Your evaluation dataset for the borrower onboarding agent contains exactly five test cases:

| #     | Type         | Fields completed                                        |
| ----- | ------------ | ------------------------------------------------------- |
| **1** | Manual       | Question, Expected answer, Document context (optional)  |
| **2** | Manual       | Question, Expected answer, Document context (optional)  |
| **3** | Manual       | Question, Expected answer, Document context (optional)  |
| **4** | AI-generated | Question and Expected answer populated by AI generation |
| **5** | AI-generated | Question and Expected answer populated by AI generation |

The sample policy document has been uploaded as the source context for the dataset.

### Completed Evaluation Run

Your evaluation run has reached Completed status (green badge). The run card on the Runs tab shows:

* **Dataset name:** the name you gave your dataset during creation
* **Status:** Completed
* **Passed:** the count of test cases that scored 7 or higher (exact value depends on your agent's responses)
* **Failed:** the count of test cases that scored below 7 (exact value depends on your agent's responses)
* **Avg score:** the average of all five test case scores on the 0–10 scale

### Completed Evaluation Run Page

The Evaluation Run page shows per-test-case results for all five test cases. Each result includes:

* The question asked
* The agent's actual answer
* The score (0–10) from the LLM scorer (Gemini 3 Flash)
* Pass (score ≥ 7) or Fail (score < 7) verdict
* The scorer's reasoning

### Suggested Change Identified

You have identified at least one Suggested Change from the completed run and noted which of the four target areas it addresses: instructions, skills, knowledge, or guardrails.

### Navigation Path Note

The exact UI navigation path from Agent Builder → Agent Config → Test → Evals → Create Dataset has not been confirmed from source documentation (PKB Gap G2). If your completed lab environment does not match the description above, confirm the navigation path with your instructor and verify that the Evals section you used is the offline Evals dataset creation screen introduced in the October 4 release.

</details>

{% hint style="success" %}
**Lab complete.** Confirm every checkpoint above before you move on.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.uptiq.ai/academy/tier-2-core-skills/m08-evals-human-review/lab-2-build-and-run-an-offline-evaluation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
