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 examplegoogle/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_endup to400,include_lead: falseto skip lead hydration): widen recall on long archives or turn offinclude_leadto minimize hydration work. - Metadata & temporal signals (
metadata_overlap_weight: 0.08,date_alignment_weight: 0.06,recency_weight: 0withrecency_half_life_days: 30): set any weight to0to disable, or raiserecency_weightabove0on 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 ($0rerank 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:
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:
- Match
body_tokensto the median document length (768for wire dispatches). Smaller unanchored windows (192–384tokens) tear passing mentions out of context into standalone high-cosine vectors, inflating vector RAM by1.3×–2.4×while hurting precision. A768-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. - Keep dense embeddings pure; route lexical enrichment to
Segment.LexicalText. Models that already condition ontitle: {title} | text: {text}loseFirstP/MaxPcontrast when raw leads or synthetic queries are stuffed into dense passage text. If you add write-time LLM enrichment (such as salience-gatedDoc2Query--queries or domain synonyms), write it only to pre-normalizedSegment.LexicalText(0extra HNSW vectors) rather than appending it to denseSegment.Text. - 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:
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:- Split your evaluation set before tuning. Separate a
workingsplit for iterative exploration from a lockedheldoutconfirmation split that is never inspected during development. - Track a full Pareto tuple, not a single metric. Record
nDCG@10, human-gradedGold nDCG@10,Recall@50,MRR@10, false-positive taxonomy counts (such as passing mentions vs missing required elements), warmp95latency, segment multiplier (M_seg), and estimated10M-document RAM and inference cost. - 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.
- Run public generalization guardrails before shipping. Evaluate finalists on public datasets such as
miracl-frandxpqa-frviascripts/eval/run.pyto confirm zero regression outside your target domain. - Confirm once on locked
heldoutand certify the plugin contract. Rungo test -race ./...,quivr plugin inspect ., andquivr plugin test .before opening a pull request.