Sign InOpen Brain
AI EngineerVideoSource Linked

Connect AI to Billions of Legal Documents — Simon Eskildsen, turbopuffer & Jacob Lauritzen, Legora

Legora’s latency failure shows why tenant activity patterns matter more than schema shape: mixing hot and cold projects caused cache thrashing, while per-project namespaces restored isolation.

AI Engineer · Sep 16, 2026
Open Source Open MarkdownOpen JSON
Source Summary

Legora’s partitioned Postgres design mixed active and dormant projects, causing cache thrashing as the corpus grew. Search and ingestion P99 rose from **100 milliseconds to 20 seconds** before the company moved at roughly **400 million documents**.

Practical Implication

For multi-tenant agent retrieval, align the storage boundary with the unit users query. Legora adopted one Turbopuffer namespace per project, gaining BM25 search, per-namespace separation, and object-storage economics for cold projects across **more than 2 billion documents**.

Agent-Ready Context
Legora’s partitioned Postgres design mixed active and dormant projects, causing cache thrashing as the corpus grew. Search and ingestion P99 rose from **100 milliseconds to 20 seconds** before the company moved at roughly **400 million documents**.

For multi-tenant agent retrieval, align the storage boundary with the unit users query. Legora adopted one Turbopuffer namespace per project, gaining BM25 search, per-namespace separation, and object-storage economics for cold projects across **more than 2 billion documents**.

The design fits workloads with many cold indices and a small hot set; it is not a universal database prescription. Cold reads can still incur object-storage latency, and some Legora workloads disabled the NVMe cache to meet isolation requirements.
Connected Context · Feed7 Judgment

This adds a concrete storage lesson to enterprise retrieval: partitioning must follow the user-visible query and isolation boundary, especially when a small hot set sits over many cold corpora. The migration supports separating metadata and retrieval workloads, but its object-storage tradeoffs narrow the design to similarly skewed multi-tenant systems rather than a general database replacement.

How Web Data Infrastructure Powers the Next Generation of AI — Patricija Žemaitytė, OxylabsOxylabs establishes retrieval as production-critical infrastructure; Legora identifies corpus layout and cache behavior as another source of latency collapse beyond browsers, proxies, parsing, and retries.Serving 2 Million Models Without Melting: Scaling the Hugging Face Hub — Arek Borucki, Hugging FaceBoth architectures separate workload paths instead of scaling one undifferentiated store; Legora applies that principle to per-project indices and hot-versus-cold document access.Why Your Enterprise Tech Stack Isn’t Ready for AI Agents — Christopher Lovejoy & Saul HowardLegora provides an implementation consequence of treating enterprise constraints as foundational: tenant isolation can determine namespace design and may require disabling a performance cache.Regional inference now available on AI GatewayRegional routing and per-project namespaces enforce different boundaries—residency versus retrieval isolation—but together show that sensitive workloads constrain infrastructure placement before model execution.
Context Map
infradata#retrieval#enterprise
Uncertainty
The design fits workloads with many cold indices and a small hot set; it is not a universal database prescription. Cold reads can still incur object-storage latency, and some Legora workloads disabled the NVMe cache to meet isolation requirements.