Thursday, July 23, 2026

Evaluating AI Brokers: A manufacturing blueprint with Strands and AgentCore


This put up was co-written with Motorway and the AWS Prototyping and AI Buyer Engineering (PACE) workforce.


Motorway, a UK-based on-line automotive market, runs a day by day public sale the place as much as 8,000 sellers bid on as much as 2,500 autos. Motorway labored with AWS Prototyping and AI Buyer Engineering (PACE) to construct an AI-powered seller inventory search agent that transforms how sellers discover autos, changing hours of handbook filtering with pure language queries.

The problem

The agent provides a confident-sounding response, however how do you show it really works reliably with actual cash on the road?

  • Software choice errors trigger fallacious search outcomes, eroding seller belief.
  • Semantic search misinterpretations return irrelevant outcomes. A question like “Petrol, Hybrid and electrical automobiles as much as 5 years previous” requires the agent to appropriately parse a number of constraints.
  • Context drift in multi-turn conversations loses seller refinements.
  • Non-deterministic outputs make single-trial testing unreliable.

The answer

Collectively, Motorway and AWS constructed an end-to-end analysis pipeline that diminished incorrect outcomes from 1 in 8 queries to 1 in 50 and lower situation detection time from few hours to jiffy.

The pipeline combines the Strands Brokers SDK with Amazon Bedrock AgentCore, a completely managed service for deploying and working AI brokers at scale. On this put up, you’ll learn to construct this pipeline to your personal brokers:

  • A two-phase analysis technique spanning build-time testing with strands-agents-evals (the open supply analysis library for Strands Brokers) and manufacturing monitoring with Amazon Bedrock AgentCore Evaluations.
  • A 3-layer framework for assessing software utilization, reasoning, and output high quality.
  • A five-stage deployment pipeline with high quality gates that block releases when metrics fall under thresholds.

A companion repository offers a deployable blueprint that you could adapt to your personal brokers. Though the blueprint makes use of AWS companies, the core rules are important and system-agnostic necessities for any production-ready AI agent. These rules embrace the three-layer analysis framework and using the move^okay metric for consistency.

Stipulations

It’s essential to have the next stipulations to comply with together with this put up.

Time to finish: 30–45 minutes for preliminary deployment and a pair of–3 hours to customise to your area.

Estimated prices: Operating the pattern analysis suite prices roughly $5–10 in Amazon Bedrock inference expenses. Manufacturing monitoring prices differ based mostly on sampling fee.

Safety observe: The companion repository implements least-privilege AWS Id and Entry Administration (IAM) roles, shops API keys in AWS Techniques Supervisor Parameter Retailer (not setting variables), and makes use of typed parameters to assist forestall injection assaults. See the repository README for particulars.

The labored instance: A seller inventory search agent

Motorway constructed the seller inventory search agent on the Strands Brokers SDK and Amazon Bedrock AgentCore. The agent exposes eight instruments that mix structured filtering throughout over 89 automobile attributes with vector similarity search powered by LanceDB and Amazon Titan Textual content Embeddings V2.

Sellers usually spent hours looking via listings utilizing CSVs and inflexible filters. By introducing a conversational AI agent, sellers can now speak to the agent: “Discover me diesel SUVs beneath 25k close to my dealership” or “one thing sporty and computerized for a household.”

With round 1,500 concurrent customers throughout peak hours, getting agent habits proper isn’t elective. A software choice error or semantic search misinterpretation instantly impacts person belief. Determine 1 exhibits the end-to-end request circulate: sellers submit pure language queries via an internet interface, which routes to Amazon Bedrock AgentCore Runtime. The runtime orchestrates calls to eight totally different instruments whereas utilizing Amazon Bedrock fashions (Claude for reasoning, Amazon Titan for embeddings). Software responses circulate again via the runtime to generate the ultimate dealer-facing outcomes.

Why agent analysis is totally different

Massive language mannequin (LLM) analysis focuses on textual content technology high quality: coherence, factual accuracy, response relevance. Agent analysis assesses one thing essentially totally different. Consider it this fashion: LLM analysis examines engine efficiency. Agent analysis assesses how the entire automotive drives in site visitors, in rain, or with a backseat filled with passengers.

Conventional LLM metrics don’t let you know whether or not the Motorway agent known as the fitting search software for “Grade 1 Suzuki fashions.” They don’t reveal if the agent handed right filter parameters to LanceDB. And so they miss whether or not a seller refining outcomes from a earlier flip will get the fitting response.

Analysis dimension Why it issues for brokers
Activity completion Brokers run multi-step workflows the place partial completion is widespread
Software use correctness Improper instruments or unhealthy parameters can derail total workflows
Reasoning coherence Flawed reasoning results in unpredictable failures as situations change
Reliability and consistency Non-determinism means the identical enter can produce totally different outcomes
Security and compliance Autonomous brokers can take actions with real-world penalties
Price and effectivity An agent requiring 50 API calls per process is probably not economically viable

A exact question like “Volkswagen Golf 7-12 years previous” may work completely, however a colloquial variant like “I’m in search of an older VW” may fail if the semantic search layer isn’t correctly evaluated.

Catch points earlier than deployment with strands-agents-evals

The blueprint implements analysis throughout two phases that map to the GenAIOps lifecycle. Construct-time analysis catches points earlier than deployment, and manufacturing analysis catches what artificial assessments miss. The next diagram (Determine 2) exhibits how the software utilization, reasoning, and output high quality layers should move earlier than deployment. The framework evaluates brokers throughout three layers:

  • Layer 1 (Software Utilization) validates right software choice and parameter passing with a better than 95 % threshold.
  • Layer 2 (Reasoning) assesses logical decision-making with a better than 85 % threshold.
  • Layer 3 (Output High quality) measures response helpfulness and accuracy with a better than 90 % threshold. All three layers should move earlier than deployment proceeds.

Figure 2: Three-layer evaluation framework with Layer 1 tool usage at greater than 95% threshold, Layer 2 reasoning at greater than 85% threshold, and Layer 3 output quality at greater than 90% threshold

Throughout growth and steady integration and steady deployment (CI/CD), the pipeline makes use of the strands-agents-evals framework to catch points earlier than deployment. It offers output validation, trajectory analysis, multi-turn dialog simulation, and automatic experiment technology. Every is designed to work natively with brokers constructed on the Strands Brokers SDK. The framework offers three primitives:

  • Experiment: A group of check instances run in opposition to the agent.
  • Case: Enter question, anticipated output, and anticipated software trajectory.
  • Evaluator: Scoring logic (deterministic or LLM-based).

Construction your assessments into layers. Layer 1 runs deterministic code-based graders for software choice accuracy. Layers 2 and three use LLM-as-judge evaluators (utilizing an LLM to attain agent outputs) for reasoning and output high quality.

Customized Evaluator subclasses deal with domain-specific issues. For the Motorway agent, these cowl knowledge freshness, seller scoping, and security guardrails. Your agent may have its personal area constraints.

Three sorts of graders

The analysis framework makes use of three grader sorts, every suited to totally different analysis wants.

Grader sort Layer What it measures Commerce-off
Code-based deterministic Layer 1 Software choice, parameter passing, trajectory ordering Quick, low-cost, reproducible
LLM-as-judge (Claude Sonnet 4.6) Layers 2–3 Reasoning high quality, output helpfulness, objective success Versatile; non-deterministic (managed through move^okay)
Human evaluate Calibration Edge instances and security Costly; used to calibrate LLM decide prompts

In follow, grading what the agent produced catches extra points than grading the trail it took. You care that the person acquired related outcomes, not which software the agent known as first.

Three-layer evaluation framework

Construct-time analysis operates throughout three distinct layers, every with particular move/fail thresholds.

Layer 1: Software Utilization (> 95 % threshold). Did the agent name the fitting instruments with right parameters?

  • “Diesel autos from £7,000 to £20,000” ought to use search_vehicles with typed filters

    (fuel_type=diesel, min_price=7000, max_price=20000).
  • “Fashionable hatchback with low mileage” ought to set off hybrid_search, combining semantic embeddings with structured filters.

You measure this deterministically: ToolSelectionGrader checks which instruments have been known as, TrajectoryOrderGrader verifies the decision sequence.

Layer 2: Reasoning (> 85 % threshold). Was the decision-making course of logical? The HelpfulnessEvaluator and TrajectoryEvaluator from strands-agents-evals use LLM-as-judge scoring to evaluate whether or not the agent’s reasoning holds collectively. An agent that arrives on the proper response via illogical reasoning will fail unpredictably as situations change.

