Illustrated Guide to AI Agents 2025
Illustrated Guide to AI Agents 2025
2025 EDITION EE
AI AGENTS
THE ILLUSTRATED
GUIDEBOOK
Table of contents
AI Agents....................................................................................................... 4
What is an AI Agent?...................................................................................5
Agent vs LLM vs RAG................................................................................... 8
LLM (Large Language Model)..............................................................................8
RAG (Retrieval-Augmented Generation).........................................................9
Agent.............................................................................................................................. 9
Building blocks of AI Agents.....................................................................10
1) Role-playing...........................................................................................................10
2) Focus/Tasks............................................................................................................ 11
3) Tools.......................................................................................................................... 11
#3.1) Custom tools.................................................................................................. 12
#3.2) Custom tools via MCP...............................................................................17
4) Cooperation...........................................................................................................21
5) Guardrails.............................................................................................................22
6) Memory................................................................................................................. 22
5 Agentic AI Design Patterns...................................................................24
#1) Reflection pattern.......................................................................................... 25
#2) Tool use pattern.............................................................................................25
#3) ReAct (Reason and Act) pattern........................................................... 26
#4) Planning pattern........................................................................................... 28
#5) Multi-Agent pattern.....................................................................................29
5 Levels of Agentic AI Systems................................................................30
#1) Basic responder................................................................................................31
#2) Router pattern.................................................................................................31
#3) Tool calling.......................................................................................................32
#4) Multi-agent pattern.....................................................................................32
#5) Autonomous pattern....................................................................................33
2
[Link]
AI Agents Projects..................................................................................... 34
#1) Agentic RAG........................................................................................................... 35
#2) Voice RAG Agent..................................................................................................41
#3) Multi-agent Flight finder................................................................................ 46
#4) Financial Analyst.................................................................................................54
#5) Brand Monitoring System................................................................................ 59
#6) Multi-agent Hotel Finder.................................................................................67
#7) Multi-agent Deep Researcher........................................................................75
#8) Human-like Memory for Agents...................................................................82
#9) Multi-agent Book Writer................................................................................. 89
#10) Multi-agent Content Creation System..................................................... 98
#11) Documentation Writer Flow.........................................................................106
#12) News Generator................................................................................................ 112
3
[Link]
AI Agents
4
[Link]
What is an AI Agent?
Imagine you want to generate a report on the latest trends in AI research. If you
use a standard LLM, you might:
This iterative process takes time and effort, requiring you to act as the
decision-maker at every step.
5
[Link]
● A Filtering Agent scans the retrieved papers, identifying the most relevant
ones based on citation count, publication date, and keywords.
6
[Link]
Here, the AI agents not only execute the research process end-to-end but also
self-refine their outputs, ensuring the final report is comprehensive, up-to-date,
and well-structured - all without requiring human intervention at every step.
To formalize AI Agents are autonomous systems that can reason, think, plan,
figure out the relevant sources and extract information from them when needed,
take actions, and even correct themselves if something goes wrong.
7
[Link]
It can reason, generate, summarize but only using what it already knows (i.e., its
training data).
8
[Link]
It’s smart, but static. It can’t access the web, call APIs, or fetch new facts on its
own.
RAG makes the LLM aware of updated, relevant info without retraining.
Agent
An Agent adds autonomy to the mix.
An Agent uses an LLM, calls tools, makes decisions, and orchestrates workflows
just like a real assistant.
9
[Link]
1. Role-playing
2. Focus
3. Tools
4. Cooperation
5. Guardrails
6. Memory
Let’s explore each of these concepts and understand why they are fundamental to
building great AI agents.
1) Role-playing
One of the simplest ways to boost an agent’s performance is by giving it a clear,
specific role.
A generic AI assistant may give vague answers. But define it as a “Senior contract
lawyer,” and it responds with legal precision and context.
Why?
Because role assignment shapes the agent’s reasoning and retrieval process. The
10
[Link]
more specific the role, the sharper and more relevant the output.
2) Focus/Tasks
Focus is key to reducing hallucinations and improving accuracy.
Giving an agent too many tasks or too much data doesn’t help - it hurts.
For example, a marketing agent should stick to messaging, tone, and audience
not pricing or market analysis.
3) Tools
Agents get smarter when they can use the right tools.
11
[Link]
12
[Link]
CrewAI supports several tools that you can integrate with Agents, as depicted
below:
Below, let's look at how you can build one for your custom needs in the CrewAI
framework.
13
[Link]
Next, we define the input fields the tool expects using Pydantic.
14
[Link]
Every tool class should have the _run method which we will execute whenever
the Agents wants to make use of it.
In the above code, we fetch live exchange rates using an API request. We also
handle errors if the request fails or the currency code is invalid.
Now, we define an agent that uses the tool for real-time currency analysis and
attach our CurrencyConverterTool, allowing the agent to call it directly if needed:
15
[Link]
Finally, we create a Crew, assign the agent to the task, and execute it.
Works as expected!
16
[Link]
Instead of embedding the tool directly in every Crew, we’ll expose it as a reusable
MCP tool—making it accessible across multiple agents and flows via a simple
server.
We’ll now write a lightweight [Link] script that exposes the currency converter
tool. We start with the standard imports:
17
[Link]
To make the tool accessible, we need to run the MCP server. Add this at the end
of your script:
18
[Link]
This starts the server and exposes your convert_currency tool at:
[Link]
Now any CrewAI agent can connect to it using MCPServerAdapter. Let’s now
consume this tool from within a CrewAI agent.
First, we import the required CrewAI classes. We’ll use Agent, Task, and Crew
from CrewAI, and MCPServerAdapter to connect to our tool server.
Next, we connect to the MCP tool server. Define the server parameters to
connect to your running tool (from [Link]).
This agent is assigned the convert_currency tool from the remote server. It can
now call the tool just like a locally defined one.
19
[Link]
Finally, we create the Crew, pass in the inputs and run it:
20
[Link]
4) Cooperation
Multi-agent systems work best when agents collaborate and exchange feedback.
Instead of one agent doing everything, a team of specialized agents can split tasks
and improve each other’s outputs.
21
[Link]
5) Guardrails
Agents are powerful but without constraints, they can go off track. They might
hallucinate, loop endlessly, or make bad calls.
Guardrails ensure that agents stay on track and maintain quality standards.
For example, an AI-powered legal assistant should avoid outdated laws or false
claims - guardrails ensure that.
6) Memory
22
[Link]
Without memory, an agent would start fresh every time, losing all context from
previous interactions. With memory, agents can improve over time, remember
past actions, and create more cohesive responses.
23
[Link]
The following visual depicts the 5 most popular design patterns employed in
building AI agents.
24
[Link]
The AI reviews its own work to spot mistakes and iterate until it produces the
final response.
25
[Link]
This is helpful since the LLM is not solely reliant on its internal knowledge.
26
[Link]
As shown above, the Agent is going through a series of thought activities before
producing a response.
27
[Link]
More specifically, under the hood, many such frameworks use the ReAct
(Reasoning and Acting) pattern to let LLM think through problems and use tools
to act on the world.
This enhances an LLM agent’s ability to handle complex tasks and decisions by
combining chain-of-thought reasoning with external tool use like in this ReAct
implementation from scratch.
● Subdividing tasks
● Outlining objectives
28
[Link]
● There are several agents, each with a specific role and task.
● Each agent can also access tools.
All agents work together to deliver the final outcome, while delegating tasks to
other agents if needed.
29
[Link]
30
[Link]
The LLM is just a generic responder that receives an input and produces an
output. It has little control over the program flow.
The LLM makes basic decisions on which function or path it can take.
31
[Link]
A human defines a set of tools the LLM can access to complete a task.
LLM decides when to use them and also the arguments for execution.
A manager agent coordinates multiple sub-agents and decides the next steps
iteratively.
A human lays out the hierarchy between agents, their roles, tools, etc.
32
[Link]
The most advanced pattern, wherein, the LLM generates and executes new code
independently, effectively acting as an independent AI developer.
33
[Link]
AI Agents
Projects
34
[Link]
Tech stack:
Workflow:
35
[Link]
CrewAI seamlessly integrates with all popular LLMs and providers. Here's how
we set up a local Qwen 3 via Ollama:
This Agent accepts the user query and retrieves the relevant context using a
vectorDB tool and a web search tool powered by Firecrawl.
36
[Link]
Next, the Writer Agent accepts the insights from the Researcher Agent to
generate a response.
Once we have defined the Agents and their tasks, we orchestrate them into a
crew using CrewAI and put that into a setup method.
37
[Link]
With that, we have orchestrated the Agentic RAG workflow, which will be
executed upon an incoming request. Next, from the incoming request body, we
extract the user query. Check the highlighted code below:
38
[Link]
#6) Predict
We use the decoded user query and pass it to the Crew defined earlier to generate
a response from the model. Check the highlighted code below:
Here, we can post-process the response & send it back to the client.
39
[Link]
Next, we have the basic client code to invoke the API we created using the
requests Python library. Check this:
Done! We have deployed our fully private Qwen 3 Agentic RAG using LitServe.
40
[Link]
Tech stack:
Workflow:
41
[Link]
This ensures we can load configurations from .env and keep track of everything
in real time.
This is where your documents get indexed for search and retrieval, powered by
LlamaIndex. The agent's answers would be grounded to this knowledge base.
42
[Link]
43
[Link]
44
[Link]
Finally, we tie it all together. We run our agent with, specifying the prewarm
function and main entrypoint.
45
[Link]
Tech stack:
Workflow:
● Parse the query (SF to New York on 21st September) to create a Kayak
search URL
● Visit the URL and extract top 5 flights
● For each flight, go to the details to find available airlines
● Summarize flight info
46
[Link]
CrewAI nicely integrates with all the popular LLMs and providers out there.
Here's how you set up a local DeepSeek using Ollama:
This agent mimics a real human searching for flights by browsing the web,
powered by Browserbase’s headless-browser tool and can look up flights on sites
like Kayak.
47
[Link]
After retrieving the flight details, we need a concise summary of all available
options.
This is where our Summarization Agent steps in to make sense of the results for
easy reading.
Now that we have both our agents ready, it's time to understand the tools
powering them.
1. Kayak tool
2. Browserbase tool
48
[Link]
A custom Kayak tool to translate the user input into a valid Kayak search URL.
49
[Link]
The flight search agent uses the Browserbase tool to simulate human browsing
and gather flight data.
To be precise it automatically navigates the Kayak website and interacts with the
web page. Check this out:
Once the agents and tools are defined, we orchestrate them using CrewAI.
Define their tasks, sequence their actions, and watch them collaborate in real
time. Check this out:
50
[Link]
Note: here the ‘planning = True’ is using the planning pattern we discussed in the 5
Agentic AI Design Patterns above.
Finally, we feed the user’s request (departure city, arrival city, travel dates) into
the Crew and let it run:
51
[Link]
Streamlit UI
It’s a simple chat-like UI where you enter your flight details and see the results in
real time.
52
[Link]
53
[Link]
Tech stack:
Workflow:
54
[Link]
This agent accepts a natural language query and extracts structured output using
Pydantic. This guarantees clean and structured inputs for further processing!
55
[Link]
This agent writes Python code to visualize stock data using Pandas, Matplotlib,
and Yahoo Finance libraries.
This agent reviews and executes the generated Python code for stock data
visualization.
It uses the code interpreter tool by CrewAI to execute the code in a secure
sandbox environment.
56
[Link]
We set up and kick off our financial analysis crew to get the result shown below!
Now, we encapsulate our financial analyst within an MCP tool and add two more
tools to enhance the user experience.
57
[Link]
Go to: File → Preferences → Cursor Settings → MCP → Add new global MCP
server. In the JSON file, add what's shown below
Done! Our financial analyst MCP server is live and connected to Cursor.
58
[Link]
Tech stack:
Workflow:
59
[Link]
Thus, we'll first gather recent search results from Bright Data's SERP API.
60
[Link]
The above output will contain links to web pages, X posts, YouTube videos,
Instagram posts, etc.
To do this:
61
[Link]
We will have multiple Crews, one for each platform (X, Instagram, YouTube, etc.)
62
[Link]
This Agent analyzes the posts scraped by Bright Data and extracts key insights. It
is also assigned a task to do so.
The Agent takes the output of the X analyst agent and generates insights.
63
[Link]
64
[Link]
Finally, we wrap the app in a clear Streamlit interface for interactivity and run
the Flow.
65
[Link]
Done!
You're now ready to monitor any brand, track all mentions, and generate insights
about a company.
66
[Link]
Tech stack:
Workflow:
● Parse the query (location, dates etc.) to create a Kayak search URL
● Visit the URL and extract top 5 flights
● For each hotel, find pricing and more info
● Summarize hotel info
67
[Link]
CrewAI nicely integrates with all the popular LLMs and providers out there!
This agent mimics a real human searching for hotels by browsing the web. It's
powered by browserbase's headless-browser tool and can look up hotels on sites
like Kayak.
68
[Link]
After retrieving the hotel details, we need a concise summary of all available
options.
This is where our Summarization Agent steps in to make sense of the results for
easy reading.
69
[Link]
Now that we have both our agents ready, it's time to understand the tools
powering them.
1. Kayak tool
2. Browserbase tool
70
[Link]
A custom Kayak tool to translate the user input into a valid Kayak search URL.
71
[Link]
The hotel search agent uses the Browserbase tool to simulate human browsing
and gather hotel data.
To be precise it automatically navigates the Kayak website and interacts with the
web page.
72
[Link]
Once the agents and tools are defined, we orchestrate them using CrewAI.
Define their tasks, sequence their actions, and watch them collaborate in real
time! Check this out:
Finally, we feed the user’s request (location, dates etc.) into the Crew and let it
run! Check this out:
73
[Link]
Streamlit UI
It’s a simple chat-like UI where you enter your location and other details and see
the results in real time!
74
[Link]
Tech stack:
Workflow:
75
[Link]
We'll use Linkup platform's powerful search capabilities, which rival Perplexity
and OpenAI, to power our web search agent. This is done by defining a custom
tool that our agent can use.
76
[Link]
The web search agent gathers up-to-date information from the internet based on
user query. The linkup tool we defined earlier is used by this agent.
77
[Link]
This agent transforms raw web search results into structured insights, with
source URLs. It can also delegate tasks back to the web search agent for
verification and fact-checking.
It takes the analyzed and verified results from the analyst agent and drafts a
coherent response with citations for the end user.
78
[Link]
Finally, once we have all the agents and tools defined we set up and kickoff our
deep researcher crew.
Now, we'll encapsulate our deep research team within an MCP tool. With just a
few lines of code, our MCP server will be ready.
79
[Link]
Go to: File → Preferences → Cursor Settings → MCP → Add new global MCP
server
80
[Link]
Done! Your deep research MCP server is live and connected to Cursor.
81
[Link]
Tech stack:
Workflow:
82
[Link]
We'll use a locally served Qwen 3 via Ollama. Check this out:
83
[Link]
Create a Zep client session for the user, which the agent will use to manage
memory. A user can have multiple sessions. Here’s how it looks:
Our Zep Memory Agent builds on Autogen's Conversable Agent, drawing live
memory context from Zep Cloud with each user query.
84
[Link]
85
[Link]
86
[Link]
#7) Streamlit UI
We can interactively map users' conversations across multiple sessions with Zep
Cloud's UI.
This powerful tool allows us to visualize how knowledge evolves through a graph.
Take a look:
87
[Link]
88
[Link]
Tech stack:
Workflow:
89
[Link]
● Using Firecrawl, Outline Crew scrapes data related to the book title and
decides the chapter count and titles.
● Multiple writer Crews work in parallel to write one chapter each.
● Combine all chapters to get the book.
Books demand research. Thus, we'll use Firecrawl's SERP API to scrape data.
Tool usage:
90
[Link]
91
[Link]
● Research Agent → Uses the Firecrawl scraping tool to scrape data related
to the book's title and prepare insights.
● Outline Agent → Uses the insights to output total chapters and titles as
Pydantic output.
92
[Link]
● Research Agent → Uses the Firecrawl Scraping tool to scrape data related
to a chapter's title and prepare insights.
● Write Agent → Uses the insights to write a chapter.
93
[Link]
94
[Link]
Once all Writer Crews have finished execution, we save the book as a Markdown
file.
95
[Link]
● First, the Outline Crew is invoked. It utilizes the Firecrawl scraping tool to
prepare the outline.
● Next, many Writer Crews are invoked in parallel to write one chapter each.
96
[Link]
This workflow runs for ~2 minutes, and we get a neatly written book about the
specified topic—"Astronomy in 2025." Here's the book our Agentic workflow
wrote:
97
[Link]
Tech stack:
98
[Link]
Workflow:
99
[Link]
With that understanding in mind, let's start building our content creation
workflow.
We start our content generation workflow by defining an API step that takes in a
URL from the user via a POST request.
100
[Link]
This step scrapes the article content using Firecrawl and emits the next step in
the workflow.
Steps can be connected together in a sequence, where the output of one step
becomes the input for another.
101
[Link]
The scraped content gets fed to the X and LinkedIn agents that run in parallel
and generate curated posts.
We define all our prompting and AI logic in the handler that runs automatically
when a step is triggered.
102
[Link]
#4) Scheduling
After the content is generated we draft it in Typefully where we can easily review
our social media posts.
Motia also allows us to mix and match different languages within the same
workflow providing great flexibility.
103
[Link]
After defining our steps, we install required dependencies using `npm install` and
run the Motia workbench using `npm run dev` commands.
104
[Link]
105
[Link]
Tech stack:
Workflow:
106
[Link]
This ensures data validation and integrity before generating the documentation
files. Check this code:
107
[Link]
● Code explorer agent -> Analyzes codebase for key components, patterns
and relationships.
● Doc planner agent -> Creates outline based on codebase analysis as
pydantic output.
● Doc writer agent -> Generates a high-level draft based on the planned
outline.
108
[Link]
● Doc reviewer agent -> Reviews the draft for consistency, accuracy and
completeness.
109
[Link]
Finally, when we have everything ready, we kick off our documentation flow with
the GitHub repo URL.
110
[Link]
111
[Link]
Tech stack:
Workflow:
112
[Link]
#1) Setup
113
[Link]
The web-search agent takes a user query and then uses the Serper web search
tool to fetch results from the internet and consolidate them. Check this out:
This is the research task that we assign to our senior research analyst agent, with
description and expected output.
114
[Link]
The role of content writer is to use the curated results and turn them into a
polished, publication-ready news article .
This is how we describe the writing task with all the details and expected output:
115
[Link]
116