feat(llm): add configurable web search engines (Tavily, SearXNG)#9342
Draft
Kureii wants to merge 2 commits intoTriliumNext:mainfrom
Draft
feat(llm): add configurable web search engines (Tavily, SearXNG)#9342Kureii wants to merge 2 commits intoTriliumNext:mainfrom
Kureii wants to merge 2 commits intoTriliumNext:mainfrom
Conversation
Add Tavily and SearXNG as alternative web search engines alongside the default provider-built-in search. This enables web search for providers that lack built-in search (e.g. Ollama). - New web_search_tools.ts with Tavily API and SearXNG implementations - Settings UI for engine selection, API keys, instance URL - Configurable search timeout (default 15s, max 120s) - Fallback to provider default when custom engine lacks credentials - Options: llmWebSearchEngine, llmTavilyApiKey, llmSearxngUrl, llmSearchTimeout
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for custom web search engines (Tavily and SearXNG) for the LLM agent, allowing users to choose alternatives to the provider's built-in search. The changes include new UI settings, server-side configuration options, and the implementation of search tools using the ai package. Feedback was provided to refactor the search engine selection logic in BaseProvider to reduce code duplication when falling back to the default search tool.
Use customToolAdded flag instead of calling this.addWebSearchTool() in three separate places.
eliandoran
requested changes
Apr 11, 2026
Contributor
eliandoran
left a comment
There was a problem hiding this comment.
Haven't tested it yet, only checked out the settings page.
However, we need to make a pretty big structural change, having one option per search engine is not scalable:
- We already have the LLM provider system, which already supports API keys and thanks to the Ollama integation also a base URL.
- Just create a new type of providers, search engines.
- Don't break backward compatibility with old providers that might not have a type set.
- This will also allow the user to create multiple instances of the same search engine, for example.
- Make sure the UX is still easy to use.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Add Tavily and SearXNG as alternative web search engines alongside the default provider-built-in search. Includes a configurable timeout for all search requests.
Changes
base_provider.tswith fallback to provider defaultAbortSignal.timeout()applied to search fetch callsllmWebSearchEngine,llmTavilyApiKey,llmSearxngUrl,llmSearchTimeoutFiles (7 files, +241/-1)
apps/server/src/services/llm/web_search_tools.ts- New: Tavily & SearXNG implementationsapps/server/src/services/llm/providers/base_provider.ts- Engine routing + timeoutapps/server/src/services/options_init.ts- Option defaultsapps/server/src/routes/api/options.ts- Options whitelistpackages/commons/src/lib/options_interface.ts- Option type definitionsapps/client/src/widgets/type_widgets/options/llm.tsx-WebSearchSettingscomponentapps/client/src/translations/en/translation.json- Translation keys