Ask five teams what an AI agent is and you get five answers. A vendor calls a chatbot with a long system prompt an agent. A platform team means a planner that spawns sub-processes, calls a dozen APIs and runs for 20 minutes without a human in the loop. A product manager means anything that does things instead of answering questions. The word has stretched to cover all of it, which is a marketing success and an engineering problem. The problem is specific. You cannot evaluate what you have not defined, and a team that calls its AI system an agent but tests it like a chatbot, one prompt in and one answer scored, will ship bugs that no single-answer metric can see. Those bugs live in the sequence of decisions the AI system made, not in any one message it wrote.
This guide gives a working definition from the point of view of people who have to score these AI systems for a living. We define an AI agent by what it does at run time rather than by the framework it is built with, we lay out the parts every one of them has, we separate four levels of autonomy that are usually lumped together, and we follow the definition through to what it implies for AI evaluation and for watching the AI agent in production. The short version is that an AI agent is judged on outcomes and on the path it took to reach them, not on answers. The rest of the article explains why that is true and what it costs you if you ignore it.
What an AI agent is
An AI agent is an AI system in which a language model decides, step by step, what action to take next, takes that action through a tool, reads the result, and decides again, until it judges the task complete. Three words in that sentence carry the weight. The first is decides. In an AI agent the control flow is chosen by the model at run time, not fixed in code by the developer. The second is tool. An AI agent can affect something outside its own text, whether that is a database lookup, an email, a payment or a search. The third is until. The number of steps is not known in advance, so two runs of the same AI agent on the same request can take different paths and different amounts of time.
That definition excludes a few things people routinely call agents. A chatbot with a detailed persona and a long system prompt is not an AI agent, because its control flow is one model call and its only output is text. A retrieval-augmented generation (RAG) pipeline is not an AI agent either, even though it fetches documents before answering, because the code decides to retrieve every time and the model never chooses. A fixed sequence of prompts, where step 2 always follows step 1 and the model is called at each stage, is an LLM workflow rather than an agent, and the distinction is useful precisely because workflows are predictable and can be tested step by step. The boundary is blurry in places. A RAG system where the model decides whether to retrieve, and can retrieve again if the first passage did not help, has crossed into agent territory. The test to apply is always the same pair of questions. Who decides the next step, and can the number of steps vary?
The definition matters because each of its three properties creates something you have to measure. If the model decides the next step, you need to know whether the decision was right, which is a question about which tool was chosen and with what arguments. If the AI agent acts, you need to know whether the action was carried out correctly and whether its side effects were the intended ones. If the loop has variable length, you need to know whether it terminated, whether it looped, and how much it cost to get there. A chatbot raises none of these questions, so a team moving from a chatbot to an AI agent inherits a new class of failures along with the new capability. The later sections map each of those properties to a concrete metric.
The loop that makes it an agent
Every AI agent, whatever framework built it, runs the same cycle. The runtime code hands the model a goal and some context, the model produces either a final answer or a request to call a tool, the runtime executes the tool and appends the result to the context, and the model is called again. The steps in one iteration are:
Receive the goal and the current context, which includes the instructions, the user's message, and everything that happened in earlier iterations.
Reason about the next step and produce either a tool call with arguments or a final response.
Act, meaning the runtime executes the tool call and captures its output or its error.
Observe, meaning the tool output is appended to the context so the model can read it on the next iteration.
Decide whether the task is complete, and either stop or return to step 1.
A concrete example makes the shape visible. A support AI agent receives the message "I want a refund for the damaged order that arrived yesterday, order 12345". On the first iteration the model calls a tool that looks up the order and passes the order number as the argument. The tool returns the order record, including the delivery date and the items. On the second iteration the model calls a tool that checks refund eligibility against the company's policy and the returned record. The tool reports that the order qualifies. On the third iteration the model calls the tool that issues the refund. On the fourth it writes a confirmation to the user and stops. That is 4 model calls and 3 tool calls for a request a chatbot would have answered with one fluent paragraph and no actual refund.
Each of those iterations is a place to go wrong, and the failures compound. If the model passes the wrong order number in step 1, every later step operates on the wrong order while looking perfectly reasonable. If it skips the eligibility check and issues the refund directly, the order of operations is wrong even though every individual call was valid. If the eligibility tool returns an error and the model calls it again with the same arguments, and again, the AI agent is stuck in a loop that burns tokens until some limit stops it. Because the observation from each step becomes part of the context for the next, a bad observation early poisons the reasoning that follows. This is the structural reason an AI agent cannot be evaluated one message at a time. The final confirmation message is the least informative part of the whole transcript.
The parts of an AI agent
The model is the language model itself, the component that reads the context and produces the next tool call or the final response. It is the only part of the AI agent that reasons, and it is the only part you do not control directly. You choose which model to use and you shape its behaviour through everything else in this section, but you cannot patch its judgement the way you patch a function. This is why the rest of the AI system exists. In this article, and across EvaliQA, "model" refers only to the LLM, and "AI system" refers to the whole thing the customer ships and evaluates.
The instructions are the system prompt and any policy text the model sees on every iteration. They define the role the AI agent plays, the rules it must follow, the tools it may use and the conditions under which it should stop or hand off to a human. Instructions are code in the sense that a change to them changes behaviour everywhere, but they are not code in the sense that nothing checks them for consistency. A rule that says "always verify the order before issuing a refund" is only as good as the model's willingness to follow it under pressure from an impatient user, which is exactly the kind of thing you have to test rather than assume.
The tools are the functions the AI agent can call, each with a name, a description and a schema for its arguments. The model never sees the implementation, only the name and description, so the quality of those descriptions decides tool selection more than anything else. Two tools with similar names and vague descriptions will be confused with each other, and the confusion shows up as a wrong tool call rather than as an error. Tools are also where the AI agent touches the world, which means they are where mistakes become expensive. A chatbot that hallucinates produces a wrong sentence. An AI agent that hallucinates an argument produces a wrong refund.
Memory comes in two layers. Within a conversation the context window is the memory, and everything the user said and every tool result lives there until the window fills or the runtime trims it. Across conversations, memory is whatever external state the runtime chooses to load, such as a customer record or a summary of past sessions. Memory failures are quiet. The AI agent does not report that it has forgotten the order number from turn 1; it simply asks for it again in turn 5, or worse, uses a different one.
The runtime is the code around the loop. It calls the model, parses its output, executes tool calls, appends results, enforces a maximum number of steps, handles errors and decides what the user finally sees. In a multi-agent system the runtime also routes work between a planner and its executors or between a supervisor and its sub-agents. Frameworks such as LangChain, CrewAI, AutoGen, LlamaIndex and the Claude Agent SDK are runtimes with opinions, and they are useful, but the runtime is the part of the AI agent that is ordinary software. It can be unit tested, it can have hard limits, and when evaluation shows a failure, the first question to ask is whether the runtime or the model made the mistake.
Four levels of autonomy
Most confusion about the term disappears once you separate levels of autonomy that the word "agent" lumps together. The levels differ in who decides the next step, whether the AI system can act outside its own text, and whether the number of steps is fixed. Those three differences decide how each level fails and therefore how you have to score it.
Level | Who decides the next step | Acts outside its text | Number of steps | Typical failure | Unit of evaluation |
|---|---|---|---|---|---|
Chatbot | Nobody, one model call | No | Always 1 | Wrong or ungrounded answer | One response |
RAG assistant | The code, retrieval always runs | Reads only | Fixed | Bad retrieval becomes a bad answer | One response plus its context |
Tool-using AI agent | The model, each iteration | Yes | Variable | Wrong tool, wrong arguments, loop, task not completed | The whole conversation and its tool calls |
Multi-agent system | A planner model, then executor models | Yes, in parallel | Variable and nested | Good steps, wrong plan | The session across all sub-agents |
A chatbot and a RAG assistant can be evaluated on a single response, which is why metrics such as Answer Relevancy and Faithfulness exist and work well there. The RAG assistant adds the retrieved context as a thing to score, so you get metrics on the context too, but the shape of the evaluation is unchanged. One input, one output, one score per row.
The tool-using AI agent is the first level where that shape breaks. The row is no longer an input and an output; it is a conversation with a list of tool calls attached, and the question is whether the task got done and whether the path was sane. The multi-agent system pushes the same shift one level further. A planner decomposes the user's request and hands steps to executors, so one user request becomes several agent invocations, and a failure can sit in the plan while every executor did its own step correctly. Scoring an executor's output in isolation tells you nothing about whether the plan should have included that step.
The framework does not decide which level you are at; the configuration does. A LangChain application can be a RAG assistant or a tool-using AI agent depending on whether the model is allowed to choose when to retrieve. A Claude Agent SDK application with a single tool and a one-step limit is closer to a chatbot than to a multi-agent system. When someone tells you their AI system is an agent, the useful follow-up is to ask which row of the table it sits in, because that answer tells you what to test.
Where AI agents fail
The failures that matter in an AI agent are mostly invisible in its final message. Consider the refund example again, but suppose the model skips the tool that issues the refund and writes "Your refund has been issued and you will see it in 3 to 5 business days." The sentence is relevant, polite, on brand and false. A metric that reads the final response and judges it against the user's question passes it. Only the list of tool calls reveals that nothing happened. This is the general pattern. An AI agent's text is a report about its actions, and the report can be wrong in ways the text alone cannot show.
Tool failures come in two families. The first is choosing the wrong tool or passing wrong arguments, such as looking up the wrong order or searching the knowledge base when the task required a database query. The second is using the right tool badly. EvaliQA's Tools Error metric names six categories of the second kind, a parameter error, an invalid function, a sequence error, a result that was ignored, a repeated failure, and poor error handling. The sequence error is the one that catches an email confirmation sent before the payment went through. The ignored result is the one that catches an AI agent that called the eligibility tool, got "not eligible" back, and issued the refund anyway. Neither family is detectable from the response text.
Conversation failures are the second large group. An AI agent that is told the order number in turn 1 and the product in turn 3 may have lost the order number by turn 5, and the only symptom is that it asks again or contradicts itself. An AI agent with an assigned persona can break character halfway through a long exchange, which for a branded support voice is a serious bug rather than a style issue. An AI agent facing a tool that keeps failing may call it repeatedly without changing anything, and the transcript grows without progressing. An AI agent asked something it cannot know may invent a confident answer instead of saying so, which in medical, legal or financial contexts is worse than the honest "I do not know".
The last failure is the most instructive. An AI agent can complete its own checklist while the user leaves without what they came for. The refund flow runs to the end, every step passes, and the user still does not know when the money arrives or whether they need to return the item. EvaliQA separates these as Task Success Rate, which scores whether the AI agent did its job, and Goal Achievement, which scores whether the user got what they wanted, and the docs note that the two often disagree in interesting ways. A chatbot has no such gap, because a chatbot has no task beyond answering. An AI agent has both, and you need to measure both.
Why evaluating an AI agent is different
The first shift is the unit of evaluation. For a chatbot a dataset row is an input and an expected output. For an AI agent a row is one conversation, with a scenario, a persona, any initial state the AI agent needs at turn 1, an expected outcome and a maximum number of turns. The expected outcome is a canonical result, such as "refund issued for order 12345 and the user told the timeline", not a canonical transcript, because two correct conversations can take different paths. Metrics in EvaliQA's Agent category read a turns column holding the full transcript rather than a single input and output pair, and the multi-turn evaluation mode is where they attach.
The second shift is that someone has to play the user. In a single-turn test the input is fixed. In a conversation the user's second message depends on the AI agent's first reply, so the test needs a user side that can respond. EvaliQA offers three strategies for this. Scripted replays a pre-written sequence of user turns verbatim, which is fully deterministic and the cheapest option but cannot react if the AI agent asks a clarifying question. Simulation has an AI user play a persona and intent against your AI system, reading the whole conversation so far and ending when it has what it came for. Adaptive runs the user side on the Platform AI agent, which tracks which success criteria are met and changes tactics turn by turn, and is the most realistic and the most expensive. The user side can also be given one of 15 personas, such as Impatient, Confused or Non-native speaker, because an AI agent that passes with a cooperative user and fails with an impatient one has a real bug that a bland simulator would hide.
The third shift is that the metrics have to look at structure as well as text. Tool Correctness uses no LLM judge at all. It compares the tools the AI agent called, and their arguments, against an expected set on the row, with options to require exact matches, to check ordering, and to compare only the intent-bearing arguments when the AI agent legitimately fills in a timestamp or a request id itself. Its default threshold is 0.5 and partial matches earn partial credit. Task Success Rate, Goal Achievement, Knowledge Retention and Repetitive Pattern Detection are judged by an LLM judge over the transcript, each with a default threshold of 0.7. The combination matters. A judge cannot reliably tell you that the refund tool was never called; a structural comparison can. A structural comparison cannot tell you whether the user left satisfied; a judge can.
These methods have limits you should know before trusting the numbers. Tool Correctness needs an expected set of tool calls on each row, which means you must know the right path in advance, so it does not fit open-ended tasks where several paths are acceptable. Knowledge Retention needs conversations with several facts spread across turns, and scores trivially high on a dataset of single-fact exchanges. Repetitive Pattern Detection is noisy on conversations of 3 turns or fewer. And every multi-turn run is expensive in a way single-turn runs are not. The docs give the arithmetic: 40 conversations at 5 turns each with 2 model calls per turn is 400 model calls before any judge is counted, so three metrics is a healthy starting set rather than ten.
Watching an AI agent in production
An offline evaluation run covers the scenarios you thought to write. Production covers the ones you did not, and because an AI agent's behaviour depends on tool results and user replies you cannot fully script, the gap between the two is wider than it is for a chatbot. Watching an AI agent live therefore needs a data model that matches the loop. EvaliQA uses four levels. A span is one step, a single model call or tool call. A trace is one agent invocation, a tree of spans. A session is one user request or one conversation, several traces sharing a session identifier. A user is one end user across many sessions. The sessions and users page describes how to set the identifiers from the Python SDK or from OpenTelemetry attributes.
The session level is what makes multi-agent systems readable. A planner that spawns three executors produces four traces, and if they share a session identifier EvaliQA shows them on one gantt-style timeline in wall-clock order, so the plan and its execution read as one story. The choice of what a session means is a real design decision. For a chat product the session is the conversation, each user turn is a trace, and conversation-level metrics such as Role Adherence and Conversational Flow read every trace in order as one exchange, with analysis running 60 seconds after the last trace arrives. For a planner-executor AI agent the session is one request, because the conversation is between your own sub-agents rather than with a person.
The trace page is where the failures from the earlier section become visible. It shows the span tree with each span's type, timing, inputs and outputs, a collapsible list of the tools the trace invoked, an error banner on any span that failed, and one row per metric that scored the trace with the score, the threshold and the judge's reasoning. The refund that was announced but never issued shows up here as a confirmation message with no refund tool in the list. Framework callback adapters for LangChain, the Claude Agent SDK, CrewAI, LlamaIndex, AutoGen and others turn their events into the same span shape, and any OTLP/HTTP exporter can send traces without the SDK, which covers stacks such as Bedrock Agents and Azure AI Foundry.
Live monitoring does not replace the offline run, because nothing in production is controlled. Traffic shifts, so a falling score can reflect a change in your users rather than in your AI agent, and the role of live scoring is detection rather than experiment. The two connect through the Add trace to dataset action on the trace page, which maps a real conversation that went wrong onto the columns of a dataset under one of your test plans, with the option to type in the expected output you now know the AI agent should have produced. A production failure becomes a regression test, and the next evaluation run covers it. For an AI agent this loop is the main way the dataset grows, because the paths real users and real tools produce are the ones nobody would have thought to write.
Summary
An AI agent is an AI system in which the model decides the next step, acts through a tool, reads the result and repeats until the task is done. The decision, the action and the open-ended loop are what distinguish it from a chatbot, a RAG assistant and a fixed LLM workflow, and each of the three brings its own failures, wrong tool choices, bad tool use, lost context, loops that never end, and tasks completed on paper while the user leaves empty-handed. None of those failures is visible in the final message, which is why scoring an AI agent one response at a time gives you a confident number about the wrong thing.
The practical consequence is a change in what you measure and how. The unit becomes the conversation or the session, the user side has to be simulated with a strategy and a persona you choose deliberately, structural checks on tool calls sit alongside LLM-judged checks on outcomes, and production traces feed the dataset so the scenarios you test are the ones users actually produce. Before any of that, decide which level of autonomy your AI system is really at. The word "agent" will not tell you. The table above will, and so will the list of tools the AI system called on its last hundred requests.




