Skip to content

feat: add Tavily search engine support to core search utility#1050

Closed
ParakhJaggi wants to merge 1 commit intoScrapeGraphAI:mainfrom
tavily-ai:feat/tavily-migration/core-search-engine
Closed

feat: add Tavily search engine support to core search utility#1050
ParakhJaggi wants to merge 1 commit intoScrapeGraphAI:mainfrom
tavily-ai:feat/tavily-migration/core-search-engine

Conversation

@ParakhJaggi
Copy link
Copy Markdown

Summary

  • Added Tavily as a fifth search engine option in research_web.py, alongside existing duckduckgo, bing, searxng, and serper backends
  • All existing providers remain unchanged (additive migration)
  • Tavily API key can be passed directly or read from TAVILY_API_KEY environment variable

Files changed

  • scrapegraphai/utils/research_web.py — Added tavily to valid engines, tavily_api_key field to SearchConfig, tavily_api_key parameter to search_on_web(), new _search_tavily() helper function, and dispatch branch
  • pyproject.toml — Added tavily-python>=0.5.0 to dependencies

Dependency changes

  • Added tavily-python>=0.5.0 to pyproject.toml core dependencies

Environment variable changes

  • Added TAVILY_API_KEY — required when using search_engine="tavily" (can also be passed as tavily_api_key parameter)

Notes for reviewers

  • The implementation follows the same pattern as the existing _search_serper() helper (API key validation, SDK call, URL extraction)
  • Falls back to TAVILY_API_KEY env var if no explicit key is provided
  • Includes ImportError handling for missing tavily-python package

🤖 Generated with Claude Code

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily migration is correct, complete, and additive with no regressions. SDK usage patterns are valid, the dispatch logic follows the existing structure, and both pyproject.toml and research_web.py are updated consistently. Two minor issues noted but neither blocks approval.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. dependencies Pull requests that update a dependency file enhancement New feature or request labels Mar 24, 2026
@tavily-ai tavily-ai closed this by deleting the head repository Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants