A page image preserves visual information that text extraction can lose, especially when an answer lives in a figure, table, or scan. Attach the rendered page to the generation context when only a few pages need visual recovery; use a visual index when parsing fails across the corpus. section 15.6.5
Choose the least costly visual strategy that addresses the failure mode:
- Parse and rerank by default for strong text retrieval with one vector per chunk. section 15.6.5
- Attach a page image at query time when visual content may contain the answer and indexing changes are undesirable. section 15.6.5
- Build a visual index only when parsing failures are widespread, accepting additional maintenance and model constraints. section 15.6.5
Answering from a rendered page
Render a selected PDF page with PyMuPDF, encode the PNG as base64, and send it with a question to an image-capable chat model. A clipped upper portion can target a figure, such as asking which tasks it shows and what input each task uses.
