Docs
βš™οΈ Configuration
librechat.yaml
Settings
Web Search

Web Search Configuration

The webSearch configuration allows you to customize the web search functionality within LibreChat, including search providers, content scrapers, and result rerankers.

Overview

The web search feature consists of three main components:

  1. Search Providers: Services that perform the initial web search
  2. Scrapers: Services that extract content from web pages
  3. Rerankers: Services that reorder search results for better relevance

Example

webSearch
webSearch:
  # Search Provider Configuration
  serperApiKey: "${SERPER_API_KEY}"
  searchProvider: "serper" # Options: "serper", "searxng"
 
  # Scraper Configuration
  firecrawlApiKey: "${FIRECRAWL_API_KEY}"
  firecrawlApiUrl: "${FIRECRAWL_API_URL}"
  scraperType: "firecrawl" # Options: "firecrawl", "serper"
 
  # Reranker Configuration
  jinaApiKey: "${JINA_API_KEY}"
  cohereApiKey: "${COHERE_API_KEY}"
  rerankerType: "jina" # Options: "jina", "cohere"
 
  # General Settings
  scraperTimeout: 7500 # Timeout in milliseconds for scraper requests (default: 7500)
  safeSearch: 1 # Options: 0 (OFF), 1 (MODERATE - default), 2 (STRICT)

Search Providers

serperApiKey

KeyTypeDescriptionExample
serperApiKeyStringEnvironment variable name for the Serper API key. If not set in .env, users will be prompted to provide it via UI.${SERPER_API_KEY}

Note: Get your API key from Serper.dev

searchProvider

KeyTypeDescriptionExample
searchProviderStringSpecifies which search provider to use.Options: "serper", "searxng"

Scrapers

firecrawlApiKey

KeyTypeDescriptionExample
firecrawlApiKeyStringEnvironment variable name for the Firecrawl API key. If not set in .env, users will be prompted to provide it via UI.${FIRECRAWL_API_KEY}

Note: Get your API key from Firecrawl.dev

firecrawlApiUrl

KeyTypeDescriptionExample
firecrawlApiUrlStringEnvironment variable name for the Firecrawl API URL. If not set in .env, users will be prompted to provide it via UI.${FIRECRAWL_API_URL}

Note: This is optional and only needed if you’re using a custom Firecrawl instance.

scraperType

KeyTypeDescriptionExample
scraperTypeStringSpecifies which scraper service to use.Options: "firecrawl", "serper"

Rerankers

jinaApiKey

KeyTypeDescriptionExample
jinaApiKeyStringEnvironment variable name for the Jina API key. If not set in .env, users will be prompted to provide it via UI.${JINA_API_KEY}

Note: Get your API key from Jina.ai

cohereApiKey

KeyTypeDescriptionExample
cohereApiKeyStringEnvironment variable name for the Cohere API key. If not set in .env, users will be prompted to provide it via UI.${COHERE_API_KEY}

Note: Get your API key from Cohere Dashboard

rerankerType

KeyTypeDescriptionExample
rerankerTypeStringSpecifies which reranker service to use.Options: "jina", "cohere"

General Settings

scraperTimeout

KeyTypeDescriptionExample
scraperTimeoutNumberTimeout in milliseconds for scraper requests.Default: 7500

safeSearch

KeyTypeDescriptionExample
safeSearchNumberSafe search filtering level. 0 = OFF (no filtering), 1 = MODERATE (default), 2 = STRICT (maximum filtering).Default: 1 (MODERATE)

Note: Safe search levels align with standard search API conventions. MODERATE filtering is enabled by default to provide reasonable content filtering while maintaining search effectiveness.

Notes

  • API keys can be configured in two ways:
    1. Set the environment variables specified in the YAML configuration
    2. If environment variables are not set, users will be prompted to provide the API keys via the UI
  • The configuration supports multiple services for each component (providers, scrapers, rerankers)
  • If a specific service type is not specified, the system will try all available services in that category
  • Safe search provides three levels of content filtering: OFF (0), MODERATE (1), and STRICT (2)
  • Never put actual API keys in the YAML configuration - only use environment variable names