Problem
Notion AI Q&A answers questions over a user's workspace and connected tools, so every page has to be embedded and indexed. After the November 2023 launch, millions of workspaces waited for access, and the first indexes were nearly full within a month. The vector database ran on dedicated "pod" clusters and billed for uptime, so over-provisioning cost too much. Originally, every page edit also triggered re-chunking, re-embedding and re-upload of the whole page.
Example from the article: a user changes page permissions from "only me" to "everyone". The text is unchanged, but the old pipeline re-embedded and reloaded every span.
Solution in brief
Notion added index "generations" for onboarding, moved to a serverless vector database, and added a per-span hash cache. The cache sends only changed text to the embedding model and only changed metadata to a cheap PATCH. Embedding generation and query serving then moved to Ray on Anyscale.
Questions this case answers
- How to keep a vector index of frequently edited documents fresh while re-embedding only the parts whose content changed
- How to scale a multi-tenant retrieval index to millions of tenants when pre-provisioned capacity is too expensive and re-sharding is operationally heavy
- How to scale a multi-tenant vector index for RAG to millions of workspaces without re-sharding?
- How to cut embedding and vector database write costs when users edit long documents constantly?
Tools and methods
- turbopuffer — object-storage-based vector search engine that replaced the pod and first serverless setups.
- xxHash (64-bit) — hashes of span text and span metadata for change detection.
- DynamoDB — one record per page holding span hashes, the cache of the last indexed state.
- Ray and Anyscale — embedding generation and query embedding serving on one compute layer.
- Apache Spark, Kafka, Airflow — offline batch indexing, online edit stream, onboarding scheduling.
Google or a one-time email code. No password.