Skip to content

feat: add Tavily search provider to packages/core#22

Open
tavily-integrations wants to merge 1 commit intoOpenBrowserAI:mainfrom
Tavily-FDE:feat/tavily-migration/core-tavily-service
Open

feat: add Tavily search provider to packages/core#22
tavily-integrations wants to merge 1 commit intoOpenBrowserAI:mainfrom
Tavily-FDE:feat/tavily-migration/core-tavily-service

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

Adds Tavily as a configurable search provider alongside the existing Exa AI search service in packages/core. This is an additive (parallel) migration — no existing Exa functionality is modified or removed.

Changes

  • New file: packages/core/src/service/tavily-search.ts — Implements TavilySearchService with a static search() method using the official @tavily/core SDK. Mirrors the ExaSearchService interface pattern (static method returning Promise<string>).
  • packages/core/src/service/index.ts — Added TavilySearchService export.
  • packages/core/src/index.ts — Added TavilySearchService to the main barrel export.
  • packages/core/src/service/chat-service.ts — Extended the websearch options type with provider?: "exa" | "tavily" so callers can specify which search backend to use.
  • packages/core/package.json — Added @tavily/core as a runtime dependency.

Dependency changes

  • Added @tavily/core: ^0.6.1 to packages/core/package.json dependencies

Environment variable changes

  • TAVILY_API_KEY — required when using TavilySearchService (passed as apiKey parameter)

Notes for reviewers

  • Existing ExaSearchService and all its exports remain completely untouched.
  • The provider field on websearch options is optional and defaults behavior is unchanged.
  • Callers need to pass a Tavily API key explicitly to TavilySearchService.search().

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The additive Tavily migration for the core package is well-implemented. All five files identified in the plan are correctly modified. The @tavily/core SDK is used correctly (tavily({ apiKey }) + client.search()), TavilySearchService mirrors the ExaSearchService interface (static search()Promise<string>), the provider discriminator field is properly optional in ChatService.websearch (no regressions), and exports are wired through both barrel files and the main package index. Two minor gaps: no timeout guard (ExaSearchService uses 25 s), and the TAVILY_API_KEY env var noted in the migration plan is not documented anywhere (no .env.example update).

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