A / 04 / Offline document question answering
Folio
A local PDF question-answering pipeline that traces answers and supporting excerpts back to specific pages.
- Python
- FAISS
- llama.cpp
Problem
A reader asking a question about a long PDF needs a way to trace the answer back to the original page and inspect the evidence.
Context and constraints
The reviewed implementation is a Python pipeline that loads local model weights and processes extracted PDF text. Offline inference assumes the needed models and dependencies are already available.
Role and contribution
The repository provides implementation evidence. Sajid’s individual contribution and release scope are pending confirmation.
Solution
Folio retrieves relevant passages, supplies them to a local language model, and returns an answer with page references. A second pass proposes a quote for comparison with the source.
Architecture
The pipeline extracts and chunks PDF pages, embeds the chunks, and retrieves candidates with FAISS before reranking. The answerer uses llama.cpp and preserves page numbers through the verification step.
Engineering decisions
Answer generation and quote checking run separately. Quote verification compares the proposed text with retrieved passages and returns the matching source sentence and page when it finds a match.
H / Project exhibit
Visual showcase
Implementation evidence
The source implements retrieval, local generation, and page-aware quote checking. Answer accuracy, supported document coverage, and end-user results are pending confirmation.