Parsing PDFs for RAG: Vision Models + Embeddings
Turn complex PDFs (slide decks, reports) into retrieval-ready content: dual parsing with pdfminer (text) and a vision model via the Responses API (images), per-page chunking, text-embedding-3-small embeddings, cosine similarity search. Plus two shortcuts: whole-PDF input via input_file and managed file_search.
The Problem with Complex PDFs
Standard PDF parsers lose tables, diagrams, and slide formatting. The OpenAI Cookbook recipe (now archived and written for GPT-4o) solves this with two parallel methods:
- pdfminer — extracts raw text (fast, no GPU)
- a vision model — analyzes each page as an image, describing diagrams and layouts
There is now a shorter path too: the Responses API accepts a whole PDF. The manual pipeline in this lesson is for cases where you want control over chunks, page descriptions, and cost.
The rest of this lesson opens after a free sign-up
Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.


