Skip to content

feat: add Tavily as configurable search provider alongside SearxNG - #9

Open
tavily-integrations wants to merge 2 commits into
Skelf-Research:mainfrom
Tavily-FDE:feat/tavily-migration/polymathy-searxng-to-tavily
Open

feat: add Tavily as configurable search provider alongside SearxNG#9
tavily-integrations wants to merge 2 commits into
Skelf-Research:mainfrom
Tavily-FDE:feat/tavily-migration/polymathy-searxng-to-tavily

Conversation

@tavily-integrations

Copy link
Copy Markdown

Summary

  • Added Tavily as an optional search provider that can be used alongside the existing SearxNG integration
  • Search provider is selected at runtime via the SEARCH_PROVIDER env var (defaults to searxng)
  • Tavily integration uses direct reqwest HTTP calls to https://api.tavily.com/search — no new Cargo dependencies needed
  • Tavily's response naturally returns results[].url, matching the shape process_search_results already consumes

Files changed

  • src/api.rs — Added tavily_search() async function; modified search_and_index() to branch on SEARCH_PROVIDER env var
  • src/search.rs — Added TavilyResult and TavilyResponse structs for typed deserialization
  • sample.env — Added SEARCH_PROVIDER=searxng (default) and TAVILY_API_KEY=<your_key>

Dependency changes

  • None — reqwest with JSON feature is already in Cargo.toml

Environment variable changes

  • Added SEARCH_PROVIDER (default: searxng; set to tavily to use Tavily)
  • Added TAVILY_API_KEY (required when SEARCH_PROVIDER=tavily)

Notes for reviewers

  • SearxNG code path is completely preserved and remains the default
  • Rust toolchain was not available in the CI environment for compilation verification; please confirm cargo check passes
  • Tavily API key is passed in the POST body per the Tavily REST API convention

Automated Review

  • Passed after 2 attempt(s)
  • Final review: All 4 review fixes from the re-implementation plan are correctly addressed. Bearer token auth is valid for Tavily API. The raw Tavily response shape ({"results": [{"url": "..."}]}) is already compatible with process_search_results — no normalization needed. No new Cargo dependencies required. SearxNG remains the default (backward compatible). Only minor doc comment issues remain, nothing blocking.

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