Ask questions about your PDFs in plain English β 100% in your browser. No upload, no account, no API key. Your PDF never leaves your machine: PDF.js (from a CDN) extracts the text locally, and the same TF-IDF search as the Python tool runs in JavaScript.
Scanned image-only PDFs have no extractable text and are rejected β no OCR yet, same as the Python tool.
Try one:
Loading the sampleβ¦
~600-char chunks 100-char overlap TF-IDF + cosine 0 network calls for search
The JavaScript in app.js is a direct port of the Python backend: localpdfai/chunking.py (chunks never cross a page boundary, so every citation points at exactly one page), localpdfai/embeddings.py (same stopword list, idf = ln((n+1)/(df+1)) + 1, log-scaled term frequency, L2-normalised rows) and localpdfai/index.py (cosine search, ties broken by chunk order β the same question always returns the same passages). Answers are extractive: quoted passages with [p. N] citations and relevance scores. Nothing is invented β and nothing is summarised either; generative answers need the optional local Ollama model in the Python tool.
On the built-in sample the browser search reproduces the Python results exactly: 4 pages, 7 chunks, 6/6 questions top-1 correct (see the full fixture transcript). For an uploaded PDF the numbers can differ slightly from the CLI, because PDF.js and pypdf extract text a little differently β the ranking method is identical.
--backend st) that this static demo can't ship.Local PDF AI on GitHub β MIT licensed. Prefer the command line? pip install -r requirements.txt, then python -m localpdfai ask --pdf your.pdf --q "your question". Measured results on a real document: sample Q&A page.