How does a deep research agent work?
- Authors
- Name
- Amit Shekhar
- Published on
A deep research agent is an AI system that takes a big question, makes a plan, searches the web many times, reads many sources, checks what is still missing, and then writes a detailed report with sources. It does in minutes what a human researcher would do in hours.
In this blog, we will learn about how a deep research agent works. We will also see why a normal LLM answer is not enough for big questions, how the agent plans, searches, reads, takes notes, and finds gaps in a loop, how many helper agents can research in parallel, how the final report with sources is written, and where deep research works well and where it fails.
We will cover the following:
- The problem with a normal LLM answer
- What is a deep research agent?
- How does a deep research agent work?
- Step 1: Understand the question
- Step 2: Make a research plan
- Step 3: Search and read
- Step 4: Take notes
- Step 5: Reflect and find the gaps
- Step 6: Write the report with sources
- Many agents working together
- A simple code example
- Normal chat vs deep research
- Where it works well and where it fails
I am Amit Shekhar, Founder @ Outcome School, I have taught and mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.
I teach AI and Machine Learning at Outcome School.
Let's get started.
The problem with a normal LLM answer
Suppose we ask an LLM, "Should our small company move from our own servers to the cloud? Compare the cost, security, and effort for a team of 20 people."
This is a big question. A good answer needs many facts: current prices, security reports, real stories from other companies, and expert opinions.
A normal LLM chat does one of two things:
- It answers from memory, which can be old or wrong.
- It does one quick search, reads two or three pages, and writes a short answer.
Both are not enough. A human researcher would spend hours: making a plan, searching again and again, reading 30 to 50 pages, noting what each source says, noticing what is still missing, and finally writing a report.
So, here comes the deep research agent to the rescue. It does the same thing a careful researcher does, but automatically.
What is a deep research agent?
A deep research agent is an AI agent that researches a question in many rounds of searching and reading, and then writes a long, organized report with links to its sources.
An AI agent is a system built around an LLM (Large Language Model) that works in a loop: it thinks, uses a tool, looks at the result, and repeats until the job is done. A tool is a function that the LLM can ask our code to run. A deep research agent mainly uses two tools: web_search, which searches the internet and returns a list of results, and read_page, which opens a web page and returns its text.
Think of a student who gets a school project, "Write a report on how bees make honey." A lazy student copies the first result. A good student does this:
- Makes a list of sub-topics: what bees eat, how nectar becomes honey, how the hive stores it.
- Goes to the library and reads many books.
- Writes notes on cards, with the book name on each card.
- Looks at the notes and says, "I still do not know why honey does not spoil. Let me find that."
- Finally, writes the report and lists the books used.
A deep research agent is the good student. Many AI products today offer this feature, often with the name "Deep Research".
To learn AI Agent, Agentic AI, and Tool use in Agents, and build an AI Coding Agent from scratch, check out our AI and Machine Learning Program at Outcome School.
How does a deep research agent work?
Now, it's time to learn how it actually works. The whole process looks like below:
User question
↓
[1] Understand the question
(ask the user if something is unclear)
↓
[2] Make a research plan
(break into smaller questions)
↓
+------------------------------------------+
| [3] Search and read | <---+
| ↓ | |
| [4] Take notes (with source links) | |
| ↓ | |
| [5] Reflect: what is still missing? | ----+
| (if something is missing, search again) |
+------------------------------------------+
↓
enough information
↓
[6] Write the report with sources
Here, we can see that Step 3, Step 4, and Step 5 form a loop. The agent keeps searching until it believes it has enough. This loop is what makes the research "deep".
Let's understand each step one by one.
Step 1: Understand the question
First, the agent reads our question carefully. Many deep research tools ask us a few short questions before starting, if something is unclear.
For our cloud question, it can ask, "Which country are you in? Do you have a budget limit? Do you need to follow any data rules?"
Once we answer, the agent has a clear goal. This step matters because research takes time and money. If the agent misunderstands the question, all that research is wasted.
Step 2: Make a research plan
Then, the agent breaks the big question into smaller questions that are easier to search. This is called planning. We have a detailed blog on Plan-and-Execute Agent that explains this planning pattern in depth.
For our example, the plan can look like below:
Plan:
Q1: What does it cost to run 20 people's systems on own servers?
Q2: What does the same setup cost on major cloud providers?
Q3: What are the security risks of each option?
Q4: How long does a move to the cloud usually take?
Q5: What problems did similar small companies face?
Here, each small question can be searched separately. A big, vague question is hard to search. Five clear questions are easy to search.
Step 3: Search and read
After that, for each small question, the agent writes search queries and calls the web_search tool.
The search returns a list of links with short snippets. The agent picks the most useful links and calls read_page to open them and get the full text.
Here, the agent behaves like a human. It does not trust only the first result. It searches with different words, opens many pages, and prefers good sources like official pricing pages, research papers, and trusted news sites.
Planning your move into AI?
No matter which tech domain you work in today, with your effort, you can transition to these roles:
- AI Engineer
- Forward Deployed Engineer
- AI Agent Engineer
- Harness Engineer
- Voice AI Engineer
- AI Architect
- LLM Engineer
- LLM Inference Engineer
- Gen AI Engineer
- MLOps Engineer
- ML Engineer
- Deep Learning Engineer
Our AI and Machine Learning Program at Outcome School takes you there.
Step 4: Take notes
Web pages are long. The LLM can only keep a limited amount of text in front of it at one time. This limit is called the context window. It is like a desk with limited space.
If the agent kept every full page on the desk, the desk would overflow after a few pages.
So, the agent takes notes. After reading a page, it writes down only the useful facts, and for each fact, it keeps the link where it found it.
Note: Cloud server for small team costs about X per month.
Source: https://example.com/pricing
Here, the note is short, and the source link travels with it. This link is later used to show where each claim came from.
Step 5: Reflect and find the gaps
Now, the agent looks at all its notes and asks itself:
- Have I answered every question in my plan?
- Do two sources disagree? If yes, which one is more trustworthy?
- Did I find something new that needs more searching?
This thinking about its own progress is called reflection.
Let's say the notes have strong information about cost but almost nothing about how long the move takes. The agent notices this gap and goes back to Step 3 with new searches only for that gap.
It also learns while it reads. Suppose it finds that many companies faced surprise bills for moving data out of the cloud. This was not in the original plan. A good agent adds a new question about it.
The loop stops when the agent decides it has enough information, or when it reaches a limit we set, like a maximum number of searches or a time limit.
A quick note for you
No matter which tech domain you work in, get familiar with these topics:
- LLM
- RAG
- MCP
- Agent
- Fine-tuning
- Quantization
We put it all together in one video:
AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, and Quantization
No need to stop reading - bookmark it and watch later when you get time. Future you will thank you.
Now, let's get back to the topic.
Step 6: Write the report with sources
Finally, the agent takes all its notes and writes the report. A good report has:
- A short summary at the top.
- Sections for each part of the question.
- A comparison table where it helps.
- A clear recommendation.
- Citations, which means links that show the source of each important claim.
Citations are very important. They let us click and check the facts ourselves. This is how we catch mistakes.
Many agents working together
Some deep research systems use a team of agents instead of one agent.
Think of a newspaper editor and reporters. The editor gets a big story, splits it into parts, and sends each reporter to cover one part. The reporters work at the same time. Then, the editor puts all their findings together into one article.
In the same way:
- A lead agent makes the plan and splits it into parts.
- Several helper agents, also called sub-agents, each research one part at the same time. This is called working in parallel.
- Each helper returns a short summary of what it found.
- The lead agent combines these summaries and writes the report.
We can picture this as below:
+--------------+
| Lead agent |
+--------------+
↓
+--------------+--------------+
↓ ↓ ↓
+----------+ +----------+ +----------+
| Helper | | Helper | | Helper |
| Cost | | Security | | Effort |
+----------+ +----------+ +----------+
↓ ↓ ↓
+--------------+--------------+
↓
+------------------+
| Lead agent |
| writes report |
+------------------+
Here, we can see two benefits. First, it is faster because the helpers work together. Second, each helper has its own fresh desk, which means its own context window, so the lead agent's desk stays clean and only receives short summaries.
The downside is that many agents use many more tokens, and we pay for every token the LLM reads or writes. So, a team of agents costs more money than a single agent.
If we want to go deep into Subagent, Multi-Agent Systems, and how to Design a Deep Research Agent, check out our AI and Machine Learning Program at Outcome School, where we cover them in depth.
A simple code example
Let's see the core loop in a small Python example. It is written just for the sake of understanding.
def deep_research(question, max_rounds=5):
plan = llm(f"Break this into smaller search questions: {question}")
notes = []
for _ in range(max_rounds):
for sub_question in plan:
for link in web_search(sub_question)[:3]:
page = read_page(link)
facts = llm(f"Extract facts for '{sub_question}': {page}")
notes.append({"facts": facts, "source": link})
plan = llm(f"Given these notes {notes}, what is still missing? "
f"Return new questions, or an empty list if done.")
if not plan:
break
return llm(f"Write a report on '{question}' using {notes}. "
f"Cite the source for every claim.")
Here, we have:
llm(...)is our function that sends text to the LLM and returns its reply. Just for the sake of understanding, we assume it returns a list when we ask for a list of questions.web_searchandread_pageare the two tools we learned about earlier.- First, the LLM makes a plan, which is a list of smaller questions.
- For each question, we search the web, open the top 3 links, and keep only the useful facts along with the link.
- After each round, the LLM looks at the notes and decides what is still missing. That becomes the new plan.
- If nothing is missing, we stop. Otherwise, we stop after
max_roundsrounds so that it does not run forever. - Finally, the LLM writes the report and cites the sources.
Real systems are bigger, but they follow this same loop: plan, search, read, note, reflect, and repeat.
Stay updated: Subscribe to our newsletter to get our latest AI and Machine Learning blogs straight to your inbox.
Normal chat vs deep research
Let me tabulate the differences between a normal chat answer and deep research for your better understanding.
| Point | Normal chat answer | Deep research |
|---|---|---|
| Time | A few seconds | Several minutes or more |
| Searches | None or one quick search | Many searches in rounds |
| Sources read | A few | Dozens |
| Planning | No | Yes, breaks the question down |
| Checks for gaps | No | Yes, reflects and searches again |
| Output | Short answer | Long report with citations |
| Cost | Low | Much higher |
| Best for | Quick facts, simple questions | Big questions, comparisons, market and topic research |
Where it works well and where it fails
It works well for:
- Comparing products, tools, or options.
- Learning the current state of a topic quickly.
- Market research and finding many sources on one subject.
- Collecting information that is spread across many websites.
It fails or struggles when:
- The information is behind a login or a paywall, so the agent cannot read it.
- The web has many low-quality or wrong pages on the topic, and the agent trusts the wrong ones.
- The agent writes a citation that does not really support the claim. This happens, so we must click and check the important ones.
- The question needs private data, like our company's internal numbers, unless we give the agent access to it.
- We need an answer in a few seconds, because deep research takes time.
So, the report saves us hours, but for important decisions, we must still check the key facts.
Now we must have understood how a deep research agent works.
Frequently Asked Questions
How long does a deep research agent take to answer?
It usually takes several minutes or more. A normal chat answer takes a few seconds, but a deep research agent runs many searches in rounds and reads dozens of sources before it writes the report. It still does in minutes what a human researcher would do in hours, but it is not the right choice when we need an answer in a few seconds.
Can we trust the citations in a deep research report?
Not blindly. Citations let us click and check the facts ourselves, which is how we catch mistakes. But the agent can write a citation that does not really support the claim, so for important decisions we must still click and check the key facts.
How does a deep research agent know when to stop searching?
It stops when it decides it has enough information, or when it reaches a limit we set, like a maximum number of searches or a time limit. After each round, it looks at its notes and checks what is still missing. If nothing is missing, the loop ends.
Does a multi-agent deep research system cost more?
Yes. Many agents use many more tokens, and we pay for every token the LLM reads or writes, so a team of agents costs more money than a single agent. In return, it is faster because the helper agents work in parallel, and the lead agent's context window stays clean because it only receives short summaries.
That's it for now.
Thanks
Amit Shekhar
Founder @ Outcome School
You can connect with me on:
Follow Outcome School on:
