Overview
brv swarm query searches all active memory providers simultaneously and returns results ranked by Reciprocal Rank Fusion (RRF). No LLM is involved — this is pure algorithmic search that typically completes in under 500ms.
- Provider label — which source the result came from
- Path/ID — the document or page identifier
- Score — RRF-fused relevance score
- Match type —
keyword(BM25) orsemantic(vector) - Content preview — first portion of the matching content
Flags
Query Classification
Before searching, the query is automatically classified to determine which providers are relevant:--explain to see the classification:
- Which query type was detected
- Which providers were selected (and why any were excluded)
- Enrichment chains that were executed
- How many results survived RRF fusion and precision filtering
JSON Output
For programmatic use or piping to other tools:How Ranking Works
RRF Fusion
Results from each provider are ranked by position, not raw score. This solves the problem of incomparable score scales across providers (BM25 vs cosine similarity vs ts_rank):Precision Filtering
After RRF fusion, two filters remove noise:- Score floor (
min_rrf_score: 0.005) — drops results below the minimum threshold - Gap ratio (
rrf_gap_ratio: 0.5) — drops results scoring below 50% of the top result
.brv/swarm/config.yaml under routing.
Result Caching
Identical queries within a 10-second window return cached results (LRU cache, max 20 entries). This is transparent — cached responses have the same format as fresh ones. Cache is invalidated on any write operation.Swarm Query vs Context Tree Query
Use
brv swarm query when you want raw search results across multiple sources. Use brv query when you want a synthesized answer from the context tree.