Tavily Python

Official Python SDK for Tavily's search, extract, crawl, and research API

SDK
PyPI
v0.8.4
1,410 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
74 /100 Good
Development Activity 88
Maintenance 48
Community 68
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 74
Code Quality 76
Innovation 70
Learning Curve 82

Tavily Python is the official client for the Tavily API, a search engine purpose-built for AI agents and LLM applications. It wraps HTTP calls to Tavily’s search, extract, crawl, map, and research endpoints behind a small synchronous (TavilyClient) and asynchronous (AsyncTavilyClient) interface, handling auth, retries, and response parsing so agent frameworks don’t need to hand-roll HTTP requests.

Because Tavily is designed to return LLM-ready summarized results rather than raw HTML, the SDK is commonly used as a “web search tool” inside RAG pipelines and agent frameworks (LangChain, LlamaIndex, custom tool-calling loops) where an agent needs current information the model wasn’t trained on.

What You Get

  • Synchronous TavilyClient and asynchronous AsyncTavilyClient with matching method signatures for search, extract, crawl, and map
  • Automatic session pooling and connection reuse (test_session_pooling.py covers this) for lower-latency repeated calls
  • A typed exception hierarchy (errors.py) that maps Tavily API error responses to specific Python exceptions instead of generic HTTP errors
  • Support for passing a custom requests/httpx session for proxy, timeout, or retry customization
  • Token-aware helpers built on tiktoken for trimming search results to fit an LLM’s context window

Common Use Cases

  • Giving an LLM agent a “web search” tool that returns clean, summarized results instead of raw scraped HTML
  • Building RAG pipelines that need fresh, post-training-cutoff information from the live web
  • Crawling and mapping a website’s structure programmatically as a preprocessing step for a research or QA agent
  • Extracting clean article/page content from a list of URLs for downstream summarization

Under The Hood

Architecture - tavily.py (765 lines) and async_tavily.py (833 lines) each implement a client class with near-identical method surfaces, one built on requests.Session and the other on httpx.AsyncClient; both delegate error translation to a shared errors.py module so callers get the same exception types regardless of which client they use.

Tech Stack - Pure Python 3.8+, depending on requests, httpx, and tiktoken (for token-aware result trimming). No heavier framework dependencies, keeping it easy to drop into any agent stack.

Code Quality - A dedicated tests/ directory with per-feature test modules (test_search.py, test_crawl.py, test_map.py, test_research.py, test_errors.py, test_session_pooling.py, test_custom_session.py) plus a conftest.py fixture setup indicates decent coverage of both the happy path and session/error edge cases.

API Design - The API mirrors the underlying REST endpoints closely (search, extract, crawl, map), which keeps mental overhead low for anyone who has read Tavily’s API docs; sync and async clients expose the same method names, so switching between them in agent code is a near drop-in replacement.

Used by 7 apps in this directory

Python
100%
Apache 2.0

Agno

AI Development · Automation · Devops

42,358

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 4 days ago
Python
99%
MIT

deepagents

AI Agents · AI Development

29,818

The batteries-included Python agent harness — planning, sub-agents, filesystem, shell, memory, and skills bundled in, built on LangGraph.

View details
88
Repo Health
83
Technical
70
Dependency
Built with
Python 99%
Updated 4 days ago
Python
70%
Apache 2.0

GPT Researcher

AI Assistants · Productivity

29,650

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
91
Repo Health
91
Technical
63
Dependency
Built with
Python 70%
TypeScript 18%
Updated 6 days ago
Python
100%
MIT

hyperresearch

AI Agents · Developer Tools · Knowledge Management

3,691

A tier-adaptive 16-step deep research pipeline for Claude Code that produces adversarially-audited reports with full source provenance, backed by a persistent, searchable vault.

View details
79
Repo Health
85
Technical
72
Dependency
Built with
Python 100%
Updated 1 weeks ago
Python
97%
MIT

local-deep-researcher

AI Assistants · AI Development

9,357

A fully local web research assistant that iteratively searches, summarizes, and refines markdown reports using any Ollama or LMStudio model—no cloud or API keys required.

View details
59
Repo Health
74
Technical
75
Dependency
Built with
Python 97%
Updated 1 weeks ago
Python
75%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

38,819

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 75%
Rust 12%
Updated 4 days ago
Python
70%
AGPL 3.0

Tracecat

AI Agents · Automation · Security

3,816

Open-source agentic security automation platform that runs AI agents and durable workflows at scale with sandboxed execution.

View details
89
Repo Health
88
Technical
66
Dependency
Built with
Python 70%
TypeScript 28%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers