Pular para o conteúdo
← Back to Skalablog

Published article

Permission-Aware AI Search at 100M Documents

Software Engineering

Permission-aware AI search returns the closest documents a specific user is allowed to see. The naive alternatives either discard permissions after ranking, which starves recall, or scan every permitted document, which costs seconds at 100 million documents. Indexing permissions against clustered vectors keeps both recall and millisecond latency.

Why permission-aware AI search breaks at 100 million documents

Permission-aware AI search fails at scale because the two intuitive designs each solve only half the problem: filtering after the vector search destroys recall, and filtering before it removes the speed advantage of the vector index. Bridgewater Associates, the investment firm, ran into that wall with its Vault, an internal store of unstructured research and meeting material.

Aaron Linsky, head of product engineering at Bridgewater, described the Vault as roughly 100 million indexed, organized and secured documents. It combines internal research and meeting recordings with content sourced from 135 external providers, and each source carries its own permission rules that may not open it to everyone at the firm.

Every email, meeting note and report can have a different set of groups or an individual assignment attached. The public web looks nothing like this: every document is visible to every employee, so no filter applies. The private corpus is where a question such as why token prices fell becomes a retrieval problem with a legal boundary around it.

Bridgewater's first implementation did not use turbopuffer. According to Linsky, it seemed to work until the document count grew, then "fell over tremendously," which is what prompted a search for another provider. The rest of this article explains the mechanism that replaced it and the numbers reported alongside it.

How turbopuffer's architecture splits storage from compute

Turbopuffer, a search engine built on top of object storage, writes data directly to S3, Google Cloud Storage or Azure Blob Storage and pulls it into SSD or memory only when a query touches it. That split is the reason its vendors claim low cost at rest and comparable speed once data is cached.

Nick Hill, turbopuffer's CTO, described the design as deliberately unopinionated about search type. The engine supports keyword search, regular-expression search and vector search over the same data, so a team does not need separate systems per query style. The rest of the talk focused on vector search because the permission problem is sharpest there.

The cost framing matters for a corpus this size. Hill said terabytes of data would cost tens of millions of dollars in some other systems, and that turbopuffer often runs at about a tenth of the cost, with performance comparable to disk-based search systems once the data is hot. Those are vendor claims from the talk, not an independent benchmark, and the comparison baseline is left unnamed.

A reader evaluating that claim should ask three questions the transcript does not answer: which systems formed the comparison set, what query mix produced the numbers, and whether the corpus was fully warm. The architectural point stands on its own regardless of the price multiple, since object storage is cheap when idle.

Brute-force vector search takes about 5 seconds over 100 million documents held fully in memory, which is far slower than the roughly 100 milliseconds most search workloads target. The estimate assumes 1 kilobyte per document and 20 gigabytes per second of memory bandwidth.

Hill was explicit that the 1 kilobyte figure is conservative. A single vector embedding of 1,024 dimensions at one byte per dimension already fills a kilobyte before any text, metadata or permission payload is added. Real documents are usually larger, so the 5 seconds is a floor for the in-memory case, not a worst case.

The object-storage case is worse. If the data sits cold on S3, pulling it across the network takes a minute or more, which Hill called not viable at Bridgewater's scale. The arithmetic is simple and worth repeating because it sets the bar every later design must clear.

Why vector indexes alone do not answer the permission question

A vector index narrows a similarity search to a small neighbourhood, but it cannot tell which of those neighbours a given user may read. Vectors sit close together when they represent similar concepts, so the mathematically nearest documents to a query are frequently ones the asking user cannot open.

Embeddings are the numeric representation of a concept. Hill used red shoes and maroon sandals as an example: an embedding model places them near each other and puts a concrete block far away. In practice an embedding has many dimensions, with 1,024 a common size, even though the talk used two so the geometry could be drawn on a slide.

An index over that space lets a query jump to a local neighbourhood instead of touching every vector. For plain similarity search, a few thousand candidate vectors can be checked in a millisecond or two. The moment a permission filter applies, the candidate set and the permitted set stop overlapping, and the index alone no longer answers the question.

Post-filtering versus pre-filtering versus native filtering

Native filtering is the only one of the three permission-aware AI search strategies that keeps both recall and speed at scale, because it pushes the permission condition into the clustered vector index rather than applying it before or after the search. The table below compares the three approaches on the same dimensions.

StrategyOrder of operationsMain failure at scale
Post-filteringRetrieve top candidates, then discard unpermittedPoor recall; may return 40 results instead of the top 100
Pre-filteringBuild an index of permitted documents, then scanLoses the vector index; scans tens of millions of rows
Native filteringPrune unreachable clusters, then scan inside reachable onesTuning and nested-group complexity

Post-filtering starts from the vector index and throws away documents the user cannot see. Hill's objection was recall: a user searching for red shoes may know that a document about maroon sandals exists, and post-filtering can fail to surface it because the search spirals outward and gives up after a couple of seconds with only a partial result set.

