No history yet

Agent Architectures

Beyond the Prompt

Most interactions with large language models (LLMs) are simple conversations. You send a prompt, you get a response. The model processes your request and immediately forgets it, waiting for the next input. This is a stateless, non-agentic workflow. It's powerful, but it's a one-way street. The LLM acts as a tool, not a partner.

An AI agent, by contrast, is a system designed for autonomy. It doesn't just respond; it pursues a goal. To do this, it needs a way to understand its environment, make decisions, and take action. This continuous cycle is the core of agentic behaviour and is often called the Perception-Reasoning-Action loop.

The fundamental operational process of any AI agent is the Perception-Action Cycle, a continuous loop that defines its interaction with the world.

This loop is the agent's cognitive skeleton. It transforms a stateless LLM into a stateful system capable of planning and executing multi-step tasks. Let's break down how it works.

The Agentic Loop

1. Perception This is the agent's sensory input. It's how the system gathers information about its environment and the current state of its task. Perception isn't just about seeing; it's about observing signals. These signals could be an API response, a new email, data from a file, or a message from a user. The agent takes this raw data and updates its internal understanding of the world.

2. Reasoning Here, the LLM acts as the agent's brain. Using the information gathered during perception, the LLM processes the agent's high-level goal, its current state, and its available tools. It then decides what to do next. This isn't just generating text; it's a decision-making process. The reasoning engine might break a large goal into smaller, manageable sub-tasks or determine that a specific tool is needed to proceed.

3. Action The final step is to execute the decision made during the reasoning phase. The agent uses its available tools—like a web browser, a code interpreter, or an external API—to interact with its environment. It might search for information, write to a database, or send an email. The result of this action then becomes a new signal, feeding back into the perception stage and starting the loop all over again.

This cycle continues until the agent determines it has reached its goal, a state known as the terminal state.

Stateful vs Stateless

A standard LLM is stateless. Each prompt you send is an isolated event. Even in a continuous chat, the "memory" is just the previous conversation turns being re-sent to the model with every new prompt. The model has no persistent memory or independent goals. It's a powerful text processor, but it can't act on its own.

An agent, however, is stateful. It maintains an internal understanding of its progress toward a goal. This "state" includes what it has already done, what it has learned, and what it still needs to do. This persistence is what allows an agent to tackle complex, multi-step problems that would be impossible with a simple prompt-response exchange.

FeatureNon-Agentic WorkflowAgentic Workflow
OperationOne-off, stateless responsesContinuous, stateful loop
GoalFulfills a single, immediate promptPursues a high-level, multi-step objective
InteractionUser-driven (waits for input)Autonomous (initiates actions)
ExampleAsking an LLM to summarise a documentTelling an agent to plan a holiday itinerary
StateForgets after each responseMaintains memory of past actions and outcomes

Recognising the terminal state is a critical part of an agent's design. How does it know when the job is done? This can be defined explicitly, such as "stop when you have successfully booked the flight," or it can be inferred by the reasoning engine when it determines that the initial high-level goal has been fully satisfied. Without a clear end condition, an agent could loop indefinitely.

Ready to test your understanding of how these autonomous systems work?

Quiz Questions 1/6

What is the core cognitive cycle that enables an AI system to exhibit agentic behaviour?

Quiz Questions 2/6

In the context of an AI agent, what is the primary role of the LLM?

Understanding this foundational loop is the key to moving beyond simple chatbots and into the world of autonomous AI systems.