Skip to content

feat: add Tavily as configurable search provider alongside SearXNG#16

Open
tavily-integrations wants to merge 1 commit intoSPThole:mainfrom
Tavily-FDE:feat/tavily-migration/coexistai-searxng-to-tavily
Open

feat: add Tavily as configurable search provider alongside SearXNG#16
tavily-integrations wants to merge 1 commit intoSPThole:mainfrom
Tavily-FDE:feat/tavily-migration/coexistai-searxng-to-tavily

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

  • Added Tavily as an alternative search backend in SearchWeb, selectable via SEARCH_PROVIDER env var
  • SearXNG remains the default provider; all existing SearXNG infrastructure is unchanged
  • Tavily results are normalized to match SearXNG result format (link, title, snippet keys) for seamless downstream compatibility

Files changed

  • requirements.txt — Added tavily-python dependency
  • model_config.py — Added SEARCH_PROVIDER (default 'searxng') and TAVILY_API_KEY config vars
  • utils/websearch_utils.py — Extended SearchWeb class with Tavily client init and _tavily_search() method; query_search() routes based on provider
  • .env — Documented SEARCH_PROVIDER and TAVILY_API_KEY as optional commented-out vars
  • docker-compose.yml — Added SEARCH_PROVIDER and TAVILY_API_KEY as optional env entries on the app service

Dependency changes

  • Added tavily-python to requirements.txt

Environment variable changes

  • SEARCH_PROVIDER — optional, defaults to searxng; set to tavily to use Tavily
  • TAVILY_API_KEY — required only when SEARCH_PROVIDER=tavily

Notes for reviewers

  • This is an additive change; no existing SearXNG behavior is modified
  • The Tavily search uses search_depth="basic" (1 credit per query) for cost efficiency
  • Result normalization ensures all downstream code that consumes search results continues to work unchanged

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily migration is correct, additive, and well-scoped. The implementation properly routes between SearXNG and Tavily based on SEARCH_PROVIDER, normalizes Tavily results to match the existing dict format (link/title/snippet), and covers all required files. No regressions to existing SearXNG functionality. Three minor issues noted but none are blockers.

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