Skip to content

feat: add Tavily web search as configurable option alongside DuckDuckGo#1

Open
tavily-integrations wants to merge 1 commit into
OperonAgent:mainfrom
Tavily-FDE:feat/tavily-migration/operon-duckduckgo-to-tavily
Open

feat: add Tavily web search as configurable option alongside DuckDuckGo#1
tavily-integrations wants to merge 1 commit into
OperonAgent:mainfrom
Tavily-FDE:feat/tavily-migration/operon-duckduckgo-to-tavily

Conversation

@tavily-integrations

Copy link
Copy Markdown

Summary

Adds Tavily Search API as a parallel web search option alongside the existing DuckDuckGo provider. When TAVILY_API_KEY is set, agents can invoke tavily_search by name. DuckDuckGo remains fully functional and unchanged.

Changes

  • tools/web_search.py — Added tavily_search(query, max_results) function using tavily-python SDK. Guarded by TAVILY_API_KEY env var and graceful import fallback.
  • tools/registry.py — Imported tavily_search; added tool descriptor, dispatch entry, web toolset group membership, and original-fn lookup entry.
  • core/toolsets.py — Added tavily_search to search, web, knowledge, core, and research toolset groups.
  • requirements.txt — Added tavily-python>=0.3.0 as a commented optional dependency.
  • .env.example — Added TAVILY_API_KEY under a new "Web Search" section.

Dependency changes

  • Added tavily-python>=0.3.0 (optional, comment-guarded in requirements.txt)

Environment variable changes

  • Added TAVILY_API_KEY (optional — tool is silently skipped if absent)

Notes for reviewers

  • This is an additive change — no existing DuckDuckGo code or behavior is modified.
  • The tavily_search function returns the same {success, results, error} schema as duckduckgo_search for consistency.
  • The function gracefully handles missing API key and missing package with descriptive error messages.

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The migration correctly adds Tavily as a parallel, optional web search tool alongside DuckDuckGo. All five listed files are updated, the Tavily SDK patterns are correct, runtime guards (missing API key, missing package) return graceful error dicts, and the response shape matches the existing duckduckgo_search contract. DuckDuckGo code is completely untouched. Two minor issues were found but neither blocks approval.

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