Build an AI Support Agent with AI
The full path to a support agent you can put in front of customers — write its instructions, ground it in your docs, route and handle tickets, then evaluate and cost-control it before it goes live.
Find out whether an AI agent behaves before users do — define what correct means, build test scenarios with expected outputs, catch failures and hallucinations, then regression-test each version.
An AI agent that looks impressive in a demo is not an agent you can trust in production — the demo never tried the inputs that break it. Agents fail in ways code doesn't: they're non-deterministic, they hallucinate, and a prompt tweak that fixes one case silently breaks three others. 'It worked when I tried it' is not evaluation. Knowing whether an agent behaves means deciding what correct looks like, testing it against real scenarios with expected outputs, catching the failures and inventions, and re-running the whole set every time you change something — so improvement is measured, not hoped for.
Each step uses an existing NewPrompt tool, pre-filled by a matching resource. Open the resource to read it, or jump straight into the tool with the inputs ready.
Define what correct behavior means
Before testing anything, decide what the agent must and must not do — the behaviors that count as success, the ones that count as failure. Anchor the model in a QA mindset so evaluation is measured against criteria, not vibes.
Build test scenarios with expected outputs
Turn the criteria into concrete scenarios — the normal cases, the edge cases, the adversarial inputs — each paired with the output a correct agent should produce. A test set with expected outputs is what makes a pass or fail meaningful.
Run the eval and catch failures and hallucinations
Run the agent against the scenarios and check each result against its expected output — flagging the wrong answers, the made-up facts, and the cases where the agent should have refused but didn't. Failure analysis is the point, not a green count.
Regression-test every version
Every time you change the prompt, the tools, or the model, re-run the scenario set and diff the results against the last known-good run — so an improvement to one case can't silently regress another.
An agent you can trust because you tested it — correct behavior defined, a scenario set with expected outputs, failures and hallucinations caught, and a regression check that re-runs on every change — so you ship on evidence the agent behaves, not a demo that happened to work.
Test generation writes tests for deterministic code, where the same input always returns the same output and a pass is exact. Agent evaluation targets a non-deterministic agent: you define correct behavior, build scenarios with expected outputs, catch hallucinations and wrong refusals, then regression-test each version against the last good run.
It can run scenarios, flag mismatches against expected outputs, and surface likely hallucinations — but the criteria for what counts as correct, and the call on borderline cases, stay yours. The workflow makes evaluation systematic; it doesn't make it fully automatic.
You end with four artifacts: a written definition of correct behavior as evaluation criteria, a scenario set each paired with its expected output, a list of caught failures and hallucinations, and a regression check that diffs each version against the last known-good run. Evidence the agent behaves, not a demo.
Work the four steps in order in your own AI tool: define correct behavior with the role-prompt generator, build scenarios with expected outputs, run the agent and flag failures and hallucinations against those outputs, then regression-test on every change. NewPrompt supplies the prompts and step order; you run each one and own the pass or fail call.
You need a built AI agent to test, and a clear sense of what it must and must not do — that becomes your evaluation criteria in step one. From there you write scenarios covering normal, edge, and adversarial inputs, each with the correct output. No prior test suite is required; the workflow builds it.
A false positive usually means the expected output was too strict — the agent's answer was acceptable but didn't match your fixed string. Loosen the criteria to judge behavior, not exact wording, and re-run. You own that call: decide whether the mismatch is a real failure or an over-narrow expectation before you fail the case.
Complete build journeys that include this workflow as a stage.
The full path to a support agent you can put in front of customers — write its instructions, ground it in your docs, route and handle tickets, then evaluate and cost-control it before it goes live.
The full path to an AI document processing system — define the use case, design the intake pipeline, extract fields from unstructured documents, classify and route them, pin the output contract, evaluate accuracy, then ship it monitored.
The full path to an AI content moderation system — define the policy and label taxonomy, extract signals from user content, classify it against policy, emit structured decisions, evaluate false positives and negatives, wire enforcement and review queues, review abuse risks, then ship.
The full path to an AI research assistant — define its scope, organize the source corpus, ground responses in references, extract key facts, synthesize findings, check groundedness, then validate it for use.
The full path to an AI meeting assistant — define the use case, turn transcripts into structured notes, extract decisions and action items, classify follow-ups, write a shareable summary, evaluate accuracy, then ready it for the team.
The full path to a retrieval system that returns grounded answers — understand the corpus, chunk and ground it, extract and classify the metadata, then evaluate that retrieval actually works.
The full path to automation that survives the real world — wire the integrations and triggers, design the control API, move the data through validated stages, evaluate the AI steps, then deploy.
The full path to a support operation, not just a bot — stand up the knowledge base, route the tickets, add the AI agent, integrate your stack, close the feedback loop, evaluate, and deploy.
Turn an agent's instructions, allowed tools and business rules into scenarios you can actually run — a fixed situation, an expected behavior you can observe, and a pass or fail that two people would agree on.
Build an evaluation scorecard two people can apply to the same agent run and reach the same number — dimensions that don't measure each other, anchors you can point at, and the failures that shouldn't average out.
Cut what an AI feature costs without dumbing it down — price the prompt as it runs today, see where the tokens go, trim the waste, and re-measure to prove the saving holds at scale.
Instruct an AI agent that runs on its own without it wandering off — anchor it to a role, write the agent system prompt, then lay out the multi-step plan it works through.
Design a system prompt that holds up in production — define the role precisely, engineer the behavior and guardrails on top of it, then check it reads clearly before you ship.
Build a test suite that fails for real reasons, not green decoration — coverage across unit, integration, and edge cases, then a review for the gaps.