Paper-to-Deck
Project, 2026

- Timeline
- 3 days, Jun to Jul 2026
- Tools
- Python, Google ADK, Gemini 2.5 Flash, MCP, PyMuPDF, FastAPI, Reveal.js, Cloud Run
Overview
Paper-to-Deck turns a research PDF into a Reveal.js slide deck paced to the talk length you set. Four agents in a Google ADK pipeline split the work: constraints, outline, figure matching and rendering. Every figure on a slide is cropped from the paper itself. I built it for the Kaggle 5-Day AI Agents (Vibe Coding) Capstone.
Background
Turning a dense paper into a talk of a fixed length takes hours. You read the derivations, snip the figures and tables, restructure the argument into slides and then format them. Paper-to-Deck is meant to do that work, respect the time limit, and not make up layout or content.
Architecture
A FastAPI app hands the checked PDF and your constraints to an ADK SequentialAgent. Each agent writes one piece of state that the next one reads.
Inference runs on Gemini 2.5 Flash through Vertex AI with Application Default Credentials, so no API key is stored anywhere. The service is containerized for Cloud Run.
The hard parts
Getting the figures out of a PDF
The first version found each “Figure N” or “Table N” caption with PyMuPDF and cropped the region directly above it. The version that shipped is a hybrid. PyMuPDF still pulls the text and finds the captions. A page with a caption is rasterized and its body text whited out. Gemini Vision then returns figure bounding boxes on a 0 to 1000 scale, and PyMuPDF crops along them. Whiting out the text is there to get tighter boxes, and pages with no caption never reach the vision model, which saves time and API cost.
Keeping the model out of the HTML
The Frontend Coder never writes markup. It calls a deterministic renderer. Every piece of text goes through escape_text, images must match assets/*.png|jpg|jpeg, and every path has to resolve under one sandbox root. The Distiller is told to write plain text and unicode math, with no raw LaTeX or markdown, to protect the renderer.
Hitting the time budget
The Distiller splits the paper into the number of main slides that fits the talk length. Heavy derivations and secondary graphs move into up to 20 hidden appendix slides.
Honest limits
- Extraction depends on captions. A figure on a page with no “Figure N” or “Table N” caption never reaches the vision model, so it is missed. If the vision call fails, that page gives no figures.
- The Cloud Run service requires authentication, so there is no public demo URL. Running it yourself needs a Google Cloud project.
Results

The repo has 35 tests covering the schemas, security boundaries, PDF parsing, the MCP server, HTML rendering, the agent pipeline, the deployment files and the web backend.
Takeaways
Give the model the judgment calls and keep it away from output it could break. The agents decide the outline and which figure goes where. Deterministic code does the cropping and writes the HTML.