multi-model · 91.4 MB retrieve-then-extract QA · mxbai-embed-xsmall-v1 → DistilBERT SQuAD · Apache-2.0

2-Stage Retrieve-then-Extract Open-Domain QA Pipeline

Chain two Apache-2.0 WebAssembly models totaling ~91.4 MB: Stage 1 embeds your question and document library with mixedbread-ai/mxbai-embed-xsmall-v1 (24.45 MB q8, 384-d mean-pooled bi-encoder) to shortlist Top-K candidate passages, then Stage 2 extracts exact [start:end] spans from each shortlisted passage with Xenova/distilbert-base-uncased-distilled-squad (66.98 MB q8).

1 · Independent pipeline stages (~91.4 MB combined)

Stage 1 · Mixedbread mxbai-embed-xsmall-v1 (24.45 MB · Apache-2.0)

Stage 2 · DistilBERT Uncased SQuAD (66.98 MB · Apache-2.0)

Initialise Stage 1 (mxbai-embed-xsmall-v1) and Stage 2 (DistilBERT Uncased SQuAD) above to run Open-Domain QA.

2 · Choose a document library & run Retrieve-then-Extract QA

Drop, paste, or upload a .txt / .md document to append it to the local knowledge base.
Inspect document library (6 passages)
Waiting for stages

—

Stage 1 ranks all documents by 384-d cosine similarity; Stage 2 extracts exact answer spans from the shortlist.

Stage 1 Retrieval—
Stage 2 Reading—
Combined Time—
Top Doc Cosine—
Winning Score / Δ—
Combined Payload~91.4 MB q8

Shortlisted Passages & Per-Document DistilBERT Extractions

3 · Show the code

Show the code — distil-core.mjs 2-stage retrieve-then-extract citation aggregator
Show the code — distil.js Stage 1 mxbai-embed-xsmall-v1 FIFO worker client