RAG playground

Learn retrieval-augmented generation step by step in your browser. Chunk documents, build a keyword or embedding index, see ranked results and the final prompt.

1 Your documents

4 chunks
See the chunks
  1. chunk 0 · 293 charsSukoaa runs its compilers inside your browser. PHP, Laravel and FastAPI use WebAssembly, so your code is not uploaded to a server. The PostgreSQL playground uses PGlite, a WebAssembly build of PostgreSQL. Tables and rows live in memory while the tab is open. Pressing Stop resets the database.
  2. chunk 1 · 285 charsPressing Stop resets the database. Each PHP run has a ten second limit and projects are limited to 100,000 characters. Infinite loops are stopped automatically. Saved drafts stay on your device. Use Export to download a ZIP of every file. Cloud saving is optional and needs an account.
  3. chunk 2 · 223 charsis optional and needs an account. The Demo API offers fictional users, products and posts. Writes are simulated and never stored. A private sandbox can keep changes for a short time when the deployment has Redis configured.
  4. chunk 3 · 185 charsthe deployment has Redis configured. Tailwind CSS 4 runs through the official browser build. The preview refreshes shortly after you stop typing. Plugins and external fonts are blocked.

2 Build an index

3 Ask and retrieve

4 The prompt the model would receive

Run a search to see how retrieved chunks are placed into a prompt.

5 Generate an answer (optional)

About this tool

See every step of retrieval-augmented generation (RAG): split documents into chunks, index them, retrieve the best matches for a question and inspect the exact prompt a model would receive. Embeddings run in your browser, so your text is not uploaded.

What you can do

  • Change chunk size and overlap and watch the chunks change
  • Compare keyword search (BM25) with meaning-based embedding search
  • See similarity scores and a minimum-score cut-off
  • Copy the final prompt or stream an answer from a demo model or your own API

All tools · LLM API exercises · Free demo API

Frequently asked questions

What is RAG?

Retrieval-augmented generation finds relevant passages from your own documents and adds them to the prompt, so a language model can answer from that material instead of only from what it learned in training.

Is my text uploaded?

No. Chunking and search run in your browser. Embedding mode downloads a small open model (about 25 MB) once from public CDNs and runs it locally. Text is only sent anywhere if you choose “My own API” in step 5, and then only to the URL you enter.

Which embedding model is used?

all-MiniLM-L6-v2, a small general-purpose English sentence model that produces 384-number vectors. It is good for learning, not a replacement for a production embedding service.

Why can keyword search miss obvious matches?

Keyword search compares words, so “reset” does not match “resets” and synonyms are invisible. Embeddings compare meaning, which is why many RAG systems use them, often together with keyword search.

Can I use my own LLM?

Yes. Step 5 accepts any OpenAI-compatible chat endpoint. Your key stays in the page and is not saved. Some providers block browser requests (CORS); use a restricted key and prefer your own server for real apps.