Skip to main content

The Problem

ByteRover’s context tree is powerful — but your knowledge lives in many places. Obsidian vaults, markdown folders, GBrain databases, OpenClaw wikis. Without a unified search layer, you have to query each system separately, mentally merge the results, and decide where to store new knowledge. Memory Swarm solves this by federating all your knowledge sources into a single query and curation interface.

How It Works

Memory Swarm connects up to 5 memory providers into a coordinated search and write system. When you query, all active providers are searched in parallel. Results are merged using Reciprocal Rank Fusion (RRF) — a ranking algorithm that combines results from heterogeneous sources without requiring comparable score scales.
                        ┌─────────────┐
          brv swarm     │   Classify  │
         query "JWT"───▶│   Query     │
                        └──────┬──────┘

              ┌────────────────┼────────────────┐
              ▼                ▼                ▼
        ┌──────────┐   ┌──────────┐     ┌──────────┐
        │ByteRover │   │ Obsidian │     │  GBrain  │  ... more providers
        │Context   │   │  Vault   │     │ Database │
        └────┬─────┘   └────┬─────┘     └────┬─────┘
             │              │                 │
             └──────────────┼─────────────────┘

                     ┌──────────────┐
                     │  RRF Fusion  │
                     │  + Filtering │
                     └──────┬───────┘

                      Ranked Results
No LLM call is involved — Memory Swarm is pure algorithmic search and ranking. Queries typically complete in under 500ms across all providers.

Key Concepts

Query Classification

Every query is automatically classified into one of four types using lightweight regex rules:
TypeTrigger SignalsProviders Activated
FactualDefault (no special signals)All providers
Temporal”yesterday”, “last week”, “since”, “when did”All providers
Relational”related to”, “depends on”, “connected”All providers
Personal”I prefer”, “how do I usually”, “my style”Local providers only
Personal queries are routed only to local providers (ByteRover, Obsidian, Local Markdown, Memory Wiki) — cloud providers like GBrain are excluded for privacy.

Reciprocal Rank Fusion (RRF)

Results from different providers use different scoring systems — BM25 scores, cosine similarity, ts_rank. RRF sidesteps this by ranking based on position rather than raw score:
score = Σ (provider_weight / (K + rank))
Where K=60 (configurable) and provider weights range from 0.7 to 1.0. This produces a unified ranking without requiring score normalization across providers.

Enrichment

Optionally, providers can be chained so that results from one feed into another. For example, ByteRover context tree results can be used to expand Obsidian searches with additional keywords. Enrichment edges form a directed acyclic graph (DAG) — cycles are rejected at config validation time.

Graceful Degradation

If a provider is unhealthy (missing path, bad credentials, unreachable service), it is skipped. The swarm continues with remaining providers and reports the issue in --explain mode. No single provider failure blocks the entire query.

Supported Providers

ProviderTypeSearchWriteRequires
ByteRoverLocalKeyword (BM25)NoAlways available
ObsidianLocalKeyword (BM25)NoVault path
Memory WikiLocalKeyword (BM25)YesOpenClaw wiki vault
GBrainCloudHybrid/Keyword/VectorYesGBrain repo + optional API key
Local MarkdownLocalKeyword (BM25)YesFolder path(s)

Commands

CommandPurpose
brv swarm onboardInteractive setup wizard — detects and configures providers
brv swarm statusCheck provider health and write targets
brv swarm querySearch across all active providers
brv swarm curateStore knowledge in the best available provider

Next Steps

Setup

Configure providers with the onboard wizard or manual YAML

Query

Search across all providers with RRF fusion

Curate

Store knowledge in external memory providers

Providers

Detailed reference for each provider type