Skip to content

feat(search): add Tavily search provider#95

Open
teionarr wants to merge 1 commit into
SkyworkAI:mainfrom
teionarr:feat/tavily-search-tool
Open

feat(search): add Tavily search provider#95
teionarr wants to merge 1 commit into
SkyworkAI:mainfrom
teionarr:feat/tavily-search-tool

Conversation

@teionarr

@teionarr teionarr commented Jul 8, 2026

Copy link
Copy Markdown

What

Adds TavilySearch as a search provider alongside the existing Firecrawl / Brave / Bing / Google / DDGS backends.

Why

tests/test_report_tool.py already lists TAVILY_API_KEY as a required env var, but no Tavily provider existed in the codebase. This adds it, following the same Tool interface as the other search backends.

Changes

  • src/tool/default_tools/search/tavily_search.py — new TavilySearch(Tool), registered via @TOOL.register_module, returns List[SearchItem] / ToolResponse exactly like FirecrawlSearch.
  • Exported from src/tool/default_tools/search/__init__.py.
  • Registered in WebSearcherTool.search_tools (commented, matching the other key-requiring engines — enable by uncommenting + setting TAVILY_API_KEY).
  • tavily-python>=0.7.12 added to requirements.txt.

Notes

  • search_depth defaults to "basic" (1 credit / low latency); callers can opt into "advanced".
  • filter_year defaults to None (no date restriction) so current-year results aren't excluded.
  • country/lang are accepted for interface parity but not forwarded (Tavily expects full country names, not the ISO codes the shared interface passes) — same approach the other providers take with unused kwargs.
  • Follows the existing providers' graceful error handling (logs and returns partial/empty rather than raising into the agent loop).

Testing

Verified against the live Tavily API (tavily-python 0.7.26): search returns correctly-mapped SearchItem results with populated title/url/content. The provider's src.* imports are identical to FirecrawlSearch.

Adds TavilySearch alongside the existing Firecrawl/Brave/Bing/Google/DDGS
providers, following the same Tool interface (List[SearchItem] -> ToolResponse),
with search_depth defaulting to "basic" (1 credit) and opt-in "advanced".

- Registered via @TOOL.register_module and exported from the search package
- Wired into WebSearcherTool.search_tools (commented, matching the other
  key-requiring engines; enable by uncommenting + setting TAVILY_API_KEY)
- Adds tavily-python to requirements.txt

Also makes the existing TAVILY_API_KEY check in tests/test_report_tool.py
meaningful, which previously had no Tavily provider behind it.
@teionarr

teionarr commented Jul 8, 2026

Copy link
Copy Markdown
Author

Hi 👋 — this adds TavilySearch alongside the existing search providers, following the same Tool interface as FirecrawlSearch.

Motivation: tests/test_report_tool.py already requires TAVILY_API_KEY, but there was no Tavily provider behind it — this closes that gap.

Verified against the live Tavily API (tavily-python 0.7.26); results map cleanly to SearchItem. Kept it commented in search_tools to match how the other key-requiring engines (Firecrawl/Bing) are handled — happy to make it active by default instead if you'd prefer. Open to any interface tweaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant