Tavily Python

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

SDK
PyPI
v0.7.27
1,362stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
61/100Good
Development Activity64
Maintenance32
Community60
Maturity48
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
76/100Good
Architecture74
Code Quality76
Innovation70
Learning Curve82

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 6 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

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

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
99%
MIT

deepagents

AI Agents · AI Development

27,919

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
74
Dependency
Built with
Python99%
Updated today
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

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
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
Python
97%
MIT

local-deep-researcher

AI Assistants · AI Development

9,300

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
60
Repo Health
74
Technical
74
Dependency
Built with
Python97%
Updated 2 weeks ago
Python
74%
AGPL 3.0

OpenViking

Databases · AI Development

29,711

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

View details
84
Repo Health
75
Technical
65
Dependency
Built with
Python74%
Rust14%
Updated today
Python
69%
AGPL 3.0

Tracecat

Security · Automation · AI Agents

3,771

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
Python69%
TypeScript29%
Updated yesterday

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

Search