● Runs live in this tab · no server · no API key

Ask real questions of
real documents. Get cited answers.

DocuSense AI is a retrieval-augmented document intelligence system — parsing, embeddings, semantic search and extractive question-answering — that runs entirely client-side. Nothing you upload ever leaves this browser tab.

🧠 Real sentence embeddings (MiniLM-L6) 🎯 Real extractive QA (DistilBERT-SQuAD) 🔒 Role-based access control 📊 Built-in evaluation harness
See the architecture
Live system

Upload. Ask. Verify.

Load the bundled sample documents or drop in your own PDF/TXT/MD files. Every answer below is generated by models running in this tab right now.

Models load automatically as soon as you add a document (model downloads are cached in this browser after the first visit)

Confidence: high >60% medium 30–60% low <30%

Document Library 0

📄

Drop files or click to upload
PDF, TXT, or MD · up to 10 MB per file

Simulate access as

This simulates row-level permissions: documents tagged Restricted are excluded from retrieval unless the active role is allowed to see them — enforced at the retrieval step, not just in the UI.

Ask a question

Load documents on the left, then ask a question below. Try the suggestions once documents are ready. Press / to jump to the question box.

Retrieved sources

Sources for your most recent question will appear here, ranked by cosine similarity.

Architecture

The full RAG pipeline, in your browser

No server round-trip. Every step below executes on-device using WebAssembly (ONNX Runtime Web) via Transformers.js.

📥
ParsePDF.js text extraction, page-tracked
→
✂️
Chunk~120-word windows, 20-word overlap
→
🧬
EmbedMiniLM-L6-v2, 384-dim vectors
→
🔍
RetrieveCosine similarity + role filter
→
🎯
ExtractDistilBERT-SQuAD answer span
→
✅
CiteAnswer + confidence + source
🛡️

Honest by design

If retrieval confidence is low, the system says so instead of guessing. Extractive answers can't hallucinate facts not present in your documents.

⚡

Measured, not assumed

Every answer reports real latency and a real confidence score from the model — not a canned percentage.

🔐

Access-aware retrieval

Restricted documents are filtered out of the candidate set before search runs, not after — the model never even sees them.

Evaluation harness

Don't trust it — test it

A fixed set of 6 golden question/document pairs with known expected answers, scored automatically against whatever is currently in the document library.

Load the 3 sample documents first
Why this exists

Built against a real hiring checklist

This project follows a specific evaluation rubric: real architecture, real evaluation with baselines, honest error handling, and a working deployed demo — rather than a cosmetic chatbot UI.

📦

Models used

Xenova/all-MiniLM-L6-v2 for embeddings and Xenova/distilbert-base-cased-distilled-squad for extractive QA, both quantized ONNX builds served via Transformers.js.

🧪

What's measured

Retrieval Recall@1/@5, mean reciprocal rank, QA confidence score, and end-to-end latency — shown live in the Evaluation tab above, not claimed in prose.

🚀

Zero-ops deployment

Static HTML/CSS/JS. No database, no server, no secrets to rotate. Deployed to GitHub Pages and Vercel directly from this repository.

⚠️ This is a portfolio engineering demonstration, not a production compliance product. Document processing, embeddings and inference all happen locally in your browser tab via WebAssembly — no file you open here is uploaded anywhere.