Skip to content

feat: add Tavily as a parallel search engine option#70

Open
tavily-integrations wants to merge 1 commit into
Aas-ee:mainfrom
Tavily-FDE:feat/tavily-migration/open-websearch-tavily-engine
Open

feat: add Tavily as a parallel search engine option#70
tavily-integrations wants to merge 1 commit into
Aas-ee:mainfrom
Tavily-FDE:feat/tavily-migration/open-websearch-tavily-engine

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

  • Added Tavily as an opt-in search engine alongside existing engines (Bing, DuckDuckGo, Brave, etc.)
  • Tavily is selectable via DEFAULT_SEARCH_ENGINE=tavily or by including 'tavily' in the engines list
  • Tavily engine is silently skipped if TAVILY_API_KEY is not set, preserving zero-config behavior

Files changed

  • package.json — Added @tavily/core (^0.7.2) as a runtime dependency
  • src/config.ts — Added 'tavily' to defaultSearchEngine type union and validSearchEngines array; added tavilyApiKey field reading TAVILY_API_KEY from environment
  • src/core/search/searchEngines.ts — Added 'tavily' to SUPPORTED_SEARCH_ENGINES tuple and normalizeEngineName switch
  • src/engines/tavily/tavily.ts — New file implementing SearchEngineExecutor using @tavily/core, mapping Tavily results to SearchResult[]
  • src/runtime/createRuntime.ts — Registered Tavily executor in the engine map, conditional on TAVILY_API_KEY being set

Dependency changes

  • Added @tavily/core ^0.7.2 to dependencies in package.json

Environment variable changes

  • Added TAVILY_API_KEY (required to activate the Tavily engine)

Notes for reviewers

  • All existing engines are untouched — this is a purely additive change
  • Tavily API limits max results to 20, so the executor caps the limit accordingly
  • TypeScript compiles cleanly with no errors

🤖 Generated with Claude Code

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily engine integration is well-implemented and correct. The additive approach is consistent with the existing engine pattern. All required locations (config types, validation lists, searchEngines constants, normalizeEngineName switch, runtime registration) are updated. The @tavily/core SDK is used correctly, result mapping matches the SearchResult interface, and the conditional registration on TAVILY_API_KEY is the right pattern for optional API-key-gated engines. No regressions introduced.

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