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
)Agent evaluators
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.
Locating knowledge failures
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.
| Component | Evaluation approach | Typical evaluators or checks |
|---|---|---|
| Tools | Agent conversations with tool calls | Tool call accuracy, selection, input accuracy, output utilization |
| Knowledge | Labelled queries and grounded answers | Retrieval metrics, groundedness, relevance, completeness |
| Memory | Scripted multi-session conversations | Recall, correct application, isolation, deletion |
| Prompts | Side-by-side versions on one dataset | Target metric up, no regressions |
Memory test assertions
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.
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.