Web Search

Chat answers can pull in public web results alongside your indexed documents. It's off by default per turn — the user has to opt in — and the provider behind it is a single superadmin choice made once for the whole install.

Providers

ProviderKey requiredNotes
DuckDuckGo (default)NoneKeyless, no superadmin configuration needed. Used automatically whenever web_search_provider is unset or explicitly duckduckgo.
TavilyYes — API keySet web_search_provider: "tavily" and store a Tavily key (Admin → Settings). If Tavily is selected but no key is configured, Ragz logs it and transparently falls back to DuckDuckGo rather than failing the turn.

Configure the provider and key from Admin → Settings → Web Search. The Tavily key, like every provider credential, is stored AES-256-GCM-encrypted and is write-only in the API (tavily_key_set: true/false, never the key itself).

Per-turn toggle

Web search is never automatic — a user (or the agent's tool budget) enables it per message. When on, the model can issue web-search calls as part of its tool loop, and results are cited alongside document citations. Two persistent, Redis-backed caps bound usage regardless of the per-turn toggle:

SettingDefaultMeaning
RAGZ_WEB_SEARCH_DAILY_LIMIT_PER_USER50Daily web-search calls per user. 0 = unlimited.
RAGZ_WEB_SEARCH_DAILY_LIMIT_PER_ORG0 (off)Optional daily cap per organization, layered on top of the per-user cap.

Full page content

By default, Ragz doesn't stop at the search engine's snippet — it fetches the full text of the top results and feeds that richer content to the model, producing better-grounded answers than snippets alone.

On by default

The "Fetch full page content" setting (web_search_full_content) in Admin → Settings is on by default. Turn it off to fall back to snippet-only results — lower latency and no outbound page fetches, at the cost of less context per web citation.

Privacy & SSRF guarding

Full-page fetches don't dial arbitrary URLs blind. The fetcher (modules/chat/web_content.py) reuses the same SSRF-guarded HTTP path used for image proxying: it resolves and pins the destination IP, rejects private/ loopback/link-local ranges, and caps response size — so a malicious or misconfigured search result can't be used to reach internal infrastructure. A fetch failure degrades gracefully to the snippet Ragz already has; it never breaks or blocks the answer.

Configuring

From Admin → Settings → Web Search:

  1. Choose the provider — DuckDuckGo (default, no key) or Tavily (paste an API key).
  2. Toggle Fetch full page content on or off.
  3. Save. Changes apply to the next chat turn — no restart needed.
curl -X PATCH https://your-ragz-host/api/v1/admin/settings/providers \
  -H "Authorization: Bearer $SUPERADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "web_search_provider": "tavily",
    "web_search_full_content": true,
    "tavily_api_key": "tvly-..."
  }'