Layer 3: Output High quality (> 90 % threshold). Was the response useful, correct, and actionable? The OutputEvaluator and GoalSuccessRateEvaluator from strands-agents-evals use LLM-as-judge analysis to evaluate whether or not the person acquired a helpful, well-formatted response.

The three layers should move earlier than deployment. A failure in a layer blocks the pipeline.

Dealing with non-determinism

As a result of LLM outputs differ between runs, single-trial outcomes could be deceptive. The run_all_layers() perform within the companion repository accepts a num_trials parameter to deal with this. Two metrics from the code technology analysis neighborhood assist measure reliability:

  • move@okay measures the probability of succeeding at the least as soon as in okay makes an attempt. This metric is helpful when discovering one right resolution is ample.
  • move^okay (move to the facility of okay) measures the chance of succeeding in okay consecutive trials. This metric is helpful when customers count on dependable habits each time.

For customer-facing brokers, move^okay issues most. An agent with a 75 % per-trial success fee has solely a 42 % probability of passing three consecutive trials (0.75³). Customers count on constant high quality on each interplay.

Within the companion code, run_all_layers(task_fn, registry, num_trials=5) runs the analysis layers with multi-trial assist and gates deployment on move^okay. See the full implementation.

Take a look at case administration

Take a look at instances are organized by class:

  • Joyful path: Frequent queries that ought to succeed.
  • Edge instances: Ambiguous queries, slang, multi-turn refinements.
  • Security/Guardrails: Queries the agent ought to refuse or redirect.

When manufacturing monitoring detects a problem, that interplay turns into a brand new check case. Motorway’s suite grew from an preliminary 50 instances to 150 in three months, every grounded in actual person habits. Begin with 20 to 50 instances and let manufacturing knowledge develop the suite.

Embody adverse instances the place the agent ought to not name sure instruments. For instance, a profile question ought to name the profile software, not the search software. A structured question ought to use structured search, not a uncooked SQL fallback. One-sided evals create one-sided optimization.

Multi-turn dialog testing

Single-turn analysis misses a vital dimension: conversational coherence. Sellers naturally refine searches throughout a number of turns:

  • Flip 1: “Discover me diesel SUVs.”
  • Flip 2: “Now present me solely the automatics.”
  • Flip 3: “What about estates as a substitute?”

The strands-agents-evals framework offers ActorSimulator to generate real looking multi-turn interactions and InteractionsEvaluator to attain context retention throughout turns. Multi-turn assessments catch context drift, filter accumulation errors, and pronoun decision failures that single-turn assessments miss.

Monitor manufacturing habits with AgentCore Evaluations

After you deploy your Strands Agent to Amazon Bedrock AgentCore Runtime, AgentCore Evaluations offers steady monitoring. It integrates with Strands Brokers via OpenTelemetry instrumentation (the industry-standard observability framework). Determine 3 illustrates the structure in manufacturing, with observability traces sampled at 1–5 % and with metrics aggregating to Amazon CloudWatch.

Figure 3: Production evaluation architecture with AgentCore Runtime, sampled OpenTelemetry traces feeding AgentCore Evaluations, and metrics on CloudWatch with Amazon SNS alerts

Two monitoring approaches

AgentCore Evaluations provides two complementary modes:

On-demand analysis analyzes particular agent interactions by choosing spans from Amazon CloudWatch logs. That is helpful for debugging points or validating fixes.

On-line analysis robotically samples stay site visitors and applies evaluators within the background. Configure a sampling fee (1–5 % is really helpful), choose as much as 10 evaluators, and let it run.

Constructed-in and customized evaluators

AgentCore offers pre-configured evaluators for widespread eventualities. The next desk exhibits the built-in evaluators and what they measure.

Evaluator Stage What it measures
Builtin.Helpfulness TRACE How useful the agent’s response is (0–1 rating throughout 7 ranges)
Builtin.GoalSuccessRate SESSION Whether or not the person’s total objective was achieved
Builtin.ToolSelection TOOL_CALL Whether or not the agent chosen acceptable instruments
Builtin.Correctness TRACE Factual accuracy of the response

For domain-specific necessities, you possibly can create customized evaluators utilizing an LLM-as-a-judge configuration. Each agent has area constraints that inbuilt evaluators don’t cowl, together with knowledge freshness, entry scoping, forbidden actions, latency budgets, and value limits.

The companion repository consists of 5 customized Evaluator subclasses you possibly can adapt:

