Overview
Web Search allows agents to:Real-Time Search
Search the web for current information
Content Scraping
Extract and analyze web page content
Result Reranking
Improve relevance with AI reranking
Source Citations
Provide sources and references
Configuration
Configure web search in yourlibrechat.yaml:
librechat.yaml
Components
Search Providers
Choose your search engine:- Serper
- SearXNG
Google Search API through Serper.dev:Setup:
- Sign up at serper.dev
- Get your API key
- Set
SERPER_API_KEYenvironment variable
- Google search results
- Fast and reliable
- Generous free tier
Content Scrapers
Extract content from web pages:- Firecrawl
- Basic Scraper
Advanced web scraping with clean content extraction:Setup:
- Sign up at firecrawl.dev
- Get your API key
- Set environment variable
- Clean markdown extraction
- JavaScript rendering
- Removes ads and clutter
- Configurable timeouts
Result Rerankers
Improve search result relevance:- Jina AI
- Cohere
Neural reranking with Jina AI:Setup:
- Sign up at jina.ai
- Get your API key
- Set
JINA_API_KEYenvironment variable
- Neural reranking models
- Multilingual support
- High accuracy
Enabling Web Search
For Agents
Enable web search in agent tools:For Standard Chats
Enable web search in model parameters:Interface Configuration
Control user access to web search:librechat.yaml
Using Web Search
Search Queries
The AI automatically formulates search queries:Citation Format
Web search results include citations:Search Categories
Web search authentication is organized by categories:- Providers
- Scrapers
- Rerankers
Search engine selection:
- Serper: Google search via API
- SearXNG: Metasearch engine
Safe Search
Control content filtering:Filter search results by content safety level
librechat.yaml
off: No filteringmoderate: Filter explicit content (default)strict: Strict filtering
Advanced Configuration
Timeout Settings
Configure timeouts for scrapers:librechat.yaml
Custom Firecrawl Options
Configure Firecrawl behavior:librechat.yaml
Authentication Types
Web search supports different authentication modes:- System-Defined
- User-Provided
API keys configured in environment:Shared across all users.
Example Configurations
Basic Setup
Minimal configuration with Serper:librechat.yaml
.env
Full-Featured Setup
Complete configuration with all services:librechat.yaml
.env
Self-Hosted Setup
Using SearXNG with basic scraper:librechat.yaml
.env
Model Integration
OpenAI Models
Web search as a tool:OpenRouter
Special handling for OpenRouter:Anthropic Claude
Native tool integration:Best Practices
Cost Management: Web search APIs have usage costs - configure wisely
Troubleshooting
Web Search Not Working
Web Search Not Working
Check:
- API keys are correctly set in environment
- At least one search provider is configured
web_searchis enabled in agent tools or model parameters- No rate limiting or API quota issues
Poor Search Results
Poor Search Results
Solutions:
- Enable a reranker (Jina or Cohere)
- Adjust safe search settings
- Use more specific search queries
- Try different search provider
Scraping Failures
Scraping Failures
Solutions:
- Increase
scraperTimeout - Use Firecrawl for JavaScript-heavy sites
- Check firewall/network restrictions
- Verify target site allows scraping
Slow Performance
Slow Performance
Optimizations:
- Reduce
scraperTimeoutfor faster fails - Skip reranking for speed
- Use basic scraper instead of Firecrawl
- Cache frequent searches
Environment Variables
Complete list of web search environment variables:Example Use Cases
Research Assistant
Research Assistant
News Aggregator
News Aggregator
Fact Checker
Fact Checker
Related Features
Agents
Use web search with autonomous agents
File Search
Search uploaded documents
Actions
Call external APIs for data
MCP
Custom tool integrations