AI & LLM Tools

LibreChat Web Search Setup Guide

J
James Eriksson
··13 min read
Enable web search in LibreChat with Serper, SearXNG, Tavily, or Keenable. Step-by-step YAML config, scraper setup, troubleshooting, and privacy trade-offs.
TL;DR
  • Web search lets your LibreChat model answer time-sensitive questions by querying the live internet in real time.
  • You configure three components: a search provider (Serper, SearXNG, Tavily, or Keenable), a scraper (Firecrawl or native), and optionally a reranker (Jina or Cohere).
  • Serper is easiest to start with; SearXNG is best for privacy and self-hosted setups.
  • Configuration happens entirely in librechat.yaml with minimal YAML; restart LibreChat after editing.
  • Common failures (timeouts, empty results, SSRF blocks) are usually fixed by adjusting scraper timeout or switching scrapers.

LibreChat's web search feature enables your AI models to pull current information from the internet in real time. Unlike retrieval-augmented generation (RAG), which searches your own documents, web search lets the model answer questions about recent events, breaking news, and live data.

Enabling web search requires three choices: which search provider to query, which content scraper to use, and whether to rerank results. This guide walks you through configuring each, comparing your options, and troubleshooting common setup failures.

What is Web Search in LibreChat (and Why You Want It)

LibreChat's web search integrates live internet access into your chat conversations. When you enable it, the model can respond to queries about current events, stock prices, weather, or any publicly available information without waiting for your knowledge cutoff date.

The feature runs in three steps. First, LibreChat sends your query to a search provider (Serper, SearXNG, Tavily, or Keenable) to retrieve URLs. Second, it extracts the full text from those pages using a scraper (Firecrawl, Tavily, or a provider-native option). Third, it optionally reranks the results by relevance using Jina, Cohere, or no reranker at all. The model then synthesizes the extracted content into your answer.

You want this if your users ask time-sensitive questions: current stock valuations, today's weather, recent company announcements, or what happened this week. It also solves the "data cutoff" problem. Instead of saying "my knowledge ends in April 2024," your model responds with facts from today.

The tradeoff: web search adds latency (typically 2-5 seconds per query), costs (per search, per URL, per rerank), and requires API keys or a self-hosted search engine. The benefit is relevance and recency that local models cannot match alone.

The Three Components: Search Providers, Scrapers & Rerankers

Web search in LibreChat has a modular architecture. You can mix and match components based on your privacy needs, budget, and setup complexity.

Search providers find the URLs. They ingest your query and return a ranked list of URLs (usually 10-20 results). LibreChat supports Serper (commercial, US-based), SearXNG (open-source, self-hosted), Tavily (specialized for AI search), and Keenable (European alternative).

Scrapers extract the content. After the search provider returns URLs, the scraper fetches the full text from each page. This is critical because the URL alone is useless; you need the article body. Firecrawl is the most robust third-party option. Serper, Tavily, and Keenable also offer native scraping.

Rerankers sort results by relevance. The search provider's ranking is often good but not perfect for AI use cases. Reranking re-scores the results using a relevance model, so the most relevant content bubbles to the top. Jina and Cohere offer reranking; many teams skip this step to save cost and latency.

You configure all three in your librechat.yaml file. A minimal setup might be: Serper for search, Firecrawl for scraping, no reranker. A privacy-focused setup might be: SearXNG (self-hosted) for search, Firecrawl for scraping, no reranker. A performance-optimized setup might be: Tavily for search+scraping, Jina for reranking.

Search Provider Comparison: Serper vs. SearXNG vs. Tavily vs. Keenable

Your search provider is the first decision. Here is what each brings:

Serper is a commercial search API backed by real Google Search results (licensed via Serper, not directly from Google). It returns high-quality results and integrates easily. Cost: Serper charges per query (typically $0.005-0.01 per search depending on volume). Setup: Requires an API key. Best for: Teams comfortable with commercial services and willing to pay for reliability. Downside: Logs your queries; your search data flows through Serper's servers.

