Design slide deck Q&A that cites the right slide without blowing the token budget
Product wants users to upload slide decks and ask questions, with every answer citing the slide it came from. Decks are visually dense: diagrams, charts, screenshots, sparse text. Lay out the key design decisions and the tradeoffs behind each.
Index slide images once at upload, retrieve a few candidates per question, send those few slides at high detail to the VLM, and let citations fall out of the slide-number metadata.
Imagine someone hands you a 60-page picture book and asks you a question about it. You do not read every page aloud every time someone asks. Instead, the first time you see the book you flip through it once, take notes on what each page is about, and write the page number on every note. Later, when a question comes in, you check your notes to find the two or three pages that might answer it and only look at those pages carefully. The answer comes with a page number for free. That is the whole design. Slides are pictures, retrieval finds the right pictures, the model only looks at a few of them.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Slide-deck Q&A is the canonical multimodal RAG product. Users upload a deck, ask questions, and expect grounded answers with slide-level citations. The deck is visually dense: diagrams, charts, screenshots, sparse text laid out for visual scanning rather than reading. A text-only RAG approach throws away the meaning that lives in the visuals. A naive vision approach (send the whole deck on every question) explodes cost and buries the relevant slide in noise.
The right design is a two-pass pipeline: expensive once at upload, cheap on every question. Retrieval narrows the model's attention to a few candidate slides; citations fall out of retrieval metadata; cost stays linear in deck size on upload and constant per question. This walkthrough lays out the architecture and the tradeoffs at each layer.
Mental model: the deck is a small visual library. Build the catalogue card once; look up the catalogue every time someone asks a question.
Upload pipeline: index once, cache forever
When a deck arrives, the system does its only expensive pass. The output is a per-deck index that every future question hits.
Render each slide to an image at near-native resolution. Long edge 1280 to 1600 px is a good default: large enough to preserve chart labels, small enough to fit comfortably in provider tile limits. Use PNG to avoid JPEG artifacts on diagrams.
Compute a multimodal embedding per slide. Options in 2026 include Voyage Multimodal 3, Cohere Embed v4, OpenAI's text-embedding-3-large with image extension, or open-source SigLIP-family encoders. The embedding lets you search slides by visual content, not just text.
Extract text via the VLM. A one-shot OCR pass per slide produces title, body text, speaker notes, and any in-image text. Store this text both for hybrid retrieval and for cheap summary answers that do not require sending the image back.
Index by (deck_id, slide_number). The slide number is the citation. Every retrieval result carries it; the model never has to invent it.
Cache aggressively. If the deck is re-opened, re-indexing is free. If the deck is shared across users, the index is shared. Upload cost is paid once per deck, not once per user.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- ColPali and ColQwen demonstrate per-page image-embedding retrieval over PDFs and decks, dramatically outperforming text-only baselines on visual documents.
- Anthropic's Claude Sonnet 4.6 with vision is the typical answer model for this design, with citations grounded to slide numbers.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you handle cross-slide questions like 'compare slide 14 and slide 22'?
Either user pins both slides explicitly, or retrieval expansion: if the question references slide numbers, force-include them; if it asks to compare, retrieve top-k and let the model reason across them.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Sending the whole deck as images on every question. A 60-slide deck at high detail is 50k-plus tokens before the question even starts, blowing latency and cost and burying the relevant slide in noise.
60 second bullets to scan on the way to the call.
Why slide images beat extracted text as the source of truth
The upload-time versus query-time work split
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.