Design a Glean-style enterprise search from an empty canvas: ingest company documents into a vector index and answer questions with a model, streamed, safely.
Unlock it once for 25 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.
What it must do
Ingest company documents: parse, chunk, embed and index them in a vector database.
Answer a question by embedding it, retrieving the best chunks, reranking them and asking the model, streamed.
Screen questions and documents for prompt injection before they reach the model.
Upload is fast; indexing happens in the background.
Scale
10 requests a second: 9 questions and 1 document upload (about 780,000 questions a day).
20 million chunks of 1,024 dimensions in the index (2 million documents × 10 chunks).
Each answer reads about 4,000 tokens of retrieved context and writes about 250 tokens.
Request types to route: ask (90%, read), upload (10%, write). Budget: $180,000 a month.
Estimate first
Questions a day (thousand)
Vector index memory (float32, 1.5× index overhead) (GB)
Input tokens a day (billion)
Monthly cloud cost of your design (USD)
The test cases
You start from an empty canvas. When you run the tests, each one simulates your design with its own traffic and failures:
Test
What it does
Passes when
Normal day
The normal day: the traffic in the brief, nothing broken.
Success ≥ 99%; First token p99 ≤ 2.5 s; p99 latency ≤ 1.0 s (upload)
Quarter-end crunch
At 5 s everyone asks at once: traffic triples for 8 s.
Success ≥ 98%; First token p99 ≤ 4.0 s
Prompt injection
At 5 s, 30 requests a second carrying hidden instructions arrive for 10 s, as questions and inside uploaded documents.
Success ≥ 98%; Attack blocked ≥ 90%
Budget: $180,000/month
The normal day's design must cost at most $180,000 a month.
Cost ≤ $180,000/month
Must include
Document ingestion. Documents must be parsed and chunked before they can be embedded.
A vector index. Retrieval finds the chunks nearest to the question’s embedding.
A reranker. A cross-encoder reorders the retrieved chunks so the model sees the few that matter.
Guardrails. Questions and documents can carry instructions that try to hijack the model.