SearXNG is an open-source metasearch engine. It aggregates results from multiple sources (Google, Bing, DuckDuckGo, etc.) without relying on any single provider. You run it yourself, in Docker or Kubernetes. Cost: Free (you host it). Setup: More complex; you must run a SearXNG instance. Best for: Privacy-conscious teams, GDPR-sensitive deployments, on-premise installations. Downside: Slower than commercial APIs (10-20 second response times) because it queries multiple backends sequentially. You own the infrastructure cost.

Tavily is purpose-built for AI. It returns fewer, higher-quality results and handles scraping natively (so you do not need a separate scraper). Its results are optimized for LLM consumption, not human browsing. Cost: Tavily offers a free tier (1,000 searches/month) and paid tiers. Setup: API key, simple. Best for: Teams prioritizing quality over breadth, or those already using Tavily's API in other contexts. Downside: Fewer results per query (typically 5-10 vs 20+); higher cost for high-volume deployments.

Keenable is a European alternative, often compliant with stricter data residency requirements. Cost and setup details are less documented in public sources. Best for: EU-based teams with GDPR/data residency mandates. Downside: Smaller ecosystem; less community documentation.

Quick reference table:

ProviderCost ModelSelf-HostedSetup DifficultyBest For
SerperPer-query ($0.005-0.01)NoEasyCommercial, budget-friendly
SearXNGFree (you host)YesMediumPrivacy, GDPR, on-premise
TavilyFree tier + paidNoEasyQuality, AI-focused
KeenableTBDPossiblyMediumEU data residency

For most teams starting out: begin with Serper (lowest barrier, predictable cost) or Tavily (better quality, free tier). Move to SearXNG if privacy or data residency becomes a blocker.

Step-by-Step: Enable Web Search in Your librechat.yaml

Web search is configured entirely in your librechat.yaml file under a webSearch section. Here is a minimal working example with Serper:

webSearch:
  enabled: true
  searchProvider: serper
  serper:
    apiKey: "YOUR_SERPER_API_KEY"
  scraper: firecrawl
  firecrawl:
    apiKey: "YOUR_FIRECRAWL_API_KEY"
    timeout: 8000
  reranker: none

Breakdown:

  • enabled: true turns on web search globally
  • searchProvider: serper tells LibreChat to use Serper
  • serper.apiKey is your Serper API key (get it at serper.dev)
  • scraper: firecrawl tells LibreChat to use Firecrawl for content extraction
  • firecrawl.apiKey is your Firecrawl API key (get it at firecrawl.dev)
  • timeout: 8000 sets the scraper timeout to 8 seconds; longer timeouts allow slow sites to finish loading
  • reranker: none skips reranking (fast, cheap, acceptable for most use cases)

Here is a self-hosted example using SearXNG:

webSearch:
  enabled: true
  searchProvider: searxng
  searxng:
    baseUrl: "YOUR_SEARXNG_BASEURL"  # Replace with your SearXNG instance address
    enabled_engines:
      - google
      - bing
      - duckduckgo
  scraper: firecrawl
  firecrawl:
    apiKey: "YOUR_FIRECRAWL_API_KEY"
    timeout: 8000
  reranker: none

Key differences:

  • searchProvider: searxng tells LibreChat to query your local SearXNG instance
  • baseUrl points to where SearXNG is running (e.g., the address of your Docker container)
  • enabled_engines lists which upstream search engines SearXNG should query (you can mix Google, Bing, DuckDuckGo, etc.)
  • Still using Firecrawl for scraping (you can use SearXNG's native scraper too, but Firecrawl is more reliable)

To deploy this:

  1. Get API keys for your chosen search provider and scraper. (Serper: serper.dev, Tavily: tavily.com, Firecrawl: firecrawl.dev.)
  2. Edit your librechat.yaml and add the webSearch section above. Use the minimal Serper example if you are unsure.
  3. Restart your LibreChat container: docker restart librechat (or redeploy if using Kubernetes).
  4. Open a chat conversation and enable web search in the UI (usually a toggle button in the chat interface).
  5. Ask a question about something recent (e.g., "What is the latest OpenAI announcement?") to test it.

If it works, you will see a brief "searching" indicator and then an answer with cited sources. If it fails, jump to the troubleshooting section below.

Configuring Scrapers: Extracting Page Content

The scraper is the second critical piece. The search provider returns URLs; the scraper extracts the actual text so the model has something to read.

Firecrawl is the most popular third-party choice. It handles JavaScript rendering (important for modern websites), CSS parsing, and timeout management. Configuration is minimal: just provide your API key and set a timeout.

scraper: firecrawl
firecrawl:
  apiKey: "YOUR_FIRECRAWL_API_KEY"
  timeout: 8000  # milliseconds

Increase the timeout if you are scraping slow sites; decrease it if you want faster, shallower results.

Tavily's scraper is native to Tavily. If you choose Tavily as your search provider, you can skip Firecrawl and use Tavily's extraction directly. This reduces API calls and latency.

SearXNG's scraper is built in and free (runs on your instance). It is lighter-weight than Firecrawl but less robust for JavaScript-heavy sites.

Serper Scrape is Serper's native scraper. Similar tradeoff: tightly integrated but less full-featured than Firecrawl.

Recommendation: For cloud setups, use Firecrawl. It is worth the cost (typically $0.01-0.02 per URL). For self-hosted SearXNG, use SearXNG's built-in scraper to keep everything local. If you are already paying for Tavily, use Tavily's scraper; it is optimized for AI queries.

Reranking: Sorting Results for Relevance

Reranking improves answer quality by re-scoring scraped results. Instead of using the search provider's ranking (which is optimized for human browsing), a reranking model scores each result for relevance to your exact query.

Example: You ask "How do I configure Kubernetes ingress with TLS?" The search provider might return:

  1. A blog about Kubernetes autoscaling (top-ranked by general SEO)
  2. A tutorial on ingress TLS (lower-ranked but more relevant)
  3. A Kubernetes certification guide (generic)

A reranker would bump result #2 to the top, filtering out the noise.

Jina AI's reranker is the most accessible. It is free for modest volumes and adds 1-2 seconds per query.

reranker: jina
jina:
  apiKey: "YOUR_JINA_API_KEY"

Cohere's reranker is more sophisticated but requires separate setup and billing.

No reranker (reranker: none) skips this step entirely. For most teams, this is fine. The search provider's ranking is already decent, and the model is smart enough to deprioritize irrelevant results when synthesizing answers.

Recommendation: Start with no reranker. If answer quality degrades on complex multi-concept queries, add Jina. Cohere is overkill unless you are building a search product (not a chat application).

Troubleshooting: Why Web Search Isn't Working

Timeout errors ("web search timed out after 8000ms")

This usually means either the scraper is slow or the search provider is slow. First, increase the scraper timeout to 15000ms (15 seconds). If that does not help, check if your chosen search provider is rate-limiting you (happens with free tiers). If using Serper or Tavily, verify your API key is correct and has remaining quota.

For SearXNG, timeouts are common if you are querying slow upstream sources (e.g., some instances of Google take 20+ seconds). Try removing the slowest engines from enabled_engines (keep only google and duckduckgo).

Empty results (model says "I found no relevant results")

Two causes:

  1. The scraper succeeded but returned empty content (the URLs are broken or blocked). Manually test by opening those URLs in a browser; if the page loads for you, the scraper might be getting blocked. Try Firecrawl if you are using a lighter scraper.
  2. The search provider returned results but Firecrawl failed to extract them. Check Firecrawl's logs. If many requests are failing, you may be hitting a bot-detection wall (common on news sites). Firecrawl has anti-bot features, but some sites still block it.

Rate limiting ("429 too many requests")

You are hitting API rate limits on your search provider or scraper. Reduce query frequency or upgrade your plan. For SearXNG, this usually means you are querying too many upstream sources too fast. Add rate-limiting to your LibreChat config or reduce the number of results per search.

SSRF protection blocking SearXNG

If you are running a self-hosted SearXNG instance behind a firewall, your search provider IP might be blocked by sites' SSRF (Server-Side Request Forgery) protection. This prevents web servers from being probed by internal requests. Solutions:

  1. Use a residential proxy for SearXNG requests (adds cost and latency).
  2. Switch to a commercial provider like Serper or Tavily (they have IP reputation and are not blocked).
  3. Disable SSRF protection on the sites you need (usually not an option).

Web search toggle not showing in UI

Two reasons:

  1. Web search is not enabled in librechat.yaml (check enabled: true).
  2. Your user role lacks permission. In LibreChat's admin panel, navigate to Settings > Permissions and ensure the user's role allows web search access.

Quick test: SSH into your LibreChat container and check if the config was loaded:

docker exec librechat cat /app/librechat.yaml | grep -A 5 webSearch

You should see the webSearch section with your provider.

Privacy & Data Retention Considerations

Web search introduces external dependencies. Before going live, understand who sees your queries.

Serper: Your queries are logged on Serper's servers. Serper claims no long-term retention, but your query text traverses Serper's infrastructure. If you handle sensitive data or customer queries, this is a privacy issue.

SearXNG: Queries hit multiple upstream sources (Google, Bing, etc.), so your query reaches those providers too. However, if you self-host, you control the logs. No central authority records your searches.

Tavily: Specifically built for AI, with privacy-forward defaults. Tavily does not log query content long-term. Recommended if privacy is a priority and you want a cloud provider.

Keenable: Limited public documentation, but marketed as GDPR-compliant and EU-based.

For GDPR compliance or handling regulated data (health, finance, legal), consider SearXNG (self-hosted, no external logs) or Tavily (privacy-first commercial option). Do not use Serper for customer data without explicit consent and data processing agreements.

Managed hosting solutions like Opsily's managed LibreChat hosting can abstract this complexity away. They handle provider selection, key rotation, and compliance configuration for you.

For more detail on privacy and data handling, see our post on LibreChat vs OpenAI data privacy.

Frequently Asked Questions

What is the difference between web search and RAG in LibreChat?

Web search queries the live internet in real time. RAG (Retrieval-Augmented Generation) searches documents you uploaded to LibreChat. Web search gives you current information; RAG gives you proprietary data. You can use both: RAG for your internal knowledge base, web search for external facts.

Do I have to use Firecrawl, or can I use my search provider's native scraper?

You can use either. Tavily has a native scraper; SearXNG has one built in. Firecrawl is more reliable on modern JavaScript-heavy sites. If your queries mostly target news and documentation (static HTML), native scrapers work fine and cost less.

How much does web search cost?

It depends on your provider. Serper: $0.005-0.01 per search. Tavily: free tier (1,000/month), then ~$0.01 per search. Firecrawl (scraper): ~$0.02 per URL. Jina reranker (optional): free for limited volume. A typical query searches 5-10 URLs. Ballpark: $0.05-0.15 per query with a commercial setup, $0 with self-hosted SearXNG (minus hosting costs).

Can I limit which websites web search can access?

Yes. LibreChat's webSearch config includes allowedAddresses and blockedAddresses fields. You can whitelist specific domains or block others. This is useful if you want web search to only query your company intranet or an approved knowledge base.

Why is SearXNG so slow compared to Serper?

SearXNG queries multiple backends (Google, Bing, DuckDuckGo) in parallel, waiting for all to respond. Commercial APIs like Serper are optimized for single-source speed. SearXNG trades latency for diversity; you get results from multiple sources, which often improves quality. If speed is critical, use Serper or Tavily.

What happens if my API key expires or my SearXNG instance goes down?

LibreChat will disable web search gracefully. Users will see a message that web search is unavailable. The chat still works (models answer without web access). Monitor your API quotas and set up alerts so you are not surprised.

Yes, via agent workflows. LibreChat's agent system (using tools/functions) can include web search as an optional tool. The model decides whether to invoke it based on the query. This is more advanced; see LibreChat's agent documentation for details.

The Bottom Line

Web search in LibreChat is powerful but requires deliberate configuration. Your three choices--search provider, scraper, and reranker--determine speed, cost, and privacy. Start with Serper and Firecrawl for simplicity. Switch to SearXNG if privacy becomes important. Skip reranking unless answer quality suffers.

Configuration is declarative (edit YAML, restart), so testing different combinations is fast. The main friction is getting API keys and setting timeouts correctly; after that, web search mostly works.

If configuration feels overwhelming, explore Opsily's managed LibreChat hosting, where web search is pre-wired and tuned for you.

Ready to Deploy?
Opsily manages your LibreChat instance with web search pre-configured and optimized for your workload.
Get Started Free

Ready to self-host your own apps?

One server. Multiple apps. No per-app fees.

Get started →