← All publications

Document answers with page-level evidence

Sanad’s new document-answering pipeline combines PDF extraction, source verification, and an explicit review state when the evidence does not agree.

Ask a bounded question about a PDF

We have added a document-question-answering pipeline to Sanad. Submit a PDF and a question; the service processes the document and returns an answer with source page numbers, or a status explaining that the answer could not be confirmed.

Consider an invoice question that asks for the total amount and currency. Recognizing a plausible number is only part of the job. The answer must refer to the right field, preserve the value on the page, and avoid treating a subtotal or tax amount as the final total.

Check the answer against the source

The pipeline handles page orientation, text extraction, evidence discovery, answer generation, and source verification. Critical values and disputed evidence can be checked against the original rendered page rather than accepted solely from the extracted text.

When the stages disagree or the available evidence is inadequate, the result can require review. That outcome is part of the answer contract: a caller needs to distinguish a supported answer from one that should be inspected by a person.

A job that can be followed and retried

Document questions run as jobs. Submission returns a job identifier and status URL, allowing the client to follow progress without keeping the original request open. An idempotency key lets a client retry the same submission without intentionally creating another job.

The implementation includes controls around document handling, job state, and usage accounting. Those controls matter for a long-running pipeline, where a network interruption may happen after processing has already begun.

A controlled beta

This version is for operator-approved beta testing. Internal evaluation has informed the pipeline design, but a broader holdout is needed to establish performance across document types. We are particularly interested in tables, cross-page questions, rotated pages, and questions the document cannot answer.

The useful result is an answer a reader can trace to the source, with uncertainty preserved when that trace is incomplete.

Further reading