Let's talk

Beyond Chatbots

AI Agents

An AI agent is a program that takes a goal, not just a question. It uses a loop of planning, acting, and observing to complete complex tasks autonomously.

By Divyaprakash JhaUpdated 6 min readTopic: Agentic AI

Photo for AI Agents

What are AI Agents?

An AI agent is a program designed to achieve a specific goal, not just answer a prompt. It uses a loop of planning, acting, and observing to complete complex, multi-step tasks autonomously.

While a standard AI might give you a recipe for a cake, an AI agent is designed to actually manage the baking process. It doesn't just provide a single reply; it can perform multi-step tasks like reconciling invoices or rebooking appointments.

To do this, agents follow a continuous loop. They receive a goal, plan the necessary steps, call specific tools (like a database or an email service), observe the results of those actions, and repeat the process until the job is done or they require human intervention.

For example, consider a small business owner in Mumbai managing GST filings. Instead of just asking "What is my GST rate?", an agent could be given the goal: "Reconcile last month's GST invoices against the bank statement and flag mismatches." This requires the agent to read files, query a ledger, compare numbers, and write a report.

Agent vs. Chatbot vs. Workflow

In the industry, the term "agent" is often used loosely. To build or buy the right technology, you must distinguish between three distinct types of AI software.

Feature Chatbot Workflow Agent
Who decides the next step? The user, one message at a time The developer, in code The model, at run time
Uses tools? Rarely Yes, at fixed points Yes, chosen per step
Steps per task? One reply Fixed and known Variable, often unknown in advance
Predictability? High High Lower; needs guardrails

A chatbot focuses on one-to-one messaging and high predictability. A workflow follows predefined, fixed code paths to ensure reliability—it is a set of instructions that does not change. An agent, however, decides its own next steps at runtime, allowing it to handle variable and unknown tasks. The most effective systems are often hybrids, where a stable workflow provides the outer shell and agentic steps sit inside to provide flexibility.

The Components of an Agent

Building a reliable agent requires more than just a connection to a Large Language Model (LLM). It requires a structured agentic architecture consisting of several core parts.

The Model

The model is the decision-maker. It reads the conversation history and the results of tool calls to choose the next action. When building, it is often wise to use a strong, high-reasoning model for complex planning and a smaller, cheaper model for routine tasks like classification.

Tools

Tools are functions the model can call to interact with the world. Examples include search_invoices(gstin, month), send_whatsapp(template_id, phone), or create_booking(slot_id, patient_id). The model emits a structured call, your code runs it, and the result is fed back into the model's context.

Memory

Memory allows an agent to learn and stay on track. It is usually divided into three layers:

  • Working Memory: The current context window, including the goal and recent steps.
  • Episodic Memory: A record of past runs, helping the agent avoid repeating mistakes from previous sessions.
  • Long-term Memory: Holds facts and documents (like company policies) that are retrieved on demand.

Planner

The planner turns a high-level goal into actionable steps. This can be implicit, where the model decides one step at a time, or explicit, where the model writes out a full plan before any action is taken.

Patterns for Reliable Agents

To move beyond simple demos, builders use specific patterns to ensure the agent stays on task and produces quality work.

  • ReAct (Reason + Act): This pattern interleaves reasoning with tool calls. The agent thinks about what to do, performs an action, observes the result, and then reasons again. This is ideal for open-ended research.
  • Plan-and-Execute: The model writes a full plan first. An executor then works through that plan, only re-planning if a specific step fails. This is useful for tasks like migrating large product catalogs where you want to review the approach first.
  • Router: A small, fast model acts as a traffic controller, sending inputs to the correct specialized path. For example, a router can send billing questions to a billing workflow and appointment changes to a scheduling tool.
  • Evaluator-Optimizer: This involves a loop where one step produces a draft and another step critiques it. This works best when the criteria for success are concrete, such as "every claim must cite a source document."

Guardrails and Human Approval

Because agents can act autonomously, they must be wrapped in safety mechanisms that do not rely on the model's own "good behavior."

Guardrails: These are rules enforced by your software, not the model. They limit what the agent can do, such as setting a maximum budget for API calls or blocking the agent from accessing certain sensitive domains.

Human Approval: For risky actions—like issuing a refund or sending a high-value purchase order—the system should include a pause point. The agent presents the proposed action to a human, who must click "approve" or "deny" before the action is executed.

Moving from Demos to Production

A demo agent lives in a notebook and works perfectly once. A production agent must be durable and reliable. To make this transition, focus on these three areas:

  1. Durability: The system must be able to survive a server restart. If an agent is mid-task when a crash occurs, it should be able to resume from a "checkpoint" rather than starting over.
  2. The "Loop" over the Model: Most reliability issues are not caused by the LLM itself, but by the code surrounding it. The software that manages the agent's steps, tools, and boundaries is what determines success.
  3. Audit Trails: Every action taken by an agent should be recorded in a traceable log. This allows you to see exactly why an agent made a specific decision and provides a way to debug failed runs.

Multi-Agent Systems

For highly complex workflows, a single agent might become overwhelmed. In these cases, you can use multi-agent systems, where work is split across several agents, each with a unique role and specialized tools.

Common Topologies

There are several ways to structure these teams:

  • Manager and Crew: A "Manager" agent plans the overall project and assigns specific sub-tasks to a "Crew" of specialist agents.
  • Handoff Network: Agents pass control to the right specialist as the task progresses. For example, a "Receptionist" agent might hand the conversation off to a "Technical Support" agent when a specific problem is identified.
  • Orchestrator-Workers: An orchestrator breaks a task into pieces, hands them to workers, and then aggregates the results.

When deciding whether to use multiple agents, start simple. As the agentic architecture guide suggests, you should only add more agents when their roles and responsibilities truly differ.

Frequently Asked Questions

How is an AI agent different from a chatbot?
A chatbot is designed for conversation and provides single replies. An AI agent is designed to achieve a goal by planning, using tools, and executing multiple steps autonomously.
Do I need a large model to build an agent?
Not necessarily. You can use a strong model for complex planning and smaller, cheaper models for routine tasks like classification or routing.
What are the risks of using autonomous agents?
Risks include unpredictable tool usage and high costs. These are managed through guardrails, spending limits, and human approval for critical actions.
Can an agent work on its own without a prompt?
Yes, agents can be triggered by schedules (heartbeats) or specific events, allowing them to work as an "always-on" part of a company.
What is the most important part of agent reliability?
Most reliability problems stem from the "loop"—the ordinary code that manages the agent's steps, tools, and boundaries—rather than the LLM itself.
Yellow robotic arm operating inside a glass enclosure with a monitor above.
Photo: Robot arm works on a small component in a lab setting by Shixart1985, CC BY 2.0

Questions people ask

How is an AI agent different from a chatbot?

A chatbot is designed for conversation and provides single replies. An AI agent is designed to achieve a goal by planning, using tools, and executing multiple steps autonomously.

Do I need a large model to build an agent?

Not necessarily. You can use a strong model for complex planning and smaller, cheaper models for routine tasks like classification or routing.

What are the risks of using autonomous agents?

Risks include unpredictable tool usage and high costs. These are managed through guardrails, spending limits, and human approval for critical actions.

Can an agent work on its own without a prompt?

Yes, agents can be triggered by schedules (heartbeats) or specific events, allowing them to work as an 'always-on' part of a company.

What is the most important part of agent reliability?

Most reliability problems stem from the 'loop'—the ordinary code that manages the agent's steps, tools, and boundaries—rather than the LLM itself.