AI deployment, our shopper’s compliance officer requested us a query we couldn’t reply.
“How are you aware your agent isn’t hallucinating affected person signs?”
We had unit checks. We had integration checks. We had a mannequin that carried out fantastically on the demo dataset. What we didn’t have was an analysis harness that would measure hallucination charge, context faithfulness, or tool-selection accuracy in manufacturing.
That hole almost killed the undertaking. Six weeks later, we had a 12-metric analysis framework operating in opposition to each agent response, each device name, each retrieval operation. The compliance staff signed off. The agent shipped.
Throughout the 100+ enterprise AI agent deployments we’ve shipped since then, that framework has developed into the playbook beneath. Should you’re constructing manufacturing AI brokers, that is the analysis harness we want we’d had on day one.
The 12-Metric Framework at a Look
| Class | Metric | What It Measures | Important Threshold |
|---|---|---|---|
| Retrieval | Context Relevance | Are retrieved chunks related to the question? | >0.85 |
| Retrieval | Context Recall | Did we retrieve all related information accessible? | >0.90 |
| Retrieval | Context Precision | Are top-ranked chunks essentially the most related? | >0.80 |
| Retrieval | Retrieval Latency | How briskly did the retrieval full? | <200ms p95 |
| Technology | Reply Faithfulness | Does the reply match retrieved context? | >0.95 |
| Technology | Reply Relevance | Does the reply tackle the person’s query? | >0.90 |
| Technology | Hallucination Fee | How typically does the mannequin invent details? | <2% |
| Agent | Software Choice Accuracy | Did the agent decide the proper device? | >0.92 |
| Agent | Software Execution Success | Did device calls succeed? | >0.98 |
| Agent | Multi-Step Coherence | Did the agent preserve logical stream? | >0.85 |
| Manufacturing | Value per Question | Token + infra value per request | <$0.05 typical |
| Manufacturing | P99 Latency | Finish-to-end response time | <3s |
Three classes cowl the agent’s inside operations (retrieval, era, and agent conduct). The fourth class measures what manufacturing cares about (value and latency). Skip any certainly one of these classes at your individual danger.
Why Most Groups Skip Analysis (and Pay for It Later)
Throughout the initiatives we’ve audited, three patterns clarify why groups ship AI brokers with out correct analysis infrastructure.
Sample 1: “We’ll add analysis after the MVP.”
That is the commonest and most costly sample. By the point the MVP ships, the staff has constructed a UI, an API, integrations, and onboarded prospects. Now they’ve so as to add analysis infrastructure to a system that’s already in manufacturing, with customers sending unpredictable queries. The retrofit takes 4-6 weeks. The information assortment lag means they will’t catch a regression for days. By then, the belief injury is finished.
Sample 2: “Accuracy is sufficient.”
Accuracy on a held-out take a look at set is critical however not ample. A RAG agent can have 95% accuracy on benchmark questions and nonetheless hallucinate 30% of the time on actual person queries that fall exterior the benchmark distribution. Manufacturing site visitors is at all times totally different out of your eval set. With out faithfulness, hallucination charge, and tool-selection metrics, you’re flying blind.
Sample 3: “Handbook spot-checks are fantastic.”
Handbook evaluate works at 100 queries per day. It breaks at 10,000. The groups that attempt to scale guide evaluate both burn out their engineers or settle for that they’re not truly reviewing the quantity they declare to. Automated analysis isn’t elective when you cross just a few thousand queries per day.
The framework beneath addresses all three patterns. Construct it earlier than you ship, instrument each layer, and let the metrics let you know what your guide critiques can’t.
For groups constructing AI brokers for enterprise automation, the analysis harness typically determines whether or not the undertaking ships to manufacturing in any respect.
The 12-Metric Framework
The framework teams 12 metrics into 4 classes. Every class solutions a unique query about how your agent is performing.
Class 1: Retrieval Metrics (4)
In case your agent makes use of retrieval (RAG, information base lookup, doc search), retrieval high quality is the inspiration. Dangerous retrieval upstream means no quantity of intelligent prompting downstream can save the response.
1. Context Relevance
What it measures: What fraction of the retrieved chunks are literally related to the person’s question?
Why it issues: Most RAG failures we see in manufacturing hint again to retrieval fairly than era. The mannequin can solely work with what you feed it. Should you retrieve 10 chunks and solely 3 are related, you’ve polluted the context and compelled the mannequin to filter sign from noise.
How we measure it: For every question, an LLM-as-judge evaluator scores every retrieved chunk on a 0-1 relevance scale relative to the question. We common throughout the top-k retrieved chunks.
Goal threshold: >0.85 common relevance throughout top-10 chunks. Under 0.7 signifies a retrieval drawback price investigating earlier than chasing mannequin enhancements.
Manufacturing notice: Once we see context relevance drop beneath 0.75 in manufacturing, the trigger is sort of at all times certainly one of three issues: index drift (new paperwork not chunked correctly), question intent shift (customers asking totally different questions than the eval set), or chunking technique mismatch (chunks too giant or too small for the question kind).
2. Context Recall
What it measures: Did we retrieve ALL the knowledge wanted to reply the question, or did we miss related chunks?
Why it issues: Recall is the silent killer of RAG programs. Low recall means the reply is incomplete or improper, however the mannequin has no option to sign “I don’t have sufficient context.” It’ll confidently generate from partial info.
How we measure it: This requires a labeled eval set through which human evaluators have recognized all chunks containing info related to a benchmark question. We then compute the fraction of these “floor reality related” chunks that our retrieval truly returned.
Goal threshold: >0.90 recall on benchmark queries. Under 0.80 means you’re systematically lacking info, which ends up in confident-but-wrong solutions.
Manufacturing notice: Recall drops are normally a symptom of an embedding mannequin mismatch (your embedding mannequin isn’t capturing the semantics of your area) or of chunk-size points (info is break up throughout chunks in ways in which defeat similarity search). The repair is usually re-chunking, not re-modeling.
3. Context Precision
What it measures: Of the retrieved chunks, are essentially the most related ones ranked on the high?
Why it issues: Most manufacturing RAG programs move solely the highest 3-5 chunks to the LLM context window attributable to token budgets. In case your top-1 chunk is irrelevant however the related one is at place 7, you’ve successfully retrieved nothing helpful.
How we measure it: We compute Imply Reciprocal Rank (MRR) — the typical place of the primary related chunk within the ranked retrieval outcomes.
Goal threshold: MRR >0.80 — your first related chunk ought to be in place 1 or 2 more often than not.
Manufacturing notice: Precision improves dramatically if you add a reranker after the preliminary vector search. We’ve seen MRR leap from 0.55 to 0.92 by including a BGE reranker on high of pgvector retrieval. The latency value is ~50ms; the precision acquire is price it.
4. Retrieval Latency
What it measures: Time from question receipt to when retrieved chunks are prepared, measured at p95.
Why it issues: Finish-to-end agent response time is dominated by retrieval at scale. If retrieval takes 800ms, the person waits 800ms earlier than the LLM even begins pondering.
How we measure it: Customary software efficiency monitoring on the retrieval service. We log the retrieval time for each question and report p50, p95, and p99.
Goal threshold: p95 retrieval latency <200ms. p99 <500ms.
Manufacturing notice: Latency spikes normally correlate with one of many following: index measurement progress with out re-tuning HNSW parameters, community hops between the embedding service and the vector DB, or cold-start cache misses. Examine which of the three earlier than assuming you want a sooner vector DB.
Class 2: Technology Metrics (3)
As soon as the proper context is retrieved, the standard of the era determines whether or not the person receives a helpful response. Three metrics matter right here.
5. Reply Faithfulness
What it measures: Does the generated reply precisely replicate the retrieved context, or does it contradict or fabricate info?
Why it issues: That is an important metric for any AI agent serving regulated industries. An untrue reply in healthcare, fintech, or authorized contexts is a compliance failure. Even exterior regulation, faithfulness instantly determines person belief.
How we measure it: For every generated reply, an LLM-as-judge evaluator extracts atomic claims from the reply, then checks every declare in opposition to the retrieved context. The faithfulness rating is the fraction of claims supported by the context.
Goal threshold: >0.95 faithfulness in regulated industries. >0.90 typically use instances. Something beneath 0.85 wants rapid investigation.
Manufacturing notice: Faithfulness drops normally point out certainly one of three causes: temperature settings too excessive (flip it right down to 0.0-0.3 for manufacturing), context window overflow (your retrieved chunks plus immediate exceed context limits and the mannequin hallucinates from coaching knowledge), or immediate template encouraging extrapolation (“Based mostly on the context, what do you concentrate on…”).
6. Reply Relevance
What it measures: Does the generated reply truly tackle what the person requested, or does it wander off-topic?
Why it issues: Relevance is distinct from faithfulness. A solution may be 100% trustworthy to context but not tackle the person’s precise query. Each metrics have to be excessive concurrently for an excellent response.
How we measure it: LLM-as-judge evaluator generates 3-5 questions that the reply can be an excellent response to, then computes semantic similarity between these generated questions and the unique person question.
Goal threshold: >0.90 relevance. Under 0.80, the agent is answering adjoining questions, not the person’s query.
Manufacturing notice: Relevance points typically hint again to question rewriting steps in agentic flows. In case your agent rewrites “How do I cancel my subscription?” into “What’s the cancellation coverage?” after which solutions the rewritten question, the unique intent will get misplaced.
7. Hallucination Fee
What it measures: How typically does the mannequin generate details, names, numbers, or claims that haven’t any foundation within the retrieved context or in verifiable actuality?
Why it issues: Hallucination charge is the metric your CTO will ask about. Faithfulness measures constancy to context; hallucination charge measures fabrication past context. They overlap however aren’t an identical — a mannequin may be trustworthy to dangerous context, or untrue in benign methods.
How we measure it: We pattern 5% of manufacturing queries each day and run them by way of a devoted hallucination detection pipeline that flags claims requiring fact-check, then human-reviews the flagged subset.
Goal threshold: <2% hallucination charge for manufacturing brokers. <0.5% for regulated business deployments.
Manufacturing notice: Hallucination spikes by question kind. Open-ended questions hallucinate greater than sure/no. Numeric questions hallucinate greater than categorical ones. Construct query-type classification into your eval pipeline so you may goal investigation.
Class 3: Agent-Particular Metrics (3)
In case your AI system is an agent (multi-step, tool-using, goal-directed) fairly than a easy RAG pipeline, three extra metrics matter.
8. Software Choice Accuracy
What it measures: When the agent has a alternative of instruments, does it decide the proper one for the person’s intent?
Why it issues: Fashionable brokers have entry to dozens of instruments — search, calculators, calendars, database queries, and API calls. Fallacious device choice cascades — the agent then tries to make a sq. peg match a spherical gap, producing incorrect outcomes downstream.
How we measure it: Construct a labeled eval set of (question, correct_tool) pairs. Run the agent in opposition to the queries and compute the accuracy of device choice on the first resolution level.
Goal threshold: >0.92 for binary device decisions. >0.85 for decisions amongst 5+ instruments.
Manufacturing notice: Software choice accuracy drops because the variety of accessible instruments grows. We’ve seen 95% accuracy with 3 instruments collapse to 70% with 12 instruments. The repair is normally clearer device descriptions, fewer instruments per agent (decompose into specialised sub-agents), or fine-tuning on tool-use traces from manufacturing.
9. Software Execution Success
What it measures: Of the device calls the agent makes, what fraction execute efficiently (appropriate arguments, legitimate responses, no errors)?
Why it issues: An agent can decide the proper device and nonetheless name it incorrectly — improper argument format, lacking required fields, malformed enter. Software execution success isolates this failure mode.
How we measure it: Monitor each device name in manufacturing with success/failure standing, error categorization, and retry makes an attempt. Compute success charge per device, per question kind, and per time window.
Goal threshold: >0.98 device execution success charge. Under 0.95 signifies systematic argument-construction issues.
Manufacturing notice: The commonest failure mode is the agent confidently setting up arguments in a format that doesn’t match the device’s precise schema (e.g., passing a date string when the API expects ISO 8601). The repair is structured-output enforcement (perform calling, JSON Schema validation) on the device boundary.
10. Multi-Step Coherence
What it measures: When the agent executes a multi-step plan, does the logical stream stay coherent throughout steps?
Why it issues: Single-step accuracy is critical however not ample for agentic conduct. An agent that picks the proper device in step 1, will get an excellent consequence, then forgets that consequence by step 4 has failed, despite the fact that each particular person step succeeded.
How we measure it: Hint-level analysis. For every multi-step hint, an LLM-as-judge evaluator scores whether or not every step builds on prior steps coherently and whether or not the ultimate output displays the total reasoning chain.
Goal threshold: >0.85 coherence on traces of 4+ steps. Under 0.75, your agent is basically doing a number of disconnected single-step queries.
Manufacturing notice: Coherence drops with hint size. We see 95%+ coherence on 2-step traces collapse to 60% on 6-step traces. The repair is both decomposition (splitting a 6-step job into 2 separate 3-step duties with an express handoff) or reminiscence structure (persistent state throughout steps fairly than re-prompting with the total historical past every time).
Class 4: Manufacturing Metrics (2)
The primary ten metrics measure what the agent does. These two metrics measure what manufacturing cares about.
11. Value per Question
What it measures: Complete value (token value + infrastructure value + device name prices) per person question, averaged throughout manufacturing site visitors.
Why it issues: AI brokers have a singular value profile — a single person question can set off 5-15 LLM calls (rewriting, retrieval grading, device choice, era, verification). Token sprawl turns a $0.02 question right into a $0.30 question with out anybody noticing till the month-to-month invoice arrives.
How we measure it: Instrument each LLM name with token utilization logging, each device name with related API prices, and each infrastructure dependency with prorated value. Mixture per question, then per question kind, then per time window.
Goal threshold: Varies by use case. Inner worker instruments: <$0.10/question is suitable. Buyer-facing merchandise: <$0.05/question for sustainable economics. In regulated industries, value issues lower than different metrics.
Manufacturing notice: Value spikes normally hint to certainly one of: immediate size progress (your system immediate grew over time), retry storms (failures triggering re-execution loops), or context window inflation (retrieved chunks getting longer as your information base grows). All three are straightforward to instrument and repair.
For groups seeing cost-per-query trending upward unsustainably, the build-vs-buy resolution typically shifts towards customized infrastructure with capped prices fairly than per-token API pricing.
12. P99 Latency
What it measures: Finish-to-end time from person question to remaining response, measured on the 99th percentile.
Why it issues: Common latency hides the failure modes that frustrate customers. A system with 1-second common latency however 15-second p99 has customers abandoning periods after 4-5 sluggish responses. P99 is what customers bear in mind.
How we measure it: Customary software efficiency monitoring. We log the end-to-end latency for each question and report p50, p95, p99, and max. We observe these per question kind as a result of conversational queries ought to be a lot sooner than analytical queries.
Goal threshold: p99 <3 seconds for conversational brokers. p99 <10 seconds for analytical brokers that carry out multi-step reasoning. Past 10 seconds, customers disengage.
Manufacturing notice: P99 latency is sort of at all times dominated by certainly one of three issues: retrieval (vector DB chilly cache), device calls (exterior API timeouts), or LLM era for lengthy outputs (hitting token-by-token streaming bottlenecks). Determine the dominant trigger earlier than optimizing the improper layer.
A Resolution Tree: Which Metrics to Prioritize First
Twelve metrics are so much to instrument concurrently. Right here’s how we sequence implementation throughout undertaking phases.
Part 1 (Pre-launch — Week 0-2): Implement retrieval metrics (context relevance, recall, precision) plus reply faithfulness. These 4 catch the commonest pre-launch failure modes.
Part 2 (Gentle launch — Week 3-6): Add hallucination charge, reply relevance, and gear choice accuracy. These catch points that solely emerge with actual person site visitors.
Part 3 (Manufacturing steady — Week 7+): Add value per question, P99 latency, device execution success, multi-step coherence, and retrieval latency. These optimize the operating system fairly than catch launch-blocking failures.
Use case modifiers:
- Regulated business (healthcare, fintech, authorized): Prioritize faithfulness and hallucination charge above all the things else. Intention for >0.97 faithfulness and <0.5% hallucination charge from day one.
- Excessive-volume shopper product: Prioritize value per question and P99 latency. Faithfulness issues however not on the expense of unit economics.
- Inner worker instruments: Prioritize device execution success and multi-step coherence. Staff forgive sluggish responses however not damaged workflows.
How This Framework Compares to Present Instruments
You don’t should construct all 12 metrics from scratch. A number of open-source and business instruments cowl subsets of this framework.
Ragas covers context relevance, recall, precision, faithfulness, and reply relevance nicely. It’s the strongest open-source start line for RAG-specific metrics. Doesn’t cowl agent-specific metrics or manufacturing well being.
TruLens covers related RAG metrics with stronger observability tooling. Higher integration with LangChain and LlamaIndex. Requires extra setup than Ragas.
DeepEval gives a broader metric library with good agent-specific help (device choice, faithfulness). Newer than Ragas, smaller group.
LangSmith gives manufacturing monitoring and analysis for LangChain-based brokers. Robust on traces and observability, weaker on offline benchmark analysis.
Why we constructed our personal framework on high: Not one of the present instruments cowl all 12 metrics in a single place, and the agent-specific metrics (device choice accuracy, multi-step coherence) are notably underserved. We use Ragas for RAG metrics, customized evaluators for agent metrics, and customary APM instruments (Datadog, OpenTelemetry) for manufacturing well being metrics. The framework above is the unified view throughout all three.
Implementation Actuality: What It Really Prices to Construct This
Establishing the total 12-metric framework takes 2-3 weeks of centered engineering effort, assuming you will have an LLM-judge evaluator already configured.
Time breakdown:
- Eval set building (labeled queries + floor reality): 4-6 days
- Metric implementation (Ragas or customized): 3-5 days
- CI/CD integration (run eval on each PR): 2-3 days
- Manufacturing monitoring instrumentation: 3-5 days
- Dashboards and alerting: 2-3 days
Tooling we use throughout deployments:
- Eval orchestration: Ragas + customized evaluators in Python
- LLM-as-judge: GPT-4 for high-stakes analysis, Claude Sonnet for cost-sensitive eval, Llama 3 70B for absolutely self-hosted compliance environments
- Storage: PostgreSQL for eval outcomes, S3 for uncooked traces
- Dashboards: Grafana for manufacturing metrics, Streamlit for offline eval stories
- Alerting: PagerDuty integration for threshold breaches
Frequent pitfalls we’ve watched groups hit:
- Utilizing the identical mannequin for era and judging. This produces inflated scores. Use a unique mannequin household for the decide than for the generator.
- Skipping the labeled eval set. With out floor reality labels, you may’t compute recall or measure regression. The labeling value is actual however pays again throughout the first month.
- Operating eval solely on success instances. You want failure instances in your eval set, otherwise you’ll by no means catch regressions. Pattern manufacturing failures aggressively.
- Treating eval scores as absolute. Monitor developments and deltas, not absolute scores. A 0.85 rating that drops to 0.78 over every week is extra significant than absolutely the quantity.
Often Requested Questions
What Is the Minimal Eval Setup for a New AI Agent Venture?
For a brand new undertaking, implement context relevance, reply faithfulness, and gear choice accuracy. These three catch 70% of pre-launch failures with minimal setup overhead. Skip the manufacturing metrics till you will have precise manufacturing site visitors.
How Typically Ought to We Run the Full Eval Suite?
Run offline eval (in opposition to labeled benchmark set) on each code change that impacts retrieval, prompts, or agent logic. Run on-line eval (sampled manufacturing site visitors) repeatedly, with each day rollup stories. Full benchmark re-runs are costly however ought to occur at the very least weekly to catch regressions.
Ought to We Use LLM-as-Choose or Human Analysis?
Each are sequenced. Use LLM-as-judge for scale (consider 100% of manufacturing site visitors at low value), use human analysis for calibration (consider a 1-2% pattern to confirm the LLM decide agrees with human consensus). When the LLM decide and human analysis diverge, retrain the decide immediate.
What Is the Distinction Between Offline and On-line Analysis?
Offline analysis runs in opposition to a labeled benchmark dataset with recognized appropriate solutions. On-line analysis runs in opposition to actual manufacturing site visitors, the place you don’t know the bottom reality reply upfront, so that you measure proxy alerts (faithfulness, relevance, hallucination) fairly than accuracy. Each are crucial. Offline catches regressions earlier than they ship. On-line catches points that emerge from actual person conduct.
How Do We Deal with Analysis for Non-Deterministic Brokers?
Run every analysis question 3-5 instances and report the imply and variance of scores. Excessive variance signifies the agent’s conduct is unstable, which is itself a sign price investigating. For manufacturing site visitors, pattern sufficiently to beat the noise from variance.
What Metrics Matter Most for RAG Versus Agentic Methods?
Pure RAG programs: prioritize the 4 retrieval metrics plus faithfulness. Agentic programs: add device choice accuracy, device execution success, and multi-step coherence on high of the RAG metrics. The manufacturing metrics (value, latency) matter equally for each.
How Do We Measure Consumer Satisfaction in Eval?
Consumer satisfaction is downstream of the 12 metrics above. In case your faithfulness, relevance, and latency metrics are all in goal vary, satisfaction will observe. Direct satisfaction alerts (thumbs-up/down, follow-up questions, session abandonment) are helpful as manufacturing well being indicators however lag behind the metrics that trigger them.
What Is the Eval Value — Is It Price It?
LLM-as-judge analysis prices roughly 30-50% of your inference value (each manufacturing question additionally will get evaluated by an LLM). For a $4K/month inference funds, count on $1,200-$2,000/month in eval prices. The ROI is stopping a single manufacturing incident that might value engineer-weeks to debug or trust-damage to get well from. After the primary prevented incident, eval pays for itself indefinitely.
Closing Thought
The groups transport AI brokers efficiently in 2026 aren’t those with one of the best fashions. They’re those with one of the best analysis infrastructure. Fashions are commodities. Analysis is differentiation.
Should you’re constructing manufacturing AI brokers and need a second opinion in your analysis framework grounded in 100+ deployments, the Intuz staff is glad to assist.
Assets
Pratik Okay Rupareliya is the Co-Founder and Head of Technique at Intuz, the place he leads enterprise AI technique throughout 100+ deployments spanning healthcare, fintech, manufacturing, and retail. Join with him on LinkedIn.