Pre-filtering inverts the order. Turbopuffer indexes the documents that match the filters, then scans that set for the closest vectors to the query. If an executive can read 50 million of the 100 million documents, the scan is back to the napkin-math problem, and the vector index goes unused.

Native filtering combines them. Turbopuffer's vector index clusters similar vectors automatically, and the permission index records which clusters contain at least one document the user can reach. Clusters with no reachable document are discarded before any scan, and the remaining clusters are searched in order of closeness. Hill said clusters currently hold about 200 documents and that the size is tuned over time for throughput.

The limitation Hill named is nested groups, where membership resolves through chains of groups rather than a flat list. He said turbopuffer has experience with those cases and is working to handle them more automatically. Anyone modelling a permission graph with deep inheritance should treat that as an open area rather than a solved one.

What the Bridgewater numbers show, and what they do not

Turbopuffer reported 120 millisecond P90 searches across roughly 400 million vectors derived from Bridgewater's 100 million documents, using the native filtering design. The figure comes from the vendor and the customer presenting together, not from an independent measurement.

Reported figureValueSource status
Documents in the Vault~100 millionBridgewater, in the talk
Vectors indexed~400 millionBridgewater and turbopuffer, in the talk
External content providers135Bridgewater, in the talk
Search latency120 ms P90Turbopuffer, vendor-reported
Target cluster size~200 documentsTurbopuffer, current tuning

Two details qualify the latency number. P90 means nine out of ten searches finished at or under that time, so the slowest tenth is not described. The talk also gives a range of 1 to 200 milliseconds elsewhere, so 120 milliseconds should be read as a reported central figure rather than a hard ceiling.

The arithmetic deserves a check. Moving from 100 million documents to 400 million vectors implies about four vectors per document, which is consistent with chunking longer documents into several embeddings. If instead the Vault meant 100 million chunks, the vector count would differ. The transcript does not resolve that, so the ratio is an inference, not a stated fact.

Hill also noted that the data is split across namespaces and that P90 was measured across all of them. Readers should not transfer this result to a single flat namespace, a different embedding dimension, or a different hardware tier without re-measuring.

What an isolation-native search engine still leaves to you

An isolation-native search engine handles filtering, regional data residency and encryption options, but it does not by itself make a deployment compliant with financial or health regulation. Hill described those as separate levels of isolation that turbopuffer supports, and the controls around them remain the customer's responsibility.

The levels he listed include fine-grained permissions inside a namespace, regional locking for regulatory obligations, running inside a customer VPC, and encryption keys held by the customer or by the customer's own clients. Those are architecture options, not certifications, and the transcript makes no claim about audits, standards or tenant-isolation testing.

For a firm like Bridgewater, that distinction matters. The retrieval layer can enforce who sees which document. The surrounding system still needs identity management, audit logging, retention rules and review of what the AI analyst is allowed to do with what it retrieves. Permission-aware AI search is one control among several.

Practically, the integration surface is small. Hill showed the permission logic translating into a filter expression on a viewers field and a groups field, which turbopuffer plans into a query under the hood. The hard engineering sits inside the engine; the model of your organization's permissions stays with you.

FAQ

  • What is permission-aware AI search? It is retrieval that returns only documents the asking user is authorized to see, while still ranking by relevance within that permitted set. It differs from ordinary vector search because the nearest vectors to a query are often documents the user cannot open.
  • Why does post-filtering lose recall? Post-filtering retrieves the closest vectors first and discards unpermitted ones afterward. When most nearby documents belong to other groups, the search returns far fewer results than requested, and a user may never see a relevant document they know exists.
  • How fast were the reported searches? Turbopuffer reported 120 millisecond P90 latency across about 400 million vectors derived from Bridgewater's Vault. The figure was presented jointly by the vendor and the customer and has not been independently reproduced.
  • What happens with nested permission groups? Hill said nested groups remain tricky and that turbopuffer is working to handle complex membership chains more automatically. Teams with deep group inheritance should validate their own permission graph before relying on filter expressions alone.
  • Does this make a deployment compliant? No. Filtering, regional locking, VPC deployment and customer-managed encryption keys are technical capabilities. Compliance still depends on audits, logging, retention policy and the controls your organization operates around the search layer.

From a Vault of secrets to a published article

The whole problem in this talk is context: a document is only useful to the right reader, and a video is only useful to the right audience once its argument survives outside the room. If you already have that argument recorded, whether it is an interview, a technical walkthrough or a lesson from your own work, the same material can become a written article.

Skalablog was built for that handoff. You paste a YouTube URL, the tool transcribes the video, and it generates a structured article draft that you review and edit before publishing. The explanation you gave on camera gets a second life as something searchable and quotable.

Visit Skala Blog and start with a video you have already recorded.

Teams that write about access control often want a worked example to point at, and Crazystack TypeScript courses at crazystack.com.br cover the TypeScript fundamentals behind tools like this. If you learn better with a cohort, the Bootcamp do Dev Doido is another route, and Gustavo Dev Doido publishes material for developers working through exactly these systems problems.

Source video