Skip to content

How-ToGPU

How to Add Web Search to Your Local AI Chatbot in Open WebUI

Open WebUI can give a local model live web search. Start with the built-in DDGS engine, which needs no API key, move to a self-hosted SearXNG instance (with JSON output enabled) for more control, or use a hosted search API. Raise the model's context length to at least 16K tokens and use a model with good tool calling for useful answers.

By , Editorial team

5 min read

How to Add Web Search to Your Local AI Chatbot in Open WebUI

A local AI model running on your own PC is private and free to use, but it only knows what was in its training data. Ask it about this week's news or a driver released yesterday and it will either say it doesn't know or, worse, make something up. Open WebUI, the popular browser-based front end for Ollama and other local AI servers, can fix that by searching the web and feeding the results to your model. This guide follows Open WebUI's official documentation and assumes you already have Open WebUI running; if not, start with our Open WebUI and Ollama setup guide. Forge PC hasn't tested every search provider, and results depend on your model and the provider you choose.

How web search works in Open WebUI

Open WebUI's documentation splits web search into two jobs:

  • The search engine finds links for your query, with short previews.

  • The web loader opens those links and reads the page text when the model needs more detail. It can also read a link you paste into a chat.

You choose a service for each job, but you don't need to configure both to start. Open WebUI's advice is to pick one search engine and leave the web loader at its default setting.

One privacy point before you begin: a local model keeps your chats on your PC, but web search sends your search queries to the provider you choose. Open WebUI lets admins require confirmation before a search runs, so queries aren't sent to an external provider unintentionally (covered below).

Option 1: DDGS, the quickest setup (no account, no API key)

DDGS (Dux Distributed Global Search) is a metasearch engine that ships with Open WebUI. The documentation says there's nothing to install and no account or API key needed:

  1. Open Admin Panel > Settings > Web Search.

  2. Turn on Web Search.

  3. Set Web Search Engine to DDGS.

  4. Choose a DDGS Backend. Auto (Random) is the default, and Open WebUI calls it the most reliable choice because each search picks a provider at random, so one provider refusing a request doesn't stop searching altogether.

  5. Save.

Open WebUI notes that DDGS reaches providers through their public pages rather than paid APIs, so results can be less reliable than an official API. If you configure Open WebUI with environment variables, the engine value is duckduckgo (not ddgs), and the DDGS entry isn't available on the slim Docker image.

Option 2: A self-hosted SearXNG instance

SearXNG is a free, self-hosted metasearch engine. Open WebUI describes it as useful when you want a privacy-preserving option you run yourself, though it notes that result quality depends on SearXNG's upstream engines, rate limits and configuration. Open WebUI's SearXNG guide is a community contribution, but the key steps are:

  1. Run SearXNG in Docker (the guide uses the official searxng-docker repository).

  2. Enable JSON output. In SearXNG's settings.yml, add json to the formats list under search, alongside html, then restart SearXNG. Without this, SearXNG blocks Open WebUI's queries and you'll see 403 Client Error: Forbidden in Open WebUI's logs.

  3. In Open WebUI, go to Admin Panel > Settings > Web Search, turn on Web Search and set the engine to searxng.

  4. Set the Searxng Query URL to your instance's /search endpoint, for example http://localhost:8080/search, or http://searxng:8080/search if both containers share a Docker network. Open WebUI adds the query parameters itself.

  5. Adjust Search Result Count and Concurrent Requests if needed, and save.

Option 3: A hosted search API

For the strongest results, Open WebUI recommends starting with a hosted search API built for AI workflows; its documentation names Exa, Tavily, SearchApi, Serper, SerpApi, Brave and Kagi. These usually need an account and an API key, and some charge for searches. Pick one, follow its page in Open WebUI's provider list, paste the key into the Web Search settings and save. If you're comparing the cost of hosted services with running everything at home, our cloud AI vs local LLM guide may help.

Using web search in a chat

Turning it on in the admin settings doesn't make every chat search the web. Open WebUI's SearXNG guide says to open the + menu in a chat and turn on Web Search, and that the toggle applies per session, so reloading the page or switching chats turns it off again.

The documentation also lists three "gates" that must all be open for searching to work: Web Search enabled globally, enabled on the model (in Admin Panel > Settings > Models, edit the model), and enabled in the chat. The DDGS page adds that the model must not be set to Legacy function calling.

Require confirmation before searching

If you share Open WebUI with others, or just want to be sure nothing leaves your PC by accident, admins can turn on search confirmation in Settings > Web Search (admin section). The switch appears while Web Search is on, and can also be set with the ENABLE_WEB_SEARCH_CONFIRMATION environment variable.

Fixing common problems

403 Forbidden with SearXNG. JSON output isn't enabled. Add json to SearXNG's formats list and restart it.

Search works but answers ignore the content, or pages come back empty. Open WebUI's troubleshooting guide says web pages often contain 4,000 to 8,000 or more tokens, and that if your model runs at Ollama's 4,096-token default (which applies to GPUs under 24GiB), you're missing most of the content. It recommends increasing the context length to 16,384 tokens or more in the model's Advanced Params. Bigger context uses more VRAM; our Ollama context length guide and context length and VRAM explainer show how to balance it.

The model never searches. With everything configured, Open WebUI says this is usually down to model capability: in Native (agentic) mode the model must decide to call the search_web tool, and older or smaller models can miss it or produce malformed tool calls. It recommends a modern model with good tool calling, and checking that Function Calling is set to Native in the model's Advanced Params.

Timeouts. Reduce concurrent requests (Open WebUI says WEB_SEARCH_CONCURRENT_REQUESTS=1 is required for Brave's free tier) and make sure Open WebUI can reach both the search engine and the result pages.

Behind a proxy. Turn on Trust Proxy Environment in the Web Search settings so the web loader uses your proxy settings.

Our verdict

Adding web search turns a local chatbot from a frozen snapshot into something that can answer questions about today. Start with DDGS: it's built in, needs no account and takes a minute to switch on. Move to a self-hosted SearXNG instance if you want more control (remember to enable JSON output), or a hosted search API if result quality matters most. Then raise your model's context length to at least 16K tokens and use a model with reliable tool calling, or you'll get thin answers however good the search is.

The bottom line

Adding web search turns a local chatbot from a frozen snapshot into something that can answer questions about today. Start with DDGS: it's built in, needs no account and takes a minute to switch on. Move to a self-hosted SearXNG instance if you want more control (remember to enable JSON output), or a hosted search API if result quality matters most. Then raise your model's context length to at least 16K tokens and use a model with reliable tool calling, or you'll get thin answers however good the search is.

Sources

  1. 01Open WebUI Docs, Web Search
  2. 02Open WebUI Docs, DDGS
  3. 03Open WebUI Docs, SearXNG
  4. 04Open WebUI Docs, Troubleshoot Web Search

About the author

Forge PC Staff

Editorial team

The shared byline for articles researched, written and edited by the Forge PC editorial team. How we source, check and correct our work is set out in our editorial policy.

More from Forge PC Staff

Read next

Lemonade vs Ollama: Which Local AI Server Should You Use on an AMD or NVIDIA PC?

Versus

Lemonade vs Ollama: Which Local AI Server Should You Use on an AMD or NVIDIA PC?

Ollama is the safest default for local LLMs, with a big model library and support for NVIDIA, AMD and Apple hardware. Lemonade, an open-source server with AMD-backed optimisations, is the better choice on Ryzen AI and Radeon PCs if you want NPU support or speech and image models alongside LLMs. It also speaks the Ollama and OpenAI APIs.

Forge PC Staff5 min

Sleep vs Hibernate vs Shut Down in Windows 11: Which Should You Use on a Gaming PC?

Versus

Sleep vs Hibernate vs Shut Down in Windows 11: Which Should You Use on a Gaming PC?

Sleep keeps your session in RAM for the fastest resume but loses unsaved work in a power cut. Hibernate writes it to hiberfil.sys on your SSD and uses no power, but resumes more slowly. Shut down or restart for a clean start. On a gaming desktop, sleep for short breaks and hibernate for long ones; on a laptop, hibernate or shut down before travelling.

Forge PC Staff5 min

RTX 5090 vs RTX 4090 for Local AI: Is 32GB and 1.8TB/s Worth the Upgrade?

Versus

RTX 5090 vs RTX 4090 for Local AI: Is 32GB and 1.8TB/s Worth the Upgrade?

For local AI, the RTX 5090's 32GB of GDDR7 and 1,792GB/s of bandwidth beat the RTX 4090's 24GB and 1,008GB/s, so bigger models and longer contexts fit and token generation should be faster, with FP4 support too. It needs more power and NVIDIA recommends a 1,000W PSU. If your models fit in 24GB, a good-value RTX 4090 is still very capable.

Forge PC Staff5 min

How to Use Your Android Phone as a Webcam in Windows 11 (No Extra Apps)

How-To

How to Use Your Android Phone as a Webcam in Windows 11 (No Extra Apps)

Windows 11 can use a linked Android 10 or newer phone as a wireless webcam with no extra apps. Link the phone in Settings > Bluetooth & devices > Mobile devices, turn on 'Use as connected camera', then choose the phone in Teams, Discord or OBS and approve the prompt on the phone. It's a handy stopgap, though a dedicated webcam is less hassle daily.

Forge PC Staff4 min