Document Reader

From PDF to cited answerArchitecture of a small document-reading app. Original PDFs remain in object storage. Extracted passages retain source page numbers, so answers link to the original pages. DOCUMENT READER / ARCHITECTURE From PDF to cited answer Upload & parse Search & answer DOCUMENT SERVICE 01 KEEP + PROCESS THE FILE 02 ANSWER WITH SOURCES Read / manage Sign in Requests Metadata Save PDF Enqueue Consume Read PDF Index text by page Search library / retrieve passages Questions use the selected PDF Question + matched passages Answer + source-page links Citations Reader Web app Upload · search · ask Google Identity provider API Document operations PostgreSQL Document metadata Object storage Original PDF Pages kept intact Job queue Parsing jobs Worker Extract PDF text Search index Passages by document with source page numbers LLM Grounded answer with source citations Source pages Quoted passages from original PDF External model Every citation carries the document ID + page number back to the original PDF.

From PDF to
cited answer

    Open full diagram ↗