How to evaluate agents in practice

Google Cloud Tech · Beginner ·📄 Research Papers Explained ·7mo ago

Key Takeaways

This video demonstrates how to evaluate AI agents in practice using Google's Agent Development Kit (ADK) and the 3-Tier Testing Pyramid, covering component level unit tests, trajectory level integration tests, and end-to-end human review. The video provides a hands-on example of how to use ADK to test an agent, including setting expected trajectories and evaluating final answers using built-in matrices such as trajectory average score and response match score.

Full Transcript

[music] Hello everyone, welcome back. In the last episode of agent evaluation, we talk about why normal software testing is not working for AI agents and what part of an agent system you should measure. And in today's video, we will turn that theory into practice. We will walk through three tier testing pyramid. so that you have a framework to tackle agent evaluation challenge and then we will use Google agent development kit to actually run test follow this three tier testing pyramid and we will also explain what a trajectory is and how the evaluation matrix work and by the end of today's video you will know how to test your agents step by step by using a clear testing py pyramid and Use ADK to build reliable automated checks. All right, let's get started. So part one, the three tier testing pyramid. You can see from this diagram on the screen that we have the three tiered pyramid. So for the first tier, tier one encompasses component level unit tests which is also the foundation of agent testing and at this level we test the smallest building blocks in isolation. [snorts] Often time it can be tool use like did this agent pick the right tool from the simple prompt? Did it produce a valid correctly structured respon request like correct JSON field and tests at this tier usually are fast, cheap and automated. So it's also perfect for continuous integration to catch regressions earlier. Now let's take a look at this tier two. So this level is about trajectory level integration test. It is also about testing a full multi-step task end to end. And we will cover did the agent plan logically? Did you use tools in the right order and adapt if anything failed? Did the agent remember earlier information and reach the goal? And for the tier three level, it is about end to end human review. We need to involve human in the loop to check this whole experience like the helpfulness, safety, common sense. So this tier is usually slow and more expensive. But it is also your final quality gate. So in summary, here is a big picture. We have tier one component level unit test. It checks correctness like tools and parameters. We have tier two trajectory level hero integration test. It checks capability and reasoning. And lastly tier three end to end human review. This enhance user experience and trust. So now you know the three tier testing pyramid. Let's take a look at example of how to use agent development kit ADK to write tests following this three- tier pyramid framework. and let's take a look at it. So the second part of this video is ADK in action. We will cover what to measure and how to evaluate with ADK. And let's use bookfinder agent. As you can see on the screen in this agent, it's using Gemini 2.5 Pro this model as brain and has three different tools. Search local library tool, find local bookstore tool and order online tool to make decision and answer user's question. So if a user has input query, order this book Harry Potter for me, you will first check the local library and then check the bookstore. If we cannot find this book in the library or bookstore, it will then order online for users. And when we evaluate this agent, we need to evaluate this whole book finding journey. Which means we need to set expected trajectory and compare it with the actual process. And a trajectory is the entire journey your agent takes to solve a task. And this includes first of all the sequence of two costs with their arguments and and secondly the intermediate steps and reasoning. and also the final response. So for this example, bookfinder, our desired trajectory is search local library to find local bookstore and also order online. Other than trajectory, we need to also compare the final answer. We need to see whether that recommends an online retailer or if local options fail. So now we need to measure the trajectory and the final answer. But how to set the criteria? And here we introduce two key ADK built-in matrix. We will use those matrix to define the passing criteria. And the first matrix is to trajectory average score. And this means how closely the actual two costs match your expected sequence. And here is how it scored. We will compare each expected cause to what actual happened. If you set the score to be one, that means they have to match 100% to pass the test. Similarly, if you set the score to be zero, they can pass the test even they're completely different. So when we use it, uh we need to set the threshold between zero and one. And the second matrix is response match score. And this means how similar the final answer to your expected answer. Under hood, we use ro one to check the word overlap which combines the precision and recall into a zero to one score. So when we use it, we need to pick a threshold between zero and one that allows natural language variation. For example, 0.5 means close enough and 0.8 means you need to be very strict with the response. Note that agents are nondeterministic. So we should avoid demanding one unless you use temperature approximate to zero. So now we know we need to test trajectory and final response. Let's design a test following the pyramid framework. So for tier one component tests to test simple prompts and expected to cost by testing components like to selection accuracy parameter and we can check the correctness. And next tier 2 trajectory test we can use ADK eval with multi-step tests and expected two sequence by using matrix like two trajectory average score and response match score. So we can evaluate capability and reasoning. And lastly tier three human review because ADK can give you traces. So we can have human in the loop to judge the whole quality. Now let's get into the last part of this video which is a demo about how to use ADK to test your agent. So for tier one component test we will see this example of two correctness. The goal is does a single tool call get selected and filled correctly. So here is an example code with unit test and when we're reading this tier one result we need to check the two selection accuracy like did it pick the search local library tool and also for the parameter did it pass title equal to harboarder correctly since tier one maps to the foundation the correctness of tools and parameter. So if they fails we need to fix them before moving on. And for tier two trajectory test that including multi-step plan and final answer. The goal is does the agent follow the expected journey and produce a good final response. Here is example code to test and let's set past criterial. We can set this two trajectory average score and response match score to define how strict are the tests. As you can see, 0.8 as trajectory demands a very close match to your plan steps and 0.5 allows a natural language variation in the final response. All right, let's run it and you can see the result from the screen. In summary, you've just learned how to evaluate AI agents in practice. We start with a tier one test for fast cheap component checks and then we move to tier two ADK eval for full trajectory and final answer quality. You can also finish with tier three human review to guarantee a great user experience. So with this three tier approach and ADK built-in tools, you can go from I think this agent works to I know this agent is very reliable. And this allow us to wrap up our two-part series on agent evaluation. In the last episode, we explored what traditional way of testing doesn't work for AI agent and what to measure in agents. So in today's episode, we make it very practical with a clear testing pyramid and hands-on ADK demos. And from here, you're ready to start writing your own evaluation sets and test files with ADK. Thank you so much for watching, and I will see you in future videos. Bye. >> [music] [music]

Original Description

Evaluating Agents with ADK → https://goo.gle/testagent This video applies the theory of AI agent evaluation from our previous episode, guiding you through practical testing with Google's ADK. Learn about the 3-Tier Testing Pyramid, covering component level unit tests, trajectory level integration tests, and human review. Discover how to use ADK to design and run reliable, automated checks for your agents, ensuring they perform as expected in real world scenarios. Chapters: 0:00 - Introduction to practical agent evaluation 1:05 - The 3-tier testing pyramid explained 1:15 - Tier 1: Component level unit tests 1:55 - Tier 2: Trajectory level integration tests 2:22 - Tier 3: End to end human review 3:14 - Agent Development Kit (ADK) in action 4:48 - [Demo] The 3-tier testing pyramid 9:23 - Summary and next steps Watch more AI agent crash course→ https://goo.gle/AIforBeginners Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech #GoogleCloud #AIAgents #ADK Speakers: Annie Wang Products Mentioned: Agent Development Kit
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Google Cloud Tech · Google Cloud Tech · 0 of 60

← Previous Next →
1 I’m going for it #GoogleCloudCertified
I’m going for it #GoogleCloudCertified
Google Cloud Tech
2 I had to get #GoogleCloudCertified
I had to get #GoogleCloudCertified
Google Cloud Tech
3 Be better overall at what you do #GoogleCloudCertified
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
4 Cloud Monitoring on our radar #Analysis #Uptime
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
5 Introduction to Generative AI Studio
Introduction to Generative AI Studio
Google Cloud Tech
6 How to use Github Actions with Google's Workload Identity Federation
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
7 Introduction to Responsible AI
Introduction to Responsible AI
Google Cloud Tech
8 Networking updates and CDMC-certified architecture
Networking updates and CDMC-certified architecture
Google Cloud Tech
9 Create and use a Cloud Storage bucket
Create and use a Cloud Storage bucket
Google Cloud Tech
10 How to digitize text from documents
How to digitize text from documents
Google Cloud Tech
11 Faster analytical queries with AlloyDB
Faster analytical queries with AlloyDB
Google Cloud Tech
12 Next ‘23 sessions and FaaS Wave
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
13 Introduction to Assured Open Source Software
Introduction to Assured Open Source Software
Google Cloud Tech
14 BigQuery Cost Optimization: Storage
BigQuery Cost Optimization: Storage
Google Cloud Tech
15 BigQuery Cost Optimization: Compute
BigQuery Cost Optimization: Compute
Google Cloud Tech
16 BigQuery Cost Optimization: Select Queries
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
17 Remote Field Equipment Management with Manufacturing Data Engine
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
18 Supercharging your applications with Cloud SQL Enterprise Plus
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
19 Vector Support on our radar #GenAI
Vector Support on our radar #GenAI
Google Cloud Tech
20 Architecting a blockchain startup with Google Cloud
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
21 Kubernetes and multitasking updates!
Kubernetes and multitasking updates!
Google Cloud Tech
22 GKE: Using Kubernetes Events
GKE: Using Kubernetes Events
Google Cloud Tech
23 How to configure firewall rules for Cloud Composer
How to configure firewall rules for Cloud Composer
Google Cloud Tech
24 Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
25 Geospatial analytics on our radar #EarthEngine #BigQuery
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
26 Ensuring requests are set in Kubernetes
Ensuring requests are set in Kubernetes
Google Cloud Tech
27 Cloud Next 2023, Google research program, and more!
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
28 How to migrate projects between organizations with Resource Manager
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
29 How to run #MySQL in Google Cloud
How to run #MySQL in Google Cloud
Google Cloud Tech
30 #GenerativeAI for enterprises and #Next2023
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
31 How Google Photos scales to store 4 trillion photos and videos
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
32 Google Cross-Cloud Interconnect (Demo 2)
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
33 GKE Cost Optimization Golden Signals: Introduction
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
34 GKE Cost Optimization Golden Signals: Workload Rightsizing
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
35 GKE Load Balancing: Overview
GKE Load Balancing: Overview
Google Cloud Tech
36 GKE Load Balancing: Best Practices
GKE Load Balancing: Best Practices
Google Cloud Tech
37 Disaster Recovery in GKE
Disaster Recovery in GKE
Google Cloud Tech
38 How to configure IP masquerade agent in GKE Standard clusters
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
39 Enable and use GKE Control plane logs
Enable and use GKE Control plane logs
Google Cloud Tech
40 Compliance in Australia with Assured Workloads
Compliance in Australia with Assured Workloads
Google Cloud Tech
41 Creating budgets and budget alerts in Google Cloud #FinOps
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
42 Cloud SQL Enterprise Plus on our radar #mySQL
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
43 What's Next for Google Cloud?
What's Next for Google Cloud?
Google Cloud Tech
44 How Loveholidays scaled with Contact Center AI
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
45 What is fleet team management in GKE?
What is fleet team management in GKE?
Google Cloud Tech
46 Troubleshoot VPC Network Peering
Troubleshoot VPC Network Peering
Google Cloud Tech
47 Introduction to DocAI and Contact Center AI
Introduction to DocAI and Contact Center AI
Google Cloud Tech
48 Cloud Run Direct VPC egress explained
Cloud Run Direct VPC egress explained
Google Cloud Tech
49 Database deployment options in GKE
Database deployment options in GKE
Google Cloud Tech
50 Analyze cloud billing data with #BigQuery
Analyze cloud billing data with #BigQuery
Google Cloud Tech
51 Tips to becoming a world-class Prompt Engineer
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
52 Serverless is simple. Do I need CI/CD?
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
53 Accelerating model deployment with MLOps
Accelerating model deployment with MLOps
Google Cloud Tech
54 How Hawaii's Department of Human Services scaled with CCAI
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
55 Pricing API on our #Radar
Pricing API on our #Radar
Google Cloud Tech
56 How Recommendations AI for Media can boost customer retention
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
57 Troubleshooting: Node Not Ready Status
Troubleshooting: Node Not Ready Status
Google Cloud Tech
58 One weekend until Cloud Next 2023!
One weekend until Cloud Next 2023!
Google Cloud Tech
59 #GoogleCloudNext starts tomorrow!
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
60 #GoogleCloudNext will be demand!
#GoogleCloudNext will be demand!
Google Cloud Tech

This video teaches you how to evaluate AI agents in practice using the 3-Tier Testing Pyramid and Google's ADK. You'll learn how to design component level unit tests, trajectory level integration tests, and end-to-end human review, and how to use ADK to set expected trajectories and evaluate final answers.

Key Takeaways
  1. Design component level unit tests to check tool selection accuracy and parameter correctness
  2. Create trajectory level integration tests to evaluate capability and reasoning
  3. Set expected trajectories and evaluate final answers using ADK's built-in matrices
  4. Use ADK to run tests and evaluate results
  5. Perform end-to-end human review to guarantee great user experience
💡 The 3-Tier Testing Pyramid provides a framework for evaluating AI agents, and ADK's built-in matrices such as trajectory average score and response match score can be used to set passing criteria for tests.

Related Reads

Chapters (8)

Introduction to practical agent evaluation
1:05 The 3-tier testing pyramid explained
1:15 Tier 1: Component level unit tests
1:55 Tier 2: Trajectory level integration tests
2:22 Tier 3: End to end human review
3:14 Agent Development Kit (ADK) in action
4:48 [Demo] The 3-tier testing pyramid
9:23 Summary and next steps
Up next
Welcome to the Next Temperamental Era
Charles Schwab
Watch →