Evaluator What it validates
DataFreshnessEvaluator Validates auction-cycle timestamps so the agent doesn’t floor stale stock
SafetyGuardrailEvaluator Blocks the agent from making an attempt automated bidding actions
DealerDataScopingEvaluator Enforces dealer-scoped queries for knowledge isolation

See the companion repository for LatencyEvaluator and CostEvaluator examples.

Key metrics to trace

The companion repository consists of an AWS CDK stack that provisions CloudWatch dashboards and alarms. Observe these metrics to watch agent well being.

Metric Goal Alert threshold
Activity completion fee >95% <80%
Software choice accuracy >95% <90%
Helpfulness rating (0-1) >0.83 <0.58
Response latency P50 / P99 <2s / <10s >5s / >15s
Hallucination fee <2% >5%
Price per interplay Monitor development >2x baseline

Make high quality checks a deployment gate

Analysis must be a high quality gate in your deployment pipeline, not an afterthought. Determine 4 exhibits the deployment pipeline with analysis gates, spanning build-time analysis, staging validation, shadow mode, A/B testing, and manufacturing rollout, with failures blocking deployment.

Figure 4: Five-stage deployment pipeline covering build-time evaluation, staging validation, shadow mode, A/B testing, and production rollout, with failures blocking deployment and feeding new test cases

The deployment pipeline follows 5 phases:

  1. Construct-time analysis: Unit assessments, software correctness (ToolSelectionGrader >95 %), trajectory assessments, and LLM-as-judge scoring (HelpfulnessEvaluator >85 %).
  2. Staging validation: On-demand AgentCore analysis with artificial site visitors in opposition to staging knowledge.
  3. Shadow mode: Actual manufacturing site visitors processed in parallel with out person impression. Run this for at the least 4 hours with a 2 % deviation threshold.
  4. A/B testing: 5 % of stay site visitors routes to the candidate agent for actual end result measurement.
  5. Manufacturing rollout: one hundred pc site visitors with steady on-line analysis and monitoring.

You outline thresholds for every section: software choice accuracy under 95 % or process completion under 80 % blocks deployment. For main releases, multi-trial analysis with num_trials=5 gates on move^okay to catch non-deterministic failures.

Shadow mode

Between staging and manufacturing, run the candidate agent in opposition to actual queries with out affecting customers. Shadow mode receives a duplicate of manufacturing site visitors, processes it via the candidate in parallel, and compares outcomes. Run shadow mode for at the least 4 hours earlier than continuing to A/B testing. Outline a deviation threshold (2 % is an efficient place to begin) that pauses deployment robotically.

Shadow mode catches points that the opposite levels miss:

  • Timeout dealing with beneath concurrent load.
  • Area terminology lacking from artificial assessments.
  • Software name ordering that causes latency spikes beneath actual site visitors patterns.

Getting began: A phased strategy

Part 1: Construct your check suite. Begin with 20–50 check instances drawn from actual person queries. Embody optimistic and adverse instances. Take a look at what the agent ought to do and what it ought to refuse.

Part 2: Configure build-time analysis. Match grader sorts to what you’re measuring: deterministic for software choice, LLM-as-judge for reasoning and output high quality.

Part 3: Allow manufacturing monitoring. Configure AgentCore Evaluations with a 1–5 % sampling fee. Begin low, then enhance when you’ve confirmed evaluator prices are acceptable.

Part 4: Shut the suggestions loop. Flip manufacturing failures into check instances. When failures turn out to be regression assessments, this suggestions loop has constantly improved analysis high quality throughout groups.

Outcomes and impression

Earlier than implementing this analysis pipeline, the agent had an 87% software choice accuracy- which meant 1 in 8 seller queries returned fallacious outcomes. The workforce was seeing 12 manufacturing incidents per thirty days, and it took a mean of 4 hours to detect points after they began affecting sellers.

After implementing the pipeline:

Metric Earlier than After
Software choice accuracy 87% 98%
Activity completion fee 82% 96%
Context retention (multi-turn) 71% 94%
Manufacturing incidents (month-to-month) 12 2
Imply time to detect points few hours jiffy

The enterprise impression: sellers now full automobile searches in minutes as a substitute of few hours, with confidence that outcomes are correct and present.

Troubleshooting

See the companion repository README for options to widespread points together with trajectory grader failures, LLM-as-judge variance, empty analysis outcomes, and value threshold tuning.

Key takeaways

Maintain these rules in thoughts when constructing your analysis pipeline.

  • Layer your analysis: Software utilization (>95 %), reasoning (>85 %), and output high quality (>90 %) catch totally different failure modes.
  • Gate on move^okay, not single trials: A 75 % per-trial success fee means solely 42 % reliability throughout three consecutive runs.
  • Flip manufacturing failures into check instances: Let actual person habits develop your analysis suite.
  • Shadow mode catches what artificial assessments miss: Actual site visitors reveals timeout dealing with, uncommon terminology, and latency patterns.
  • Begin monitoring at 1 % sampling: Scale regularly to handle evaluator prices.

Conclusion

You’ve now seen construct an analysis pipeline for manufacturing AI brokers on AWS, utilizing Motorway’s seller inventory search agent as a labored instance.

The core lesson: a fluent response doesn’t imply the agent did the fitting factor. It’s essential to confirm software choice, parameter correctness, reasoning coherence, and consistency throughout repeated runs. By combining build-time testing with strands-agents-evals and manufacturing monitoring with AgentCore Evaluations, you possibly can deploy brokers with proof that they work as designed.

These patterns apply to most multi-tool, customer-facing brokers: whether or not you’re constructing customer support brokers that question information bases and ticketing techniques, monetary advisory brokers that pull portfolio knowledge and market feeds, or healthcare triage brokers that entry affected person data and scheduling instruments.

To get began:

  1. Clone the companion repository:
    git clone https://github.com/aws-samples/sample-evaluating-agents-on-aws-with-strands-and-agentcore

  2. Navigate to the CDK undertaking listing:
    cd sample-evaluating-agents-on-aws-with-strands-and-agentcore/examples/vehicle-auction-agent/cdk

  3. Deploy the pattern infrastructure:

    Observe the repository README deployment steps to deploy the pattern infrastructure. After deployment completes, confirm the infrastructure by checking that each one AWS CloudFormation stacks present CREATE_COMPLETE standing within the AWS CloudFormation console. You must see the CloudWatch dashboard and Lambda features listed of their respective consoles.
  4. Run the pattern analysis suite in opposition to the included check instances to see the three-layer framework in motion. Confirm success by confirming: Layer 1 (Software Utilization) exhibits better than 95% move fee, Layer 2 (Reasoning) exhibits better than 85% move fee, and Layer 3 (Output High quality) exhibits better than 90% move fee. If a layer fails, examine the CloudWatch logs for detailed error messages.
  5. Customise the evaluators to your area. Begin with the DataFreshnessEvaluator and SafetyGuardrailEvaluator as templates.

To dive deeper, discover the Amazon Bedrock AgentCore documentation and the Strands Brokers SDK on GitHub.

Clear up sources

To keep away from incurring ongoing expenses, delete the sources created on this walkthrough:

  1. Navigate to the CDK undertaking listing:
    cd sample-evaluating-agents-on-aws-with-strands-and-agentcore/examples/vehicle-auction-agent/cdk

  2. Destroy all deployed stacks:
  3. Affirm the deletion when prompted.
  4. Confirm within the AWS Administration Console that the cleanup course of eliminated all sources, together with Lambda features, S3 buckets, DynamoDB tables, CloudWatch log teams and dashboards, EventBridge guidelines, and SNS subjects.

Be aware: S3 buckets that include objects could require handbook deletion. Export any analysis knowledge or logs that it’s good to retain earlier than operating the cleanup.

Sources


In regards to the authors

Amit Deol

Amit Deol

Amit is a Senior Prototyping Architect at AWS Prototyping and Cloud Engineering (PACE). He companions with AWS prospects to experiment with new concepts and construct production-ready options throughout generative AI, knowledge and analytics, and real-time streaming. When he’s not prototyping, you’ll discover him on lengthy walks via the woods.

Hin Yee Liu

Hin Yee Liu

Hin Yee is a Senior Prototype Engagement Supervisor at AWS. She leads buyer engagements that speed up the trail from AI prototypes to manufacturing, serving to groups undertake greatest practices for constructing and working generative AI workloads on AWS.

Ryan Cormack

Ryan Principal Engineer at Motorway and an AWS Group Builder. He leads growth of AI-powered instruments for sellers and has spoken at AWS Summit London on Motorway’s adoption of agentic AI.

Related Articles

Latest Articles