Lesson 2 of 4 Evaluating and Improving Multi-Agent Solutions

Evaluating Memory, Knowledge, Tools and Prompts Separately

This lesson describes how component evaluations isolate the tools, knowledge, memory and prompts that agents depend on, since an end-to-end score tells whether a multi-agent solution works but not why it fails.

Learning outcomes

After completing this lesson, you will be able to:

  • Evaluate tool use with Foundry's agent evaluators.
  • Separate retrieval quality from generation quality.
  • Evaluate memory with scripted multi-session tests and compare prompt versions on the same dataset.
  • Locate the component behind a drop in an end-to-end score.

Evaluating tools and agent behaviour

Foundry's agent evaluators score agent conversations, including tool definitions and calls. Intent resolution checks whether the agent understood the request; task adherence checks whether it followed its instructions and constraints; task completion checks whether it achieved the goal. Tool-focused evaluators include tool call accuracy, tool selection (right tools chosen), tool input accuracy (arguments correct in type, format and grounding), tool output utilization (results used correctly) and tool call success. Some evaluators support only function tools, not every built-in tool.

from azure.ai.evaluation import (AzureOpenAIModelConfiguration, IntentResolutionEvaluator,
                                 TaskAdherenceEvaluator, ToolCallAccuracyEvaluator, evaluate)

judge = AzureOpenAIModelConfiguration(azure_endpoint=AOAI_ENDPOINT, azure_deployment="judge-model")
result = evaluate(
    data="agent_runs.jsonl",                      # query, response, tool_definitions and tool_calls per line
    evaluators={"intent": IntentResolutionEvaluator(model_config=judge),
                "adherence": TaskAdherenceEvaluator(model_config=judge),
                "tools": ToolCallAccuracyEvaluator(model_config=judge)},
    azure_ai_project=PROJECT_ENDPOINT,            # results appear in the Foundry portal
)
Match the pairs

Agent evaluators

Exam skills 3.1.2

Match each Foundry agent evaluator with the question it answers.

Log in to try this activity Interactive activities are free with an account.

Evaluating knowledge

Knowledge evaluation separates retrieval from generation. Retrieval metrics (recall@k, precision, NDCG, through the document retrieval evaluator with relevance labels) show whether the right passages were found. Groundedness checks that the response is supported by the retrieved context; relevance checks that it addresses the question; response completeness checks it against a reference answer. Low groundedness with good retrieval points to the prompt or model; poor retrieval points to chunking, embeddings or query design.

Scenario questions

Locating knowledge failures

Exam skills 3.1.2

Use knowledge evaluation results to find the failing component.

Log in to try this activity Interactive activities are free with an account.

Evaluating memory and prompts

No single built-in evaluator covers memory, so memory is evaluated with scripted multi-session tests. Each script establishes facts in one session and checks in a later session that the agent recalls them, applies preferences correctly, does not surface another user's memories, does not use facts that were corrected or deleted, and handles contradictions. Results are scored by assertions or by an LLM judge with a rubric.

Prompt evaluation compares prompt or agent versions on the same dataset with the same evaluators and judge, so that differences come from the prompt. A change is accepted only when the target metric improves and no other metric regresses beyond tolerance. The following table summarizes the component evaluations.

ComponentEvaluation approachTypical evaluators or checks
ToolsAgent conversations with tool callsTool call accuracy, selection, input accuracy, output utilization
KnowledgeLabelled queries and grounded answersRetrieval metrics, groundedness, relevance, completeness
MemoryScripted multi-session conversationsRecall, correct application, isolation, deletion
PromptsSide-by-side versions on one datasetTarget metric up, no regressions
Select all that apply

Memory test assertions

Exam skills 3.1.2

Pick the checks a scripted multi-session memory test should include.

Log in to try this activity Interactive activities are free with an account.
Worked example

Locating a failure

A travel agent's task completion score dropped from 0.86 to 0.71 after a release that changed the booking tool's schema and the agent's instructions. Groundedness and intent resolution are unchanged.

Unchanged intent resolution means the agent still understands requests, so the drop is in execution. Running the tool input accuracy and tool call success evaluators will show whether the agent sends arguments that no longer match the new schema. If tool scores are fine, comparing the old and new instructions on the same dataset isolates the prompt change.

Check yourself

How is memory evaluated?

Show answer

With scripted multi-session tests, including checks that memory stays isolated between users and is deleted when required.

Exam Tips

Remember for the exam

  • Agent evaluators: intent resolution, task adherence, task completion and tool evaluators.
  • Separate retrieval metrics from groundedness to locate knowledge failures.
  • Memory needs scripted multi-session tests, including isolation and deletion.