Skip to main content

Web Search RAG Added to Ollama Colab Private Chat

· 3 min read
hiroaki
Individual Developer
If this site helped you, please support us with a star! 🌟
Star on GitHub

Ollama Colab Private Chat now supports Web Search RAG. Just flip the 🔍 Web Search toggle in the chat UI to include DuckDuckGo search results as context when sending messages to the LLM.

What's New

Web Search Toggle

A 🔍 Web Search toggle button has been added to both the Inline and Standalone chat UIs. It is off by default, so existing behavior is completely unchanged — search only runs when you explicitly enable it.

LLM-Optimized Query Generation

Rather than sending the user's raw input directly to the search engine, the local LLM first extracts a concise keyword query from the message before searching. This keeps search accuracy high even when questions are written in natural, conversational language.

Source Citations Below Responses

After each LLM response, the titles and links of the referenced search results are displayed as a source list, so you can verify the basis of any answer right in the chat.

TTL Cache

Search results for identical queries are cached for 5 minutes, reducing the number of requests sent to DuckDuckGo even when the same topic is asked about repeatedly.

Web Search Configuration Parameters

The following parameters have been added to the top of the Server cell and can be adjusted via the Colab form.

ParameterDescriptionDefault
SEARCH_MAX_RESULTSMaximum number of search results to retrieve5
SEARCH_BODY_LENGTHMaximum number of characters extracted from each result body300
SEARCH_TIME_LIMITTime-range filter for search resultsNo limit
SEARCH_REGIONRegion / language for search resultsEnglish

Other Changes

  • The default value of num_ctx has been raised from 4096 to 8192. A longer context window is now the default to accommodate search results being injected as RAG context.
  • The Model Registry, Server, and Chat UI — Standalone cells are now collapsed (collapsed) by default, improving notebook readability.
  • Inline mode streaming and Tunnel mode connection handling have been refactored and simplified.

Getting Started

No environment setup is required. Open the Colab link below and run the cells from top to bottom.

Feedback and Pull Requests are always welcome.

If this site helped you, please support us with a star! 🌟
Star on GitHub