Opening database…
RAGbox
RAG in a browser
Ask your documents
Ask a question, then follow up. Answers cite documents from your selected collection.
Collections in this browser
-
Checking…
Nutrition and medical research: 3,633 PubMed articles cited by NutritionFacts.org. Best for health and diet questions.
Small · built in your browser in under a minute
Selected -
Checking…
General web knowledge: 8.8 million short passages from Bing search results. Best for everyday factual questions.
Large · one-time 3.35 GB download
Selected
History
Saved conversations and their sources. Continue any chat, or start a new one. Stored only in this browser.
No conversations yet. Your chats will appear here after you ask a question.
Settings
Indexes
NFCorpus
Checking…Nutrition and medical research · 3,633 articles
Checking saved collection…
MS MARCO
Checking…General web passages · 8.8 million passages · 3.35 GB download
Checking saved collection…
Indexes and app files Checking…
Checking browser files…
Advanced file management
Saved files
| File | Size |
|---|
Model
Checking model…Generate answers with citations from your search results. Runs on your device.
Model files Checking…
Checking saved model files…
Advanced file management
MiniCPM5-2B
Checking installed files…
Some saved model files are invalid. Go to Model to repair the download.
| Model file | Size | Cache |
|---|
Start over
How it works
← Back to chatExecution architecture
The chat controller (written in TypeScript) coordinates retrieval and generation through separate Web Workers, while the DOM rendering and Zustand state updates run on the main thread.
Main thread
Chat States, DOM views, etc.
DuckDB worker
Wasm · CPUDuckDB-Wasm executes SQL against persistent collection databases and their full-text indexes. Results include document IDs, source text, and BM25 scores.
Model worker
WebGPUMiniCPM5-2B runs on Transformers.js and ONNX Runtime Web to produce contextual query rewriting and streamed answer generation.
BM25 retrieval
Both collections use DuckDB’s FTS extension. Query normalization uses the saved index’s analyzer and stopword table before a prepared statement binds the query to match_bm25.
Retrieval returns up to 10 documents in descending score order, with document ID as a deterministic tie-breaker (See SQL). For the two indexes available: NFCorpus indexes concatenated titles and article text, while MS MARCO indexes passage contents.
NFCorpus retrieval SQL
SELECT id, title, text,
fts_main_nfcorpus.match_bm25(id, ?) AS score
FROM nfcorpus
WHERE score IS NOT NULL
ORDER BY score DESC, id
LIMIT 10;
MS MARCO uses fts_main_msmarco.match_bm25 over msmarco.contents. Normalization runs separately so the ranking macro receives a plain bound value.
Local inference flow and specs
Rendering diagram…
- Model
- MiniCPM5-2B-ONNX
- Execution
- WebGPU ·
q4f16weights ·shader-f16 - Input budget
- 3,500 tokens for instructions, question, history, and evidence
- Output limits
- 512 answer tokens · 128 query-rewrite tokens
- History window
- Up to 3 recent turns within 750 tokens
Browser storage
| Component | Storage API | Stored data |
|---|---|---|
| Collection databases | OPFS |
|
| Model artifacts | Cache Storage | Revision-pinned ONNX weights, configuration, and tokenizer files. |
| Conversations | IndexedDB | turns, source snapshots, and navigation state. |