Skip to content

ZeroRAG Routes Queries Across Peers Instead of Pulling Documents Into One Index

#rag #decentralized-retrieval #peer-to-peer #semantic-routing #llm-infrastructure

Most RAG systems I've shipped hide the same assumption in plain sight: someone owns the index.

You crawl the documents, chunk them, embed them, write them into one vector store, and the retriever queries that store. Chunk size, reranker choice, prompt layout, all of it gets tuned against that single index. Nobody writes the assumption down because it usually holds.

It stops holding the moment custody is the problem. The documents sit in a partner's system, a hospital's records platform, three subsidiaries under different regulators. Nobody hands them over, and the reason is legal rather than technical.

The central index is a governance decision dressed as an architecture decision ​

I watched a retrieval project stall for four months on exactly this. The engineering was done in week three. The rest was a data processing agreement, a residency review, and a security questionnaire that never quite closed.

The workarounds people reach for put the authority back. A consortium operator holds the shared metadata. Or you run a distributed hash table so every node participates in one global lookup structure. Both rebuild the thing you were trying to avoid: a shared structure that has to be created, maintained, and trusted by everyone in the room.

ZeroRAG takes the other branch. It's a routing layer, not a store.

What ZeroRAG actually changes ​

Documents stay with whoever owns them. Each peer keeps two pieces of local state: a bounded set of neighbor advertisements, meaning who my neighbors are and roughly what subject matter they cover, plus a cache of queries it recently routed and where those queries landed.

No global index. No DHT. No coordinator.

A query enters at some peer. That peer scores its neighbors against the query, forwards to the best match, and the process repeats until it lands somewhere good. Along the way, the peer caches the outcome and promotes the neighbor that answered well. Two things happen at once: this query gets served, and the overlay slowly warps toward the parts of the network that actually hold relevant material.

A useful way to hold the whole design in your head: the network behaves like a search index that rebuilds itself from the queries you send it.

That's the entire mechanism. There's no background gossip protocol to keep consistent and no membership service to babysit. The routing table is a side effect of traffic.

Following one query through the overlay ​

The walk is cheapest when the entry peer is already near the right neighborhood, which is what the rewiring buys you over time. Early queries pay more hops. Later queries with similar intent start closer to the target.

Cost per hop is one network round trip plus a local scoring pass over a bounded neighbor list. That bounded list is the whole performance story. A peer with 40 neighbors does the same amount of local work whether the network has 400 peers or 100,000.

What each peer holds ​

The table below is where the design differences show up most clearly. Read the last two rows, not the first.

DHT-based retrievalConsortium indexZeroRAG
Global data structureYes, a distributed hash tableYes, shared metadata storeNone
Document custodyOwner keeps documentsOwner keeps documents, metadata centralizedOwner keeps documents
Per-peer stateFinger table, grows with networkThin client to shared storeBounded neighbor ads plus query cache
Joining or leavingNetwork-wide coordinationOperator-mediatedLocal, no approval step
Behavior under churnLookups degrade while the ring stabilizesStore outage stops retrievalRoutes re-form from surviving neighbors

Reported evaluation footprint, for scale:

  • 100,000 peers in the largest run
  • 3 real-world workloads
  • 2 decentralized baselines, with a centralized store as the reference ceiling
  • Recall and LLM answer accuracy close to the centralized store
  • Fewer network messages per query than either baseline
  • Recovery from catastrophic peer failures without operator intervention

That last point is the one I care about most, and it's also the one that gets misread.

Reading the results without overclaiming ​

ZeroRAG beats both decentralized baselines on recall and on network messages, and lands near the centralized store on recall and answer accuracy. The headline comparison is the gap to the centralized store. The gap to the baselines matters less, because those baselines were never the thing you wanted.

The results are comparative, so interpret them against those baselines rather than as absolute quality. "Approaches the centralized store" is a statement about a ceiling you can't exceed without replicating documents, and ZeroRAG doesn't replicate anything. If the retrieval task needs a single obscure document that lives on exactly one peer, a centralized index will find it in one lookup and a semantic walk will take several hops, maybe many.

What ZeroRAG sells is routing. The retrieval model underneath is whatever you already run, at whatever embedding quality you already have.

Self-healing routing is not self-healing data ​

The paper reports recovery after catastrophic peer failures, which sounds like a durability claim and isn't one. The overlay re-forms because neighbor advertisements refresh from survivors and caches go stale gracefully. Routing resilience, yes. Data resilience, no.

I ran into this distinction years ago in a different system, a federated search setup where we celebrated that the cluster survived losing a node. It did survive. The documents that node held were gone, and the queries that used to hit them silently returned worse answers instead of errors. Silent degradation is the failure mode to plan for here; it doesn't page anyone.

If a peer holding the only copy of a regulation doc dies, routing recovers and the document doesn't. Replication is a separate decision you make above this layer.

Common pitfalls ​

  1. Treating routing as replication. The overlay finds documents; it doesn't copy them. Any corpus where losing one peer loses one document needs an explicit replication set on top.

  2. Assuming recall improves without traffic. The overlay self-organizes from queries, so regions nobody queries stay poorly connected. A new peer with a niche corpus won't get discovered until queries for that niche start flowing and enough of them walk past.

  3. Forgetting that the query text moves. Every hop sees the query. If your queries contain customer names or case numbers, you've distributed the sensitive part of the payload across an unknown set of peers. Routing on embeddings alone changes that math and costs you some routing precision.

  4. Testing on a corpus that doesn't fragment. If every peer holds a roughly similar slice of content, routing looks excellent and hotspotting never shows up. The interesting test is heavily skewed content: one peer with 40% of the relevant documents and a hundred peers with almost nothing.

  5. Expecting a single rare document to surface fast. Semantic routing rewards density. A cluster of related documents pulls queries toward it, and an isolated one-off sits at the end of a long walk.

Where I'd stay cautious ​

Open peer networks invite peers that lie in their advertisements to pull traffic. The paper doesn't claim to solve adversarial membership, and neither should your architecture. If you deploy this inside one organization across business units, the trust model is manageable. If you deploy it across organizations that don't share an operator, you need a reputation or staking layer that ZeroRAG leaves to you.

The query cache is a privacy surface too. It holds recent queries plus where they landed, on every peer that routed them. That's a smaller blast radius than a centralized query log, but "smaller" isn't "small" when the regulator asks.

Cold start deserves a plan. A fresh overlay with no query history is close to a random walk. Seed it with a few hundred representative queries before you point real traffic at it.

Deployment calls to make before you commit ​

If your retrieval corpus is stuck behind legal review because no single party can hold the index, this design is the first one I'd pilot. It removes the shared structure that the review keeps objecting to, and it does so without a coordinating operator to appoint.

If your workload depends on rare, single-copy documents, pair ZeroRAG with a replication policy before you ship. Semantic routing finds clusters fast and loners slowly, and no amount of overlay rewiring fixes a document that only exists on one dead peer.

If your queries carry regulated content, budget for embedding-only routing from day one. Sending query text across unknown hops is fine for internal wikis and unacceptable for anything with a patient ID in it. Expect the routing precision loss to cost you a few recall points and plan around it.