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
| Flag | Short | Default | Description |
|---|---|---|---|
--explain | — | off | Show query classification, provider selection, and enrichment details |
--format | — | text | Output format: text or json |
--max-results | -n | 10 | Maximum number of results to return |
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):| Parameter | Default | Description |
|---|---|---|
K | 60 | Higher values flatten rank differences |
| Provider weight | 0.7 – 1.0 | Per-provider confidence weight |
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
brv swarm query | brv query | |
|---|---|---|
| Sources | All configured providers | ByteRover context tree only |
| LLM | No LLM call | LLM synthesizes an answer |
| Output | Ranked search results | Natural language answer |
| Speed | ~200–500ms | ~2–15s (depends on tier) |
| Cost | Free (keyword) or ~$0.001 (vector) | LLM token cost |
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.