A practical guide to retrieval over thousands of pages: silent caps, sharding without changing rankings, hybrid search, links as a graph, memory and warm-up.
Updated
Enterprise knowledge isn't small. One team's wiki can run to thousands of pages, and the answer an agent needs is as likely to be on page 4,812 as on page 12. Retrieval that works well on a demo corpus often degrades quietly at this scale, and an agent that can't see the right page doesn't say "I don't know". It answers confidently from the wrong one.
Here's how we think about retrieval over large corpora, and what we recommend to anyone building it.
Most retrieval stacks have limits somewhere: a maximum candidate set, a page limit on a listing call, a top-k applied before reranking, a context budget. Each is reasonable alone. Together they can mean a large part of the corpus can never be returned, whatever the query.
Test it directly: pick facts that live only on pages deep in the corpus (by ID, date or listing order) and check they come back. Recall measured on a random sample hides this, because most samples land in the reachable part.
When one index gets too big for one process, shard it. Hash pages across shards, query every shard, and merge. The catch is ranking: BM25 depends on corpus-wide statistics (document frequencies, average length), so naive per-shard scores aren't comparable.
Embeddings are good at meaning and bad at specifics: an error code, a SKU, a function name, a clause number. Keyword search (BM25) is the opposite. Enterprise questions need both, so run them together and fuse the results. When users need line-precise answers, keep a path that returns the exact passage, not just the page.

Large indexes are mostly a memory problem. Compact posting lists and store vectors at the dimension you actually need; in our experience compaction alone can nearly halve peak memory. Then:
Large corpora change constantly and repeat themselves across sources. Re-index incrementally from change events rather than rebuilding, collapse near-duplicate passages so they don't crowd out the top results, and record where and when each passage came from so an agent can tell current guidance from stale copies.
Enterprise pages point at each other: specs link to runbooks, decisions link to the docs they changed. Resolve those links and keep them as a graph. An agent can then follow a reference to the page that actually holds the answer, and a page that many others cite tells you something about how much to trust it.
Measure on a corpus that looks like production. We use the Confluence portion of EnterpriseRAG-Bench, a public enterprise benchmark: over 5,000 pages, with their links resolved into a connected wiki. We track recall of deep pages separately from overall accuracy.
BrainBox supports hybrid keyword-and-vector search, and sharded indexes that rank exactly like a single index for projects of up to 20,000 pages. Indexes are built offline and warmed before a project switches over. On the Confluence portion of EnterpriseRAG-Bench, questions whose answers sit on pages ranked as deep as 4,552 now return that page as the top result.
Want to see how retrieval holds up on your own corpus? Talk to us.
Grounded answers, not guesses — from a living model of your business.