
Dev J. Shah 🥑What is an AI Agent? To explain this concept, I will use a very simple analogy. Humans...
To explain this concept, I will use a very simple analogy. Humans have two core powers which they use to build things. These powers are Brain (to think, decide and plan) and Body Parts (to verify, execute, and get feedback). Similarly, an AI agent is a digital version of a human which has an LLM (as Brain) and Tools (as Body Parts) to build things.
In other words, an AI agent is a software program which does not work on predefined steps. It gets the request, uses the LLM to understand it and plan the steps to be taken to fulfill it. Further, it uses tools, which is a fancy word for a function, to complete those steps as and when needed. Hence, essentially, the agent is as good as the reasoning capability of the LLM and the tools it has access to.
As the name suggests, this is an application where only a single AI agent is used to get the work done.
When an application uses multiple AI agents, it is considered a multi-agent design pattern. Moreover, within the multi-agent design pattern, there are further sub-types.
For a kind of workflow where the agents have to work in coordination with each other, in the sense that the input of one agent depends on the output of the other, a sequential pattern can be used.
For instance, in a resume screening system:
All the tasks to be performed by AI cannot be done simultaneously. Hence, agents need to be arranged in series with each other.
On the other hand, when the workflows can run independently, that is, when the agents can start working simultaneously, the pattern is called the Parallel AI Agent Pattern.
For example, in a research agent tool:
In a loop pattern of AI agents, a loop agent iteratively runs a sequence of AI agents until a specific condition is met. For instance, in a content evaluation agent:
Other than these major patterns, there are, and can be, several more patterns to design an efficient AI system. For instance:
Review and Critique Pattern: It has one agent which generates the content and another which criticizes it. Until either the generated response is satisfactory or the maximum number of iterations has been reached, it keeps looping.
Iterative Refinement Pattern: In this pattern, there can be three agents: one which generates the response, another which evaluates the quality, and if it is not up to the mark, a third agent which enhances the prompt, by adding more instructions, and sends it back to the first agent.
Coordinator Pattern: As the name suggests, it has one coordinator or master agent which plans the steps to be taken to resolve the query and assigns each step to a specialized agent based on the task to be completed.
and more.
The introduction of AI Agents started a whole new discipline in the industry of software engineering. In the near future, more software developers will work on creating agents and specialized tools, building multi-agent systems, and more. Not to forget, the invention of the Model Context Protocol (MCP) has made this easier than before.
If you want to get into the world of AI engineering, I highly recommend getting the book, “AI Engineering” by Chip Huyen.
This blog is inspired from Google documentation in Cloud Architecture Center: "Choose a design pattern for your agentic AI system"