sndev
Project CategoriesDeveloper LearnDeveloper Insights
LoginGet Started
sndevv1.0.0
AboutProject FeedInsightsYouTubePrivacy PolicyTerms of Service

Β© 2026 sndev β€’ v1.0.0

Home
Categories
Dev Learn
Insights
Sign In
Agentic AI
Nov 22, 2026
s
sndev

Building the Researcher Agent with Web Search, arXiv & Source Ranking | Deep Research Agent Part 8

GitHub RepositoryWatch on YouTube

β€œBuild the Researcher Agent for our Autonomous Deep Research Agent, integrating web search, arXiv, source deduplication, confidence-based ranking, and automated citation generation.”

Project SeriesPart 8 of 13

Deep Research Agent

Series Progress62%
Series Episodes (13)
Build an Autonomous Deep Research Agent | End-to-End Agentic AI Project | Part 1
Available
Setup & Installation for Autonomous Deep Research Agent | End-to-End Agentic AI Project | Part 2
Available
Building the Agentic AI Brain with LangGraph | Autonomous Deep Research Agent | Part 3
Available
Building AI Agent with LangGraph | Planner Agent Implementation | Deep Research Agent | Part 4
Available
Building AI Agent Tools | Rate Limiting & Source Credibility | Deep Research Agent | Part 5
Available
Building a Web Search Tool for AI Agents with Tavily API | Deep Research Agent Part 6
Available
Building arXiv Search, Cross-Referencing, and Citation Tools | Deep Research Agent Part 7
Available
P8
Building the Researcher Agent with Web Search, arXiv & Source Ranking | Deep Research Agent Part 8
Current Part
Building the Critic Agent: Detecting Conflicting Research | Deep Research System Part 9
Available
Building the Writer Agent – Generating Structured AI Research Reports | Part 10
Available
Building a Multi-Agent Workflow with LangGraph | Deep Research Agent – Part 11
Available
Building a Real-Time WebSocket Streaming Engine with FastAPI | Deep Research Agent – Part 12
Available
Building and Deploying a Full-Stack AI Deep Research Agent | Part 13 – Final Chapter
Available
Part 7Part 9

In this episode of our Autonomous Deep Research Agent series, we move from building individual research tools to integrating them into the Researcher Agent β€” the component responsible for gathering, organizing, ranking, and preparing sources for the research pipeline.

The Researcher Agent receives the original user query, the maximum number of sources, and the subqueries generated by the Planner Agent. It then systematically searches for relevant information using web search and academic research.

Instead of collecting unlimited results, we implement source limits, duplicate URL filtering, and confidence-based ranking to keep the research process structured and efficient.

1. Connecting the Planner and Researcher Agents

The Planner Agent generates subqueries from the user's original research question. These subqueries become the foundation of the Researcher Agent's workflow.

The Researcher receives the shared AgentState, extracts the query, subqueries, and source limit, and begins collecting research material.

This creates a separation of responsibilities:

  • Planner Agent: Breaks the research question into smaller subqueries.

  • Researcher Agent: Executes those subqueries, gathers sources, and prepares research evidence.

2. Research Workflow Architecture

The Researcher iterates through planner-generated subqueries and uses web search to collect relevant information. For the first three subqueries, it also performs academic research using arXiv.

Collected sources are checked against previously seen URLs to prevent duplicates. Once the research collection is complete, the sources are ranked using their domain-based confidence score, limited to the maximum number requested, and passed through the citation builder.

Generating Architecture Diagram…

3. Collecting Web and Academic Sources

The Researcher Agent integrates two search capabilities:

Tavily Web Search

Tavily is used to retrieve relevant web sources for every generated subquery. The number of results is controlled by distributing the maximum source limit across the total number of subqueries.

This prevents a single subquery from consuming the entire research source budget.

arXiv Academic Search

For the first three subqueries, the Researcher also searches arXiv to retrieve academic papers relevant to the research topic.

This introduces academic literature into the research pipeline alongside web-based information, helping the agent collect different types of sources.

4. Preventing Duplicate Sources

During research, the same website or paper may appear across multiple search queries.

To avoid collecting duplicate material, we maintain a set of previously seen URLs. Whenever a new source is retrieved, its URL is checked against this set.

  • If the URL is new, it is added to the collection.

  • If the URL already exists, the source is skipped.

This ensures that the final research collection contains unique source URLs rather than repeated search results.

5. Ranking Sources Using Confidence Scores

Not every source collected during research has the same level of reliability.

Once the research process finishes gathering sources, the agent sorts them using the existing domain-based confidence score. Sources with higher scores are prioritized, while lower-confidence sources are placed further down the list.

The Researcher then applies the maximum source limit configured by the user, retaining the highest-ranked sources within that limit.

This is a heuristic ranking mechanism based on domain confidence, not a complete factual verification system.

6. Generating Citations

After the sources have been collected, deduplicated, ranked, and filtered, the Researcher passes them to the citation builder.

The citation tool generates structured citation information and numbered references for the research material. These citations are then included in the state returned by the Researcher Agent.

This gives downstream agents a structured collection of sources that they can use when processing and generating the research report.

7. The Researcher Agent Implementation

The Researcher Agent now connects several previously implemented tools into a single research workflow:

  • Planner-generated subqueries

  • Tavily web search

  • arXiv academic paper search

  • Unique URL tracking

  • Source limit management

  • Domain-based confidence ranking

  • Citation generation

  • Research progress logging

Instead of treating search tools as isolated functions, we now have an agent node that orchestrates them to gather and prepare research material.

What's Next?

With the Planner Agent generating research queries and the Researcher Agent collecting and organizing evidence, the next step is to introduce another critical component of the pipeline: the Critic Agent.

The Critic will help evaluate the research gathered so far and take our Autonomous Deep Research Agent one step closer to a more structured, quality-aware research workflow.


Project Resources

  • GitHub Repository: https://github.com/snsupratim/research-agent

  • Project Documentation: https://www.sndev.co/project/988de038-1e9a-4411-aac5-828477b52df8

This project is part of the Autonomous Deep Research Agent series on SN Dev, where we build real-world AI Engineering projects using Python, FastAPI, LangGraph, and Gemini.

Series Navigation

Up Next: Part 9

Continue following "Deep Research Agent" with Building the Critic Agent: Detecting Conflicting Research | Deep Research System Part 9.

Part 7Read Part 9

Community Discussion
0

Ask questions, discuss architecture, and share insights with other developers.

Sort:

Sign in to join the discussion and share your thoughts with other developers.

Sign In to Comment
Loading discussions…