Files
club-3090/services
noonghunna 41b1c83e84 Wire SearXNG web search + Qdrant vector DB into Open WebUI (#472)
* Wire SearXNG web search + Qdrant vector DB into Open WebUI

Two integrations OWUI wasn't actually using despite both services running:

SearXNG (web search) — the compose used the pre-v0.9 env names
(ENABLE_RAG_WEB_SEARCH / RAG_WEB_SEARCH_*), which v0.9.6 ignores, so web
search was silently off. Renamed to the current names (ENABLE_WEB_SEARCH,
WEB_SEARCH_ENGINE, WEB_SEARCH_RESULT_COUNT, WEB_SEARCH_CONCURRENT_REQUESTS)
→ config path rag.web.search.*, seeded from env on a fresh volume.
SearXNG already serves JSON at :8088.

Qdrant (vector DB) — added VECTOR_DB=qdrant + QDRANT_URI (:6333) +
QDRANT_ON_DISK so document/web-search RAG vectors go to the qdrant service
instead of the embedded Chroma default. VECTOR_DB is a plain startup env
(applies every boot). Switching backends doesn't migrate existing Chroma
embeddings — re-index any knowledge.

Existing-volume note (this rig): web search also needed a one-time DB edit
(rag.web.search.enable/engine) because OWUI's PersistentConfig DB value
overrides the env once persisted; fresh installs get it from the env above.

Live-validated: ENABLE_WEB_SEARCH/engine=searxng at runtime; a web-search
round-trip through OWUI returned results AND created the qdrant collection
'open-webui_web-search' (3 points) — proving SearXNG + Qdrant work together
(search → embed → Qdrant, not Chroma).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfF565T9eSLaqGzidyJ1Pm

* OWUI web search: bypass embed/retrieve + disable hybrid (reliable results)

Web search ran (SearXNG → embed → Qdrant) but the model never saw the
results (sources: 0): the embed→retrieve path needs a reranking model for
hybrid search, and with RAG_RERANKING_MODEL unset the rerank step returned
0 chunks, so nothing reached the prompt.

- BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL=true — inject SearXNG results
  straight into context (no vector round-trip).
- BYPASS_WEB_SEARCH_WEB_LOADER=true — use the search snippets, not full-page
  fetches → small, fast context.
- ENABLE_RAG_HYBRID_SEARCH=false — pure vector retrieval for document RAG too
  (hybrid needs a reranker; set RAG_RERANKING_MODEL + flip true for recall).

Live-validated: a web-search chat against gemma-4-12b-int8 now returns a
cited answer ("Anthropic recently announced ... [1]"), sources attached.
(Applied to the live rig via the PersistentConfig DB since env doesn't
override an existing volume; these env vars seed fresh installs.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfF565T9eSLaqGzidyJ1Pm

* OWUI: enable hybrid RAG with bge-reranker-base (in-process, CPU)

Re-enable hybrid (BM25 + vector + rerank) document-RAG retrieval now that a
cross-encoder reranker is configured. bge-reranker-base (~280 MB) loads
IN-PROCESS in OWUI on CPU — no GPU contention, no separate service —
auto-downloaded from HF on first use. Document-RAG only (web search bypasses
retrieval). Swap to bge-reranker-v2-m3 (~2.3 GB) for higher recall.

Applied to the live rig via the PersistentConfig DB (rag.reranking_model +
rag.enable_hybrid_search); these env vars seed fresh installs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EfF565T9eSLaqGzidyJ1Pm

---------

Co-authored-by: noonghunna <10742901+noonghunna@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:14:40 +05:00
..