Skip to main content
Multi-provider web search with automatic provider fallback, in-memory caching, and AI-optimized output formats.

Installation

Install this tool individually:
Or install all tools:

Configuration

Provider Priority Entry

Each entry in providerPriority supports:
API keys are set directly in config. No environment variables are read automatically by this plugin. If you prefer not to hardcode keys, you can reference env vars via your config file’s variable interpolation (e.g. "apiKey": "${TAVILY_API_KEY}").

Prerequisites

Config Examples

Basic setup with Tavily and Brave:

Using environment variable interpolation for keys:

High availability with a backup Tavily key:

Cost-optimized with longer cache:

AI-optimized output for direct LLM consumption:

Usage

The websearch plugin provides a websearch tool that agents can use to perform web searches.

Basic search (tries providers in priority order)

Tries providers in array order until first success or all providers exhausted.

Search with specific provider

Use a specific provider directly (bypasses priority system). Available providers: tavily, brave, exa, websearchapi.

Limit results

Limit number of results (1-20, default: 10).

Custom output format

Output format options:
  • --format readable - Human-friendly text with titles, URLs, snippets (default)
  • --format json - Machine-readable JSON with full metadata
  • --format markdown - Markdown format with frontmatter for documentation

AI-generated direct answer

Returns direct answer with source citations (currently Tavily-only).

Extract content from URL

Uses local content extraction (Mozilla Readability) to extract readable content as Markdown.

Commands Reference

Architecture

Priority-Based Fallback

Circuit Breaker Pattern

Each provider has a circuit breaker that:
  • Opens after 3 consecutive failures
  • Remains open for 1 minute
  • Prevents cascading failures
  • Resets on success or after timeout
  • State stored in-memory (clean slate on restart)

Request Caching

In-memory cache with TTL:
  • Normalizes query (lowercase, trimmed)
  • Returns cached results if hit
  • Expires after TTL (default: 5 minutes)
  • Automatic cleanup on cache miss
  • Reduces API usage by 50-90% for repeated queries

Content Extraction Pipeline

Mozilla Readability: Extracts main article content, removes clutter
Turndown + GFM: Converts HTML to clean Markdown with code block support

Features

  • Multi-provider support: Tavily, Brave, Exa (planned), WebSearchAPI (planned)
  • Provider priority system: Array order determines priority
  • Automatic fallback: Try next provider on failure (configurable: try-all or fail-fast)
  • Circuit breaker pattern: Prevents cascading failures
  • Request caching: In-memory caching with configurable TTL
  • Retry with exponential backoff: Handle transient errors gracefully
  • Local content extraction: Mozilla Readability + Turndown for Markdown
  • Multiple output formats: Human-readable, JSON, Markdown
  • AI-optimized output: JSON format with rich metadata for direct LLM consumption
  • Config-only API keys: No implicit environment variable reads

Performance

Caching Efficiency

  • Memory overhead: ~20 bytes per cached query
  • Cache hit speedup: 250x faster (<1ms vs 250ms API call)
  • API cost reduction: 50-90% for repeated queries (typical agent workloads)

Provider Priority Efficiency

  • Configuration overhead: Zero (array order, no sorting at runtime)
  • Runtime overhead: O(n) where n = providers tried (usually 1 due to early exit)
  • Automatic fallback: Self-healing without manual intervention

License

MIT