Skip to content

Feat: add tavily for search and scraper - #85

Closed
yashwanth-alapati wants to merge 6 commits into
LibreChat-AI:mainfrom
yashwanth-alapati:feat/tavily
Closed

yashwanth-alapati wants to merge 6 commits into
LibreChat-AI:mainfrom
yashwanth-alapati:feat/tavily

Conversation

@yashwanth-alapati

@yashwanth-alapati yashwanth-alapati commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Integrate tavily:

  • add tavily search for search provider in web search
  • add tavilly extract(scraper) for scraper provider in web search

MayRamati and others added 5 commits April 8, 2026 21:45
- Replace per-provider union types with `AnyScraperResponse` named type
- Add optional `scrapeUrls` batch method to `BaseScraper` interface
- Rename `raw_content` to `rawContent` in `TavilyScrapeResponse` (camelCase convention)
- Add `TavilySearchResult` and `TavilyExtractResult` named types
- Split `TAVILY_API_URL` into separate `tavilySearchUrl` and `tavilyExtractUrl` fields
- Add configurable `searchDepth` to `SearchConfig`
- Flatten `TavilyConfig` into `SearchToolConfig` via `SearchConfig` extension
Major fixes:
- Wrap `new URL().hostname` in try/catch to prevent single bad URL from
  discarding entire result set (Finding LibreChat-AI#1)
- Remove Tavily from country schema — Tavily API does not support
  country filtering (Finding LibreChat-AI#2)
- Split shared `TAVILY_API_URL` into `TAVILY_SEARCH_URL` and
  `TAVILY_EXTRACT_URL` to avoid env var collision (Finding LibreChat-AI#3)
- Reduce default timeout from 60s to 15s, matching other providers
  (Finding LibreChat-AI#4)
- Implement batch URL extraction via `scrapeUrls` — Tavily Extract
  supports up to 20 URLs per request (Finding LibreChat-AI#5)
- Remove dead `topStories` computation; let `news` flow through the
  existing `executeParallelSearches` merge pipeline (Finding LibreChat-AI#6)
- Use `scraper.extractMetadata()` abstraction instead of runtime
  `'metadata' in` check (Finding LibreChat-AI#8)
- Read `failed_results` from Tavily Extract API for actionable error
  messages (Finding LibreChat-AI#12)
- Add JSDoc for `'h'` → `'day'` time range approximation (Finding LibreChat-AI#13)
- Make `search_depth` configurable via `searchDepth` config (Finding LibreChat-AI#14)
- Hoist `TAVILY_TIME_RANGE_MAP` to module scope (Finding LibreChat-AI#15)
- Use batch-aware `scrapeMany` that delegates to `scrapeUrls` when
  available on the scraper instance
Covers constructor defaults, env var handling, single URL scraping,
batch scraping with chunking, mixed success/failure, extractContent,
and extractMetadata — 18 tests total.
@yashwanth-alapati yashwanth-alapati changed the title Feat/tavily Feat: add tavily for search and scraper Apr 9, 2026
@danny-avila

Copy link
Copy Markdown
Collaborator

Closing this contributor-fork PR because maintainer pushes to yashwanth-alapati/agents:feat/tavily are being rejected with HTTP 403, even though the PR reports maintainer_can_modify: true.

I continued the rebased/fixed work in the replacement maintainer-owned PR: #135.

@danny-avila danny-avila closed this May 3, 2026
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.

3 participants