Skip to content

feat: add Tavily as configurable web search provider in extension#23

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

feat: add Tavily as configurable web search provider in extension#23
tavily-integrations wants to merge 1 commit intoOpenBrowserAI:mainfrom
Tavily-FDE:feat/tavily-migration/extension-tavily-option

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

Adds Tavily as a configurable web search provider alongside the existing Exa AI option in the Chrome extension's Options UI and background chat service.

What changed and why

  • New TavilySearchService (packages/core/src/service/tavily-search.ts): A static service class that calls the Tavily Search REST API via fetch, following the same pattern as ExaSearchService. Returns formatted search results optimized for LLM consumption.
  • Options UI (chromium-extension/src/options/index.tsx): Added a provider radio group (Exa AI / Tavily) shown when web search is enabled. Selecting Tavily shows a required Tavily API Key input; selecting Exa shows the existing optional Exa API Key input. The webSearchConfig Chrome storage schema now includes provider and tavilyApiKey fields.
  • Chat service (chromium-extension/src/background/agent/chat-service.ts): SimpleChatService now reads the provider and tavilyApiKey fields from webSearchConfig and routes websearchImpl() to TavilySearchService when provider is 'tavily', falling back to ExaSearchService for 'exa' or when provider is unset (backwards-compatible default).
  • Exports (packages/core/src/service/index.ts, packages/core/src/index.ts): TavilySearchService is exported from @openbrowser-ai/core.

Files changed

  • packages/core/src/service/tavily-search.ts (new)
  • packages/core/src/service/index.ts
  • packages/core/src/index.ts
  • chromium-extension/src/options/index.tsx
  • chromium-extension/src/background/agent/chat-service.ts

Dependency / env changes

  • No new npm dependencies added — TavilySearchService uses the native fetch API directly (same as ExaSearchService)
  • New tavilyApiKey and provider fields added to the webSearchConfig Chrome storage object (user-entered via Options UI)

Notes for reviewers

  • Default provider is 'exa' when absent in storage, preserving backwards compatibility
  • The Tavily API key is required when Tavily is selected (validated in the form)
  • The checkbox label was simplified from "Enable web search (Exa AI)" to "Enable web search" since provider selection is now separate

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The extension-level changes (Options UI and SimpleChatService routing) are correct, well-scoped, and backwards-compatible. However, this unit also includes three core library files (tavily-search.ts, service/index.ts, core/src/index.ts) that the prerequisite unit core-tavily-service was supposed to provide — and the tavily-search.ts implementation here uses raw fetch/REST rather than the @tavily/core SDK described in the prerequisite. This creates a potential merge conflict with the already-completed prerequisite. The extension-specific code is clean and functional, so this is approved with one major flag requiring reconciliation before integration.

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