Skip to main content
Web Search RAG augments chat responses with real-time web search results. When enabled, the system searches the web before each LLM call and injects the results as additional context alongside document RAG citations.

Admin Configuration

Configure in Admin → Sources → Web Search:
SettingDescription
Enable Web SearchGlobal toggle — when off, web search is hidden from all chat edit forms
Default Search ProviderSystem default provider used when a chat doesn’t specify one
Default Max ResultsDefault number of web results to inject (1–20)
Default Include AnswerWhether to include the provider’s AI-generated answer summary
Allow Provider OverrideWhen off, chat owners cannot change the search provider — the system default is always used

Chat-Level Configuration

Chat owners configure web search per chat in Chat Settings → Web Search:
SettingIChatTabDBItem fieldDescription
Enable Web SearchwebSearchEnabledPer-chat toggle
Search ProviderwebSearchProviderOverride the system default (if allowed by admin). Shows “System Default” when empty
Max ResultswebSearchConfig.maxResultsNumber of web results to inject per query
Include AnswerwebSearchConfig.includeAnswerInclude AI-generated answer summary from the search provider
Search DepthwebSearchConfig.searchDepthTavily-specific: basic or advanced
Allowed DomainswebSearchConfig.includeDomainsRestrict search results to only these domains (e.g. docs.microsoft.com)
Excluded DomainswebSearchConfig.excludeDomainsNever include results from these domains (e.g. pinterest.com)
Pinned PageswebSearchConfig.pinnedUrlsSpecific URLs always fetched and injected as authoritative context

End-User Sidebar Toggles

Chat owners can optionally allow end users to control web search features from the sidebar at runtime:
SettingIChatTabDBItem fieldDefaultDescription
Allow Web Search ToggleallowUserWebSearchTogglefalseUsers can enable/disable web search per session
Allow Pinned URL EditallowUserPinnedUrlEditfalseUsers can add/remove pinned URLs
Allow Include Domain EditallowUserIncludeDomainEditfalseUsers can add/remove allowed domains
Allow Exclude Domain EditallowUserExcludeDomainEditfalseUsers can add/remove excluded domains

Search Providers

ProviderDomain FilteringExclude DomainsNative API
Tavilyinclude_domainsexclude_domainsNative
Perplexitysearch_domain_filterNot supportedNative
Bravesite: query operator-site: query operatorQuery rewrite
ExaincludeDomainsexcludeDomainsNative
SerpAPIsite: query operator-site: query operatorQuery rewrite
All providers are configured in Admin → Tools ([#/admin/tool]) with their respective API keys.

Pinned Pages

Pinned pages are specific URLs that are always fetched on every message, regardless of the user’s query. They serve as authoritative reference material:
  • Each URL is fetched in parallel (10s timeout, 500KB limit per page)
  • HTML is stripped to plaintext and truncated to ~4,000 characters
  • Injected into the system prompt as [pinnedN] references with priority instruction
  • Appear in citations alongside regular web search results
  • Useful for grounding a chat to specific documentation, policies, or reference pages

How It Works

  1. Before each LLM call, the orchestrator checks if web search is enabled for the chat
  2. Web search runs against the configured provider with domain filters applied
  3. Pinned pages are fetched in parallel (independent of the search query)
  4. Results are formatted as [webN] and [pinnedN] context blocks and injected into the message history
  5. The LLM sees both document RAG results and web results, with instructions to cite sources inline
  6. Citations from web search and pinned pages are streamed to the client alongside document citations

Server-Side Default Merging

When a chat has web search enabled but no explicit provider selected:
  1. The server reads appSettings.defaultWebSearchProvider and applies it
  2. defaultWebSearchConfig (maxResults, includeAnswer) is merged — chat-level overrides take precedence
  3. This happens in ai.ts before the orchestrator is invoked