project-nomad/admin/app
Matt Moyles 94fb876f1b
feat(rag): make the knowledge base embedding model configurable
Adds a `rag.embeddingModel` setting that selects the Ollama model the
knowledge base is embedded and searched with. EMBEDDING_MODELS lists
each supported model with its vector width, task prefixes and a
calibrated default relevance floor:

  nomic-embed-text:v1.5    768   default, unchanged
  bge-m3                  1024   multilingual
  qwen3-embedding:0.6b    1024   multilingual
  snowflake-arctic-embed2 1024   multilingual
  embeddinggemma           768   multilingual

An unset setting behaves exactly as before.

Score scales differ between models, so the relevance floor is now per
model: an unset `rag.minRelevance` resolves to the configured model's
floor, and the eval harness pins to it. Each floor was calibrated the
way RAG_MIN_FINAL_SCORE was, with `eval:retrieval --min-final-score`
sweeps. Under nomic's 0.62, bge-m3 loses a tenth of the golden set.

Switching models is followed by the existing Reset & Rebuild. The model
a collection was built with is recorded when it is created (collections
from before this change count as nomic), and until they match embed
jobs fail once with UnrecoverableError instead of retrying 30 times, and
search returns no context with a warning. This also catches switches
between models of the same width, which Qdrant would accept silently.

Embedding models whose names lack "embed" (bge-m3) are also kept out of
the chat model lists and recognised by GPU pacing, the configured model
is exempt from the VRAM unload sweep, and only nomic keeps the any-tag
installed-model fallback, since other tags of a family can differ in
width (qwen3-embedding:8b is 4096-d).
2026-10-09 13:54:32 -04:00
..
controllers feat(rag): make the knowledge base embedding model configurable 2026-10-09 13:54:32 -04:00
data refactor(drug-reference): make collections JSON the single source for curated data (#1130) 2026-08-04 03:38:35 +00:00
exceptions fix(Docs): documentation renderer fixes 2025-12-23 16:00:33 -08:00
jobs feat(rag): make the knowledge base embedding model configurable 2026-10-09 13:54:32 -04:00
middleware fix(API): skip compression for Server-Sent Events (#798) 2026-05-20 10:16:00 -07:00
models feat(kb): per-file active toggle + collection grouping/bulk toggle (#1286) 2026-09-29 15:54:41 -07:00
services feat(rag): make the knowledge base embedding model configurable 2026-10-09 13:54:32 -04:00
utils feat(rag): make the knowledge base embedding model configurable 2026-10-09 13:54:32 -04:00
validators feat(rag): make the knowledge base embedding model configurable 2026-10-09 13:54:32 -04:00