An AI agent is a software system that uses a language model to pursue a goal with some degree of autonomy. It decides what to do next, uses tools when needed, draws on memory and external sources, observes the results, and adapts its next steps until the goal is achieved, a stopping condition is reached, or a human needs to step in.
Anthropic describes the foundation of an agent as a language model enhanced with retrieval, tools, and memory. But a language model with access to tools is not automatically an agent. The important difference is whether the system can decide what to do next, act on that decision, and adapt based on the results.
As tools like ChatGPT and Claude and the underlying models make it increasingly easy to build agents and delegate tasks to them, we're seeing more systems being created without a clear understanding of the work they're supposed to perform. Little attention is often given to defining success, designing the workflow, setting boundaries, or establishing proper evaluation and observability.
The result? Agents that look impressive in demos but behave unpredictably in real situations (for reasons that deserve their own article).
This is one of the main reasons why organizations struggle to trust AI agents and scale them into production. Gartner predicts that over 40% of agentic AI projects will be canceled by the end of 2027, due to escalating costs, unclear business value or inadequate risk controls. In essence, the problem isn't what the technology can do, but that we haven't clearly defined what it should do, how well it should do it, and how we'll know whether it's actually delivering value.
What an agent is made of
To understand how this works, let's look at six building blocks.
The model: The brain
At the center is a Large Language Model (LLM), such as GPT, Claude, or Gemini.
The model interprets what the user wants, reasons about the available information, and decides what to do next. It can analyze a customer request, identify missing information, compare alternatives, or determine which tool to use.
For example, imagine a customer asking:
"My order hasn't arrived. Can you check what's happening?"
Here a polite reply is simply not enough - the agent needs to find the order, check its status and decide how to respond.
However, the LLM doesn't inherently know the customer's order details, and also it can’t directly access the company's systems. It needs other components to do that.
The model provides the reasoning capabilities, but its reasoning is only as useful as the information and capabilities available to it.
Instructions: The agent's job description and operating rules
Every agent needs instructions that define how it should behave. These are typically provided through a system prompt, sometimes called agent instructions. Without clear instructions, the agent has to guess what is expected and what good performance means.
Think of this as the job description and operating manual for a new employee. It establishes several things:
Role: Who is the agent? A customer support specialist, research assistant, or financial analyst?
Objective: What is it expected to accomplish?
Behavior: How should it communicate, reason, and handle uncertainty?
Boundaries: What is it allowed to do, and what is prohibited?
Success criteria: What does a completed task look like?
Escalation: When must it involve a human?
For example, a customer support agent might receive instructions like:
"You are a customer support specialist.
Your goal is to resolve delivery-related questions using verified order information and company policies.
Never invent delivery dates.
You may check orders and prepare support tickets, but refunds require human approval.
If information is missing or contradictory, escalate the case."
Notice that the instructions define much more than tone or personality. They establish the agent's responsibilities, decision-making boundaries, and expected behavior.
There is also an important technical distinction. Instructions are not the same as enforceable controls. Telling an agent not to issue refunds is useful, but a production system should also prevent unauthorized refunds through permissions and application-level checks. In a future article, we'll explore how to enforce these boundaries through permissions, approval mechanisms, and guardrails.
The system prompt describes how the agent should behave. The surrounding software must enforce the most important rules. Without technical safeguards, instructions alone may not be sufficient.
Tools: The agent's hands
A language model can generate text, analyze information, and propose decisions. But if it needs to interact with the outside world, it requires tools. Tools turn AI from something that primarily generates answers into something that can participate in real business operations. They also introduce risks, because the agent's decisions can now affect actual systems, customers, and data, so we have to carefully allow and monitor that.
A tool is a specific capability that the agent can invoke. Examples include:
Searching the web for current information.
Reading an order from an ERP or CRM system.
Checking a calendar for available meeting slots.
Creating a support ticket.
Updating a customer record.
Running Python code to analyze a dataset.
Sending an email or triggering another business process.
Let's return to our customer support example.
The customer asks about a missing delivery. The model determines that it needs the order status and requests a tool called get_order_status.
The tool retrieves the actual information from the company's system and returns something like:
"Order 1245. Status: delayed. Expected delivery: Friday."
The model can now respond using verified information instead of guessing.
An important detail: the model usually does not execute the tool itself. It requests a tool call, and the surrounding software performs the operation and returns the result.
Tools can be connected through APIs, custom integrations, or standards such as Model Context Protocol (MCP), which makes it easier for AI applications to discover and use external capabilities.
Memory: What the agent remembers
A language model does not automatically remember previous conversations or actions. Each time it is called, it works with the information provided in that particular request. If previous messages, decisions, or tool results are not included, the model has no direct access to them. Imagine speaking to a colleague who forgets everything after each interaction.
This is why memory is an important part of an agent system. Memory enables continuity and personalization. It also helps agents avoid repeating work, especially in tasks that span multiple steps or interactions.
There are two important forms of memory.
Short-term memory maintains the context of the current task or conversation, typically within a session. For example, a customer support agent remembers that it has already checked an order, discovered a delay, and asked the customer how to proceed.
Technically, this includes conversation history, tool results, and decisions made during the task. This information can be stored as session state and passed to the model when needed, allowing the agent to continue without repeating previous steps.
Long-term memory preserves useful information across different sessions. Imagine the same customer contacts support a month later. The agent might remember their preferred language (semantic memory), a previous delivery issue and how it was resolved (episodic memory), or reusable guidance for handling similar cases (procedural memory).
Technically, long-term memory is stored in a database or dedicated memory store and retrieved when relevant. It allows agents to personalize interactions and build on past experience rather than starting from scratch . Memory must be designed carefully. Not everything should be remembered forever, and remembered information may become outdated or incorrect.
Retrieval: Finding the right knowledge
Memory and retrieval sound similar, but they serve different purposes.
Memory is about what happened before. Retrieval is about finding information relevant to the task right now.
Instead of placing all these documents in the model's prompt, the system can search for the relevant information when needed. An agent might need information from hundreds or thousands of company documents: product manuals, procedures, pricing policies, contracts, or technical specifications.
Retrieval connects the agent to actual business knowledge rather than relying on what the language model might remember from its training. It makes answers more grounded, although the information still needs to be checked.
Suppose a customer asks:
"Can I return this product after 45 days?"
The agent searches the company's return policy, retrieves the relevant section, and uses that information to formulate its response. The distinction matters because the model's general training knowledge is not a reliable source for a company's specific, potentially changing policies.
Retrieval also introduces its own challenges. Finding a document that looks relevant does not guarantee that it is the correct document. The agent may need to check its version, date, and applicability.
Turning a goal into action
This is where the individual components come together.
A traditional software workflow usually follows a predefined sequence of steps. An agent has greater flexibility: it can decide which action to take next based on the information it receives.
Consider our missing delivery example.
The agent might follow this sequence:
Understand the goal: The customer wants to know why the order is late and what can be done.
Decide: The agent determines that it needs to check the order status.
Act: It uses a tool to retrieve the latest delivery information.
Observe: The tool reports that the shipment has been delayed.
Adapt: The agent checks the company's delivery policy to determine the available options.
Continue or stop: It explains the situation, proposes the appropriate next step, or asks a human to approve an action outside its authority.
This repeated cycle of deciding, acting, observing, and adapting is often called the agent loop. The loop gives an agent the flexibility to handle situations that cannot be fully anticipated in advance. But that flexibility must be balanced with clear boundaries and ways to verify progress.
The key is that the agent does not necessarily follow the same path every time.
If the order doesn't exist, it may ask for clarification. If the shipment is delayed, it may check the applicable policy. If the information conflicts, it may escalate instead of making a decision.
The agent also needs to know when to stop. A good system defines limits on time, cost, number of attempts, and permitted actions. Otherwise, an agent might continue making unnecessary tool calls or repeatedly attempt something that cannot succeed.
Putting it all together
These building blocks work as one system.
The model interprets the problem and makes decisions. Instructions define its responsibilities and expected behavior. Tools provide the ability to act. Memory preserves relevant history. Retrieval provides access to business knowledge. And the agent loop connects everything, allowing the system to make progress toward a goal.
There is one more capability that deserves particular attention: evaluation and feedback.
An agent can execute every step correctly and still fail to deliver meaningful value. That's why we need to look beyond technical execution and validate both the quality of its decisions and the impact of its work. Ultimately, it's not enough for an agent to work. We need to know that it works reliably, delivers the intended outcomes, and have the evidence to prove it.
One risk we see: we are learning to build agents faster than we are learning to design the work we expect them to do.
If you are exploring agents in your product or your team and want a second pair of eyes on the design, get in touch. We help teams define what "good" looks like before the agent goes live, and validate its performance afterward.