RAG retrieval playground

Chunk a real document, ask it a real question, and run real dense (embedding), keyword (BM25), and hybrid (RRF) retrieval against the resulting chunks — with real scores, not canned output.

The default example was checked against real Gemini embeddings before shipping: dense search correctly finds the paraphrased answer, while keyword search is pulled toward an unrelated chunk that happens to reuse the question's exact words. Edit the text or question and run it again — the disagreement is real, not guaranteed to survive every edit.

Document and question

Tries paragraph breaks, then sentences, then words, before a hard cut.

220 chars

6 chunks at this size.

Dense

Cosine similarity between gemini-embedding-001 embeddings of each chunk and the query.

Click “Run retrieval” to embed the chunks and the question.

Keyword (BM25)

Okapi BM25 over real term frequencies and inverse document frequency across these chunks.

1chunk 2score 6.1158
Our visitor-badge policy requires every guest to sign in at the front desk. A badge must be returned any time a visitor leaves, whether a paid consultant or an unpaid contractor walks them off the premises.
2chunk 3score 1.6196
Expense reimbursements are processed every other Friday. Submit a receipt within 60 days of the purchase or the claim is automatically rejected by the finance system.
3chunk 5score 0.7171
Remote employees can expense a one-time home office setup up to 25000 rupees, covering a desk, chair, and monitor, but not ongoing internet or electricity costs.
4chunk 1score 0.6641
Full-time staff accrue twenty vacation days each calendar year, visible anytime in the HR portal, and any unused days roll over into the next year up to a five-day cap.
5chunk 4score 0.0000
Reserved parking spots are assigned by seniority and reviewed every January. Anyone leaving the company forfeits their spot immediately, and it reopens to the waitlist the same day.
6chunk 6score 0.0000
The IT helpdesk resolves laptop and VPN tickets within one business day. Hardware replacement requests route to procurement and typically take a week to arrive.

Top pick: chunk 2

Hybrid (RRF)

Reciprocal Rank Fusion of the dense and keyword rankings above — k = 60, the standard constant.

Run retrieval first — hybrid needs both rankings to fuse.