Skip to main content
A traced agent tells you what happened — which tools were called, how long each step took, and what the LLM generated. Evaluation tells you whether the agent made the right decisions. Without structured scoring, you can’t tell if the agent is selecting the wrong tools, over-escalating simple requests, or stopping before the workflow is complete. These failures don’t throw errors — they just produce worse outcomes. This cookbook walks you through Netra’s evaluation workflow: creating evaluators for agent-specific quality dimensions, building test datasets from your traces, running test suites, and interpreting results to improve your agent.
Prerequisite: You need a Netra API key (Get started here) and an AI agent to evaluate. The test cases below use the customer support agent from the Tracing LangChain Agents cookbook as a reference.

What You’ll Learn

Build a Test Dataset

Create structured test cases with inputs, expected outputs, and metadata for your evaluators

Configure Agent Evaluators

Set up evaluators for tool correctness, escalation accuracy, and workflow completion

Run Test Suites

Execute evaluations via the SDK and collect quality metrics

Analyze Results & Iterate

Interpret scores, debug failures using trace integration, and improve your agent

Why Agent Decisions Need Evaluation

Agent evaluation differs from simple LLM evaluation. Agents make multi-step decisions that compound — a 95% accurate tool selection across 3 steps means only 86% of full workflows succeed (0.95^3): Netra’s evaluation framework addresses this with Datasets (test cases with inputs, expected outputs, and metadata), Evaluators (library and custom code-based scoring for tool usage, escalation, and completion), and Test Runs (execution results with pass/fail rates, scores, and linked traces). The workflow is: create evaluators, build test cases, run, and review. See the Evaluation Overview for a deeper look at the framework.
Now, let’s walk through the process of evaluating agent decisions:

Step 1: Create Evaluators

You need three evaluators — one from the library and two custom LLM as Judge evaluators.

Tool Correctness (Library)

Go to Evaluation → Evaluators, switch to the Library tab, and add Tool Correctness from the Tool Use category.

Escalation Accuracy (LLM as Judge)

Click Add Evaluator and create an LLM as Judge evaluator. Use the following prompt template:

Workflow Completion (LLM as Judge)

Create another LLM as Judge evaluator that validates whether the agent completed all required steps. Use the following prompt template:
You can test each evaluator in the Playground before using it in a dataset. See Evaluators for the full reference.

Step 2: Create a Dataset

Go to Evaluation → Datasets and click Create Dataset. Name it “Agent Decisions Dataset” and attach the three evaluators from Step 1.

Configure Variable Mappings

For each evaluator, map the variables to their data source so the evaluator receives the correct inputs at runtime: Tool Correctness Escalation Accuracy Workflow Completion

Add Test Cases

Add the following five test cases manually: 1. Single-tool — Policy lookup 2. Multi-tool — Ticket with related order 3. Escalation — Angry customer 4. No-tool — Simple thank you 5. Edge case — Non-existent order Under Evaluation → Datasets, you should now see the “Agent Decisions Dataset” with five items and three evaluators under the Evaluators tab.

Step 3: Trigger a Test Run

Copy the Dataset ID from the dataset page and use the code below.
For more details on the evaluation API, refer to the SDK documentation.

Step 4: View Results

Go to Evaluation → Test Runs to see your test run with its status. Click on the test run to see the result for each evaluator, for each dataset item — whether it passed or failed. You can also click View Trace on any result to see the exact reasoning steps (thought → action → observation), which tools were called and in what order, and where the agent deviated from expected behavior. See Test Runs for the full reference.

Interpreting Scores and Improving Quality

When evaluator scores are low, use this table to identify the likely cause and fix:

Prompt Improvements Based on Evaluation

Use evaluation failures to refine your agent prompt:
After making changes, re-run the evaluation against the same dataset and compare results across test runs. Netra tracks all runs so you can see whether your changes improved quality.

Continuous Evaluation Strategy

For production agents, run evaluations regularly:
  1. On every prompt change — Re-run the full test suite to catch regressions
  2. After tool additions — Ensure new tools don’t disrupt existing tool selection patterns
  3. Weekly benchmarks — Track quality trends over time to catch gradual degradation
  4. After model upgrades — Verify that a new model version doesn’t change escalation or tool selection behavior

See Also

Trace Your LangChain Agent

Set up comprehensive tracing for your agent before evaluating

Evaluation Overview

Deep dive into Netra’s evaluation framework: datasets, evaluators, and test runs

Simulating Customer Support

Test your agent through multi-turn simulated conversations

A/B Testing Configurations

Compare different pipeline configurations systematically
Last modified on March 17, 2026