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:
- Search Providers: Services that perform the initial web search
- Scrapers: Services that extract content from web pages
- 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
Key | Type | Description | Example |
---|---|---|---|
serperApiKey | String | Environment 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
Key | Type | Description | Example |
---|---|---|---|
searchProvider | String | Specifies which search provider to use. | Options: "serper", "searxng" |
Scrapers
firecrawlApiKey
Key | Type | Description | Example |
---|---|---|---|
firecrawlApiKey | String | Environment 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
Key | Type | Description | Example |
---|---|---|---|
firecrawlApiUrl | String | Environment 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
Key | Type | Description | Example |
---|---|---|---|
scraperType | String | Specifies which scraper service to use. | Options: "firecrawl", "serper" |
Rerankers
jinaApiKey
Key | Type | Description | Example |
---|---|---|---|
jinaApiKey | String | Environment 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
Key | Type | Description | Example |
---|---|---|---|
cohereApiKey | String | Environment 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
Key | Type | Description | Example |
---|---|---|---|
rerankerType | String | Specifies which reranker service to use. | Options: "jina", "cohere" |
General Settings
scraperTimeout
Key | Type | Description | Example |
---|---|---|---|
scraperTimeout | Number | Timeout in milliseconds for scraper requests. | Default: 7500 |
safeSearch
Key | Type | Description | Example |
---|---|---|---|
safeSearch | Number | Safe 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:
- Set the environment variables specified in the YAML configuration
- 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