This repository was archived by the owner on Mar 31, 2026. It is now read-only.
feat: add Tavily as configurable search engine alongside SearXNG#1
Open
tavily-integrations wants to merge 2 commits intoJinFanZheng:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--engine tavily, keeping SearXNG as the defaultinternal/search/tavily.go— HTTP client that POSTs to the Tavily/searchREST API and maps results (title, url, content, score) into the existingSearchResulttypeTavilyAPIKeyfield toSearchConfigstruct, loaded fromTAVILY_API_KEYenv var ortavily_api_keyJSON config keySearchstruct with engine-dispatch logic inDo()to route between SearXNG and Tavily--engineflag to accepttavilyin addition tosearxngFiles changed
internal/config/config.go— AddedTavilyAPIKeytoSearchConfiginternal/config/loader.go— ReadTAVILY_API_KEYenv var; propagate field inmergeSearchConfiginternal/search/tavily.go— New file: Tavily REST API clientinternal/search/search.go— Added engine dispatch,TavilyClientfield, refactoredDo()intodoTavily/doSearXNGcmd/web-search/main.go— Accepttavilyas valid--enginevalue, pass engine toNewSearchDependency changes
net/http)Environment variable changes
TAVILY_API_KEY— required when using--engine tavily; SearXNG continues to work without itNotes for reviewers
--engine tavilyis used withoutTAVILY_API_KEYset, a clear error is returnednet/httpfor the Tavily REST API🤖 Generated with Claude Code
Automated Review
config.Load()(picking up env vars and JSON files), API auth usesAuthorization: Bearerheader, CLI descriptions document Tavily, andtopic/time_rangeparameters are properly mapped. The config layer changes (internal/config/config.goandinternal/config/loader.go) are correctly included in the diff despite not being listed in the implementation summary. SearXNG behaviour is fully preserved. No new dependencies are introduced — Tavily is implemented using the standard library only, which is consistent with the existing SearXNG client pattern. One minor issue noted below about Tavily topic validation.