ms-agent icon indicating copy to clipboard operation
ms-agent copied to clipboard

feat: add Tavily as configurable search engine in core search framework

Open tavily-integrations opened this issue 8 months ago • 1 comments

Summary

  • Added TavilySearch as a new search engine option alongside Exa, SerpAPI, and Arxiv
  • Follows the existing engine pattern: schema dataclasses + SearchEngine subclass + registration in all registries
  • Tavily results are mapped to the shared BaseResult schema for seamless downstream consumption

Files Changed

  • ms_agent/tools/search/search_base.py — Added TAVILY to SearchEngineType enum and 'tavily': 'tavily_search' to ENGINE_TOOL_NAMES
  • ms_agent/tools/search/tavily/__init__.py — New package init exporting TavilySearch, TavilySearchRequest, TavilySearchResult
  • ms_agent/tools/search/tavily/schema.py — New file with TavilySearchRequest and TavilySearchResult dataclasses
  • ms_agent/tools/search/tavily/search.py — New file with TavilySearch class using tavily-python SDK
  • ms_agent/tools/search/websearch_tool.py — Added 'tavily' to SUPPORTED_ENGINES, get_search_engine_class(), get_search_engine(), _api_keys init, and connect() engine instantiation
  • ms_agent/tools/search_engine.py — Added TAVILY branch in get_web_search_tool() factory and TAVILY_API_KEY support in env overrides
  • requirements/research.txt — Added tavily-python dependency

Dependency Changes

  • Added tavily-python to requirements/research.txt

Environment Variable Changes

  • Added TAVILY_API_KEY — required when using the Tavily engine

Notes for Reviewers

  • This is an additive change — all existing engines remain fully functional
  • Tavily can be selected via engine: tavily in agent YAML config or via the FIN_RESEARCH_SEARCH_ENGINE override
  • The TavilySearch.search() method maps Tavily API results (content → summary, url → id) to the shared BaseResult schema

🤖 Generated with Claude Code

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily migration is well-implemented and follows all existing patterns in the codebase. The additive strategy is respected: no existing engines are removed or altered. All factory functions (get_search_engine_class, get_search_engine, get_web_search_tool, WebSearchTool.connect) are correctly updated. The TavilySearch class, schema dataclasses, __init__.py, enum entry, tool-name mapping, and SUPPORTED_ENGINES tuple are all consistent with how Exa and SerpAPI are implemented. The tavily-python dependency is added to requirements/research.txt. The Tavily SDK is used correctly (TavilyClient.search(**kwargs) returning a dict with a results list). No critical or major issues found; only three minor documentation/style gaps.

tavily-integrations avatar Mar 24 '26 20:03 tavily-integrations

Summary of Changes

Hello, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces Tavily as a new, configurable search engine within the existing search framework. The change enhances the system's ability to perform AI-optimized web searches by providing an additional, high-relevance search option. The implementation adheres to current architectural patterns, ensuring that the new engine integrates smoothly and is easily configurable without impacting the functionality of other search providers.

Highlights

  • New Search Engine Integration: TavilySearch has been added as a new configurable search engine option, expanding the existing suite of Exa, SerpAPI, and Arxiv.
  • Standardized Implementation: The integration follows the established pattern of using schema dataclasses, a dedicated SearchEngine subclass, and registration across all relevant registries.
  • Unified Result Schema: Tavily search results are consistently mapped to the shared BaseResult schema, ensuring seamless consumption by downstream components.
  • Additive Change: This feature is purely additive, meaning all previously existing search engines remain fully functional and unaffected.
  • Configurability: Tavily can be selected as the search engine via agent YAML configuration or through the FIN_RESEARCH_SEARCH_ENGINE environment variable override.
  • New Dependency: The tavily-python library has been added to requirements/research.txt.
  • API Key Support: Support for TAVILY_API_KEY has been introduced, which is required when using the Tavily engine.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

gemini-code-assist avatar Mar 24 '26 20:03 gemini-code-assist