Skip to main content
Quivr ships a general-purpose retrieval plugin (core.retrieve) and a configurable hosted embedding plugin (text.embed). When a corpus has strong domain structure—such as inverted-pyramid news dispatches, press releases, or editorial archives—you can push precision, recall, and storage efficiency much further using dedicated plugins without touching the core engine. This guide explains how to deploy newsroom.retrieve alongside tuned text.embed packing, and outlines the disciplined evaluation loop used to build and validate domain search plugins.

Architecture: two tiers on one index

Both retrieval tiers share a single Weaviate vector and lexical index backed by one embedding space (for example google/embeddinggemma-2, 768d):

High-performance defaults (opt-out to lighten)

newsroom.retrieve (0.3.1, Plugin API 0.23.0) ships with the highest-performing settings enabled out of the box so operators do not need to tune dozens of parameters. To trade recall for lower latency or GPU cost—or opt into deeper pools and live-news recency—override selectively:
  • Disable secondary query views (dense_view_mode: "none", lexical_view_mode: "none"): reduces Round 1 to 2 legs (one dense, one BM25) when remote query-encoding latency dominates.
  • Tune candidate pool depth & lead hydration (dense_k / lexical_k / rerank_top_k / rerank_band_end up to 400, include_lead: false to skip lead hydration): widen recall on long archives or turn off include_lead to minimize hydration work.
  • Metadata & temporal signals (metadata_overlap_weight: 0.08, date_alignment_weight: 0.06, recency_weight: 0 with recency_half_life_days: 30): set any weight to 0 to disable, or raise recency_weight above 0 on breaking-news feeds for deterministic pool-relative freshness decay.
  • Disable Recall Band or shrink rerank_top_k (rerank_band_end: 0, rerank_top_k: 30): lowers cross-encoder GPU tokens per query while keeping top-30 logit/Z-score reranking and tail stitching.
  • Single-container rerankers (rerank_parallel_requests: 1): disables 2-way interleaved HTTP sharding when serving on a single GPU replica.
  • Adaptive QPP cascade (adaptive_cascade: true): early-exits high-confidence queries at Stage 1 ($0 rerank cost) when dense/lexical agreement and score margin exceed configured thresholds.

Storage representation: tuned text.embed packing

Storage choices compound with retrieval. For inverted-pyramid articles embedded with long-context models such as google/embeddinggemma-2, use the reference configuration in plugins/text-embed/examples/newsroom-embeddinggemma-2.json:
Attach the model’s tokenizer configuration (generated from the repository root with scripts/prepare_tokenizer.py --hosted; setup installs the pinned tokenizer runtime and downloads the tokenizer, while plugin startup remains offline) before running in production so body_tokens: 768 counts exact model tokens rather than conservative UTF-8 byte estimates. Three design principles come out of controlled chunking and storage ablations:
  1. Match body_tokens to the median document length (768 for wire dispatches). Smaller unanchored windows (192–384 tokens) tear passing mentions out of context into standalone high-cosine vectors, inflating vector RAM by 1.3×–2.4× while hurting precision. A 768-token window keeps median dispatches holistic while preserving multi-passage contrast on long features—cutting HNSW vector storage by roughly 31% while improving both fast and deep ranking.
  2. Keep dense embeddings pure; route lexical enrichment to Segment.LexicalText. Models that already condition on title: {title} | text: {text} lose FirstP/MaxP contrast when raw leads or synthetic queries are stuffed into dense passage text. If you add write-time LLM enrichment (such as salience-gated Doc2Query-- queries or domain synonyms), write it only to pre-normalized Segment.LexicalText (0 extra HNSW vectors) rather than appending it to dense Segment.Text.
  3. Include the headline in Segment 0 (include_title_in_lead: true) and clean wire boilerplate (normalize_wire_text: true). Ensuring Segment 0 carries the headline lets downstream retrieval and reranking plugins read the title directly from matched passages without duplicating it across deep chunks.

Pinning newsroom.retrieve alongside core.retrieve

Keep core.retrieve intact for general corpora and pin newsroom.retrieve as an additional retrieval plugin in your Quivr configuration:
Set RERANKER_API_KEY in the plugin process environment when authenticating against an HTTPS reranker endpoint (never put credentials in configuration files).

Repeatable optimization methodology

When adapting a plugin to a new domain, follow a strict anti-overfit loop:
  1. Split your evaluation set before tuning. Separate a working split for iterative exploration from a locked heldout confirmation split that is never inspected during development.
  2. Track a full Pareto tuple, not a single metric. Record nDCG@10, human-graded Gold nDCG@10, Recall@50, MRR@10, false-positive taxonomy counts (such as passing mentions vs missing required elements), warm p95 latency, segment multiplier (M_seg), and estimated 10M-document RAM and inference cost.
  3. Test one hypothesis per run against a keep/discard gate. Keep a change only if it beats the current champion by a meaningful margin without regressing human gold grades or blowing the latency or storage budget.
  4. Run public generalization guardrails before shipping. Evaluate finalists on public datasets such as miracl-fr and xpqa-fr via scripts/eval/run.py to confirm zero regression outside your target domain.
  5. Confirm once on locked heldout and certify the plugin contract. Run go test -race ./..., quivr plugin inspect ., and quivr plugin test . before opening a pull request.