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 15, 2026
s
sndev

Building AI Agent Tools | Rate Limiting & Source Credibility | Deep Research Agent | Part 5

GitHub RepositoryWatch on YouTube

β€œLearn to build reliable AI agent tools with Python. Implement request throttling, API retry handling, and domain-based source confidence scoring for an autonomous Deep Research Agent.”

Project SeriesPart 5 of 13

Deep Research Agent

Series Progress38%
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
P5
Building AI Agent Tools | Rate Limiting & Source Credibility | Deep Research Agent | Part 5
Current Part
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
Building the Researcher Agent with Web Search, arXiv & Source Ranking | Deep Research Agent Part 8
Available
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 4Part 6

Before an autonomous research agent can search the web, explore academic papers, and evaluate evidence, it needs a reliable set of tools.

In Part 5 of our Autonomous Deep Research Agent series, we begin building this tool layer. The focus is not just on making external requests: it is also about controlling how frequently those requests happen and introducing an initial mechanism for assessing source credibility.

1. Installing the Required Libraries

We start by extending the project's Python dependencies.

The episode introduces these libraries:

  • HTTPX and aiohttp – for making HTTP requests.

  • arXiv – for accessing academic research papers.

  • PyPDF – for reading PDF documents.

  • Tenacity – for retrying operations that fail temporarily.

These libraries prepare the project for different research sources and document formats. Tenacity is particularly useful because external requests can fail due to temporary network problems or service limitations.

Retries should be bounded and configured carefully. Repeatedly retrying requests without limits can create unnecessary traffic and make rate-limiting problems worse.

2. Why Autonomous Agents Need Request Throttling

An AI agent can execute tool calls much faster than a human. If a research workflow sends requests continuously, it may overload external services or trigger their rate limits.

To reduce this risk, we introduce a reusable asynchronous throttle function in the project's tools.py module.

The implementation tracks the last time each tool was called. Before a tool runs, it calculates how much time has elapsed since its previous call. If the required interval has not passed, the function waits before allowing the next request.

We use time.monotonic() to measure elapsed time. Unlike a wall-clock timestamp, a monotonic clock is designed for measuring time intervals without being affected by system clock adjustments.

Configurable Request Intervals

Rather than hardcoding delays throughout the application, we make them configurable through environment variables.

The episode introduces:

  • A general minimum tool interval of 1 second.

  • A separate arXiv minimum interval of 5 seconds.

The separate interval reflects the need to be more conservative when interacting with services that have stricter access expectations.

These are project configuration choices, not universal limits. Always follow the policies and access rules of the services you use.

3. Building a Domain Confidence Function

Finding a source does not automatically mean that its information is reliable.

We therefore introduce a simple domain-based confidence function. It extracts the hostname from a URL and compares it against predefined domain categories.

The episode groups domains into three categories:

  • High confidence: selected academic, scientific, government, and established publishing domains.

  • Medium confidence: selected general information and reference domains.

  • Default confidence: domains that do not match either predefined group.

The function assigns illustrative scores:

Category

Score

High confidence

0.90

Medium confidence

0.75

Default

0.55

These values are heuristic scores used by this project's initial implementation. They are not scientifically calibrated probabilities.

A domain alone cannot establish whether a particular page is accurate, whether its claims are supported, or whether the information is current. This score should therefore be treated as one signal among several, not as a final verdict on a source.

4. Preparing the Research Tool Layer

By the end of this episode, we have established two important building blocks:

  1. A throttle mechanism to control how frequently tools are called.

  2. A domain confidence function to provide an initial source-quality signal.

We also install the dependencies needed for web requests, academic research, PDF processing, and retry handling.

The episode begins the transition towards implementing the web-search tool, but the complete web-search and academic-search integrations are not finished here. Those are part of the continuing tool-development work.

5. What's Next?

With the initial tool infrastructure in place, the next step is to develop the research tools and connect them to the Researcher and Critic Agents.

As the project grows, these tools will support web research, academic-paper retrieval, evidence checking, and citation-related operations within the LangGraph workflow.

The larger goal is to build a research system that does more than retrieve information: it should also inspect, compare, and evaluate the evidence behind its findings.

Project Resources

  • YouTube series: Autonomous Deep Research Agent – Part 5

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

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

Follow SN Dev for more practical tutorials on Agentic AI, LangGraph, Python, and AI Engineering.

AgenticAI
AIEngineering
DeepResearchAgent
Series Navigation

Up Next: Part 6

Continue following "Deep Research Agent" with Building a Web Search Tool for AI Agents with Tavily API | Deep Research Agent Part 6.

Part 4Read Part 6

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…