← All AI Engineer talks

AI Engineer World's Fair 2025

Will Agent Evaluation via MCP Stabilize Agent Networks?

About this talk

Root Signals CEO Ari Heljakka demonstrates how Model Context Protocol can connect agents to persistent evaluators and judges, creating feedback loops that measure output quality and improve behavior. Examples include using Cursor to optimize marketing copy and adding an MCP-accessible policy evaluator to a Pydantic AI hotel-reservation agent, preventing it from recommending a competing hotel.

Chapters

  1. 0:03Why agent networks need stable evaluation
  2. 3:29Designing evaluator stacks and connecting them through MCP
  3. 5:22Cursor demonstration: judges and iterative message optimization
  4. 9:03Pydantic AI reservation agent: policy failure without MCP
  5. 10:44Enabling MCP evaluation to correct agent behavior
  6. 13:41Root Signals MCP server availability and closing remarks

Talk transcript

  1. 0:03

    Hi, this is Ari Heljakka, the CEO of Root Signals, uh, the platform for measuring, controlling, and optimizing LLM-based agents, chatbots, and workflows, both for AI product companies and enterprises.

  2. 0:19

    And today, I'm trying to answer the question whether agent evaluation by MCP, or Model Context Protocol, could stabilize agents and agent networks and swarms.

  3. 0:33

    So most of us are already thinking along the lines that if you only had a stable agent swarm, you could, in principle, solve any kinds of knowledge work problems.

  4. 0:47

    And the only limitation here is that those swarms tend not to be stable when you try to solve increasingly complex problems. And the reasons relate to, uh, both for our inability to observe them perfectly and the dynamic environment, uh, difficulties of testing them, uh, comprehensively beforehand, et cetera.

  5. 1:10

    And, uh, also it is often not clear whether the agents are making progress consistently towards the goal in the cases where they just don't achieve it on basically one shot.

  6. 1:20

    Uh, so, uh, h-how do we start, uh, solving this problem in a more robust manner? The general answer to the question is going to be evaluations or evals, uh, but not in a way that you would think.

  7. 1:34

    So, uh, firstly, many people tend to oversimplify, uh, the questions or question of evaluations. And, uh, if you just go out there and you s- you basically just take some eval stack and you add it, then the outcome is, is, is like this.

  8. 1:51

    That alone will probably not take you anywhere. Just the same, uh, same, uh,

  9. 1:59

    kind of, uh, outcome if you don't actually systematically use evaluations, uh, in a way that, uh, not only improves those agents and workflows, but also those evaluation stacks themselves continuously develop and, uh, and, uh, grow more aligned with, uh, with your actual, uh, business requirements.

  10. 2:22

    So the reason, uh, this is difficult is fundamentally because, uh, if you want to evaluate all aspects of agent behaviors and internal representations, you have a very complex landscape as shown here.

  11. 2:35

    Uh, on the links below the video or attached to the video, you can also find, uh, my previous talk on this same topic where I, I went through this in more detail.

  12. 2:43

    But in short, you have both, uh, evaluations for the left-hand side, which is, uh, in a way the agent represents reality. Well, how it, uh, models the reality and discusses the reality with the user, and how it's grounded to reality in terms of, uh, what is true.

  13. 3:02

    And on the other hand, on the right-hand side, you have behavioral aspects, such as whether the a- agent actually inferred the right goals, whether it's, uh, making progress towards those goals, whether it selects the light- right tools on the path to get there, et cetera, et cetera.

  14. 3:17

    Uh, so in principle, you would want to evaluate all these things, but at least getting started with some would probably take us somewhere if we are just, uh, be able to do that consistently.

  15. 3:29

    Uh, so first to get started as an example, uh, we need to have some kind of a, a clear, uh, framework for actually setting up the evaluators. So for example, in this case, we are looking at, uh, reservation, uh, agent for a hotel.

  16. 3:47

    And for this purpose, we would have eva- evaluators such as, uh, the ones mentioned here, like policy adherence to that spec- specific hotel's, uh, reservation policy, uh, accuracy of, of the, uh, outputs of the agent to the user, and, uh, and then of course, the, uh, um, the appropriate, uh, behavior overall.

  17. 4:08

    Uh, so you need to, to, to set up, uh, these evaluators somewhere. These has-- have been set up, uh, in Root Signals. But wherever you do, uh, make sure that you have both, uh, good visibility to how you can create large stacks of evaluators and how you can maintain them and improve them systematically over time when you,

  18. 4:27

    when you have to run dozens of them all the time. Uh, so what we want to achieve is, uh, is a stabilization loop where, uh, the agent attempts a certain task.

  19. 4:39

    It-- the out- output of the task will get evaluated by the evaluation engine, and then feedback in the form of, uh, numeric score and also, uh, explanation of what went wrong comes back to the agent, or the explanation of, uh, what went well as well.

  20. 4:56

    Uh, so using that information, the agent can then improve its own performance. So these needs to come, come from the eval engine. And in order to attach these agents, uh, the new, uh, latest, greatest method is going to be the Model Context Protocol or the MCP.

  21. 5:12

    So let's look at, uh, some practical examples next. And we will start with, uh, with something very simple.

  22. 5:22

    So for this, uh, first experiment, we will not even have code. We will just be looking at, at text. So if the agent or whatever workflow you're running would, uh, out- output, uh, this sort of, uh, sentence, like a Root Signals MCP Server is awesome, lets you access evals nicely.

  23. 5:39

    And, and now you want to measure and also improve, uh, this

  24. 5:46

    specific text that might be coming out of the agent. So for this purpose, uh, you firstly need to find which evals you want to run on it. So we can actually ask, uh, the cursor UI, uh, through MCP to firstly list the judges that I have available.

  25. 6:07

    You can also list evaluators directly. Judges would be collections of evaluators in this, uh, specific terminology. So I've already attached the, uh, the, the free Root Signals MCP server that you can get from GitHub, and I just added it on, on Cursor.

  26. 6:24

    And what this MCP, uh, server lets you do is gives you access to these evaluators and these judges that I have created for myself earlier and then some, some universal judges, uh, universal evaluators that can be used, used anywhere.

  27. 6:38

    So importantly, the first one here that I happen to be interested in in this case was this marketing message quality judge. So it was just found by, by what I wrote here.

  28. 6:47

    So I can then very freely just, uh, or loosely just, uh, ask Cursor to measure and improve this, uh, this marketing statement on the left by just saying that, uh, [keyboard clacking] "Optimize the message by using the marketing message optimization judge."

  29. 7:08

    And at this point, Cursor is going again through, through the MCP interface, uh, back to the, uh, judge and evaluator stack. It will find again that specific judge I was interested in.

  30. 7:22

    It will score, uh, this message on the left, and then it will, uh, try to figure out how to improve that score and score it again if everything goes nicely.

  31. 7:34

    So let's, let's see if it's, uh, able to actually do that. And this is actually now real time. Okay. Actually, at least it's finding various issues with it, and then it continues, uh, the process of trying to improve.

  32. 7:50

    Let's see if we can, we can get the scores. Okay, it's already suggesting an improved version of that based on the scores. But let's see if we'll also see the scores from, from here.

  33. 8:02

    Sometimes they are shown immediately, sometimes, uh, they are shown later. So apparently, this time it didn't show the original scores for us. But now it's, uh, it's, uh, running the final evaluation to get us with the final scores.

  34. 8:19

    If you don't see the scores, you can actually ask it to show them. Now it's showing them. So, okay, so persuasiveness, quality of writing, engagingness, uh, numbers shown here.

  35. 8:29

    You can see numbers that, that it started out with. You can, you can see, uh, final numbers. Now it's only showing the, the final, final numbers between zero and one.

  36. 8:37

    So this is basically the same thing that will happen inside your agent, but now we just called it manually to make it easy for us to, us to see.

  37. 8:45

    For the agent, you can either exactly explain which evaluators and which judges to run, or you can just, uh, just let it pick, uh, pick them, uh, itself. So next we'll look at an actual agent example.

  38. 9:03

    And, uh, now I want to be really clear. We are no longer talking to MCP through Cursor, uh, so I'm removing this from, from our field of view. Uh, so I have now an actual very simple, uh, hotel reservation agent here, uh, running on Pydantic AI.

  39. 9:24

    And this is, uh, this is just, just happens to be implemented or actually, uh, viewed through Cursor. Uh, and, uh, in, in fact, I'm going to run this, uh, th- this, uh, separately on the console.

  40. 9:38

    And, uh, what happens in this, uh, reservation agent is that the user is going to ask something a little bit dangerous. So this is a reservation agent for Shire Hotel.

  41. 9:51

    And the, the Shire Hotel happens to be next to the ACME Hotel. So in no circumstances is the Shire Hotel reservation system supposed to be, uh, recommending or preferably saying anything about the ACME Hotel.

  42. 10:05

    Uh, so the user is now asking about the Shire specifically, but actually hinting that it would also be interested on the, on the hotel, uh, next to it. A bit maybe artificial example, but just, uh, showing this, uh, this very precisely what is the problem.

  43. 10:19

    So let's see what happens when you run this without the MCP.

  44. 10:28

    So currently, the MCP is off, and let's see what the agent returns. Okay, it will, uh, politely say that, uh, there will be rooms available a bit later. Uh, but it's also saying that, uh, that the ACME Hotel is also a great option.

  45. 10:44

    So this is what they don't want to see. So let's go back. We will turn on, uh, the MCP server here and see if that makes a difference. It just, uh, set this to true, and it will then add, uh, it will actually use this, uh, this MCP server here for evaluation.

  46. 11:04

    So let's go back to, uh, then running this same command again.

  47. 11:11

    And while it's running, it's, uh, calling the MCP server here. So you will see that, uh, there will be a lot of activity happening, uh, where evaluators are being listed and they will be, uh, there will be calls back and forth through the evaluator, uh, lists and running many of them and some of them several times even

  48. 11:30

    if we want to, uh, make maximum use of this.

  49. 11:38

    All right. Uh, so as you can see now, the agent came back, and now it's, uh, not talking about the ACME Hotel again. And we can see that it was invoking this Hotel Shire booking policy evaluator, even though we didn't even ask it specifically to do that.

  50. 11:53

    So it can, uh, in most circumstances, pick relevant ones from the list. But you can also, uh, enforce specific ones if, if you, if you want to be sure.

  51. 12:03

    Uh, so this seems to have w- worked. And, uh, then let's go back to the big picture

  52. 12:12

    So what we have now seen is, uh, agent being attached to the evaluation engine through the MCP and getting the feedback and improving its own behavior, and you can see how this, uh, sort of approach would scale to more complex examples.

  53. 12:26

    So then, uh, to, uh, to summarize on how to approach this, you should first start by making sure that your evaluation library, evaluation platform, whatever you're using, is sufficiently powerful to, to support all this, both in terms of diversity of evaluators that you can create and also their, uh, life cycle maintenance and optimization on both the,

  54. 12:51

    uh, letting you both optimize the agent itself, but also you need to be able to optimize, uh, the, uh, the evaluators, uh, because, uh, you will be running a lot of them and they will cost you money.

  55. 13:04

    Also, uh, it's a good idea to start with, uh, running the MCP manually offline like we did with the marketing message example, so you- so that you first understand roughly what is happening, and then you're able to, uh, get better and better transparency to, uh, to the, uh, ways in which those evaluators can work and, and not

  56. 13:22

    work. And finally, then you will be attaching them, uh, the evaluators through the MCP, uh, to the agents, and, uh, this promises to make everything more controllable, more transparent, and also, like, dynamically, uh, self, uh, improving and self-correcting.

  57. 13:41

    So this is all, uh, the Root Signals MCP Server is, uh, is available for free. Uh, others will surely be, be appearing f- to allow all kinds of evaluating, evaluation platforms and framework to be implemented, uh, as, uh, as part of your, uh, agent stack.

  58. 13:59

    Uh, so I thank you for your interest, and, uh, uh, happy hacking.