FDE Cohort 1 Session 6: Multimodal RAG (When the Answer Only Exists in Pixels)

see multimodal RAG explained

A recap of Session 6 of The AI FDE Certification, Cohort 1 (#FDE1) · By the AI Makerspace Curriculum Team

Last session, Nadia proved that agentic RAG could answer questions from text files. In Session 6, her job got more realistic. Very rarely is a process just text. Most of the time, a blend of text and images has to be considered to reach the right answer, and some answers live only in pixels.

Phil Mui led the concepts, and Tyler Laughlin took us through the code.

What We Mean by Multimodal

Phil’s definition: multimodal is how you process different types of data, such as text, images, audio, and video, with one of these new AI models. He started with a quick refresher on text RAG, which is two pipelines. One indexes and processes text, such as a pile of PDFs, so the most relevant chunks can be found later. The other runs at query time: it retrieves the chunks for a query and puts them in the context before a language model writes the answer.

Is RAG still relevant? Phil’s answer was yes. At its heart, RAG is in-context learning: bringing a model information it no longer has about the world after training, which reduces the chance it says whatever is in its weights. Multimodal RAG simply extends the same two pipelines so they bring in information across different modalities, which matters most for enterprise data that lives in charts and graphs.

Three Approaches to Retrieving Images

Phil used image retrieval to introduce the three general approaches.

1. Turn the image into text. This is the oldest approach, around for roughly ten years. A vision-language model writes a caption for each image, you embed the text with metadata so you can retrieve the image later, and you process everything as text, which we already know how to do.

2. Embed text and images in one shared space. The CLIP paper from OpenAI (Contrastive Language-Image Pre-training) made this possible in the last few years. The image of an apple and the word “apple” each become a vector, and training pushes those vectors as close together as possible. Query for “apple” and both the image and the text come back.

CLIP gives you one dense vector per image, so it falls apart on complex technical diagrams, scientific papers, or consulting decks full of tables and graphs. That’s where ColPali comes in, a multi-vector approach that breaks each image into patches and gives each patch its own vector. At search time, a late interaction model can return part of an image, which gives you sub-page granularity, like finding the caption of a table on page 24.

The tradeoff is cost. For the same input, where CLIP might need a terabyte of storage, a multi-vector approach might need a hundred to a thousand. With more than a thousand documents of 10 to 100 pages each, it won’t scale well unless you’re the U.S. government or you build submarines. Phil’s guidance:

  • Single-image granularity (find all photos with grandma in them, zero-shot tagging, even a billion photos): use CLIP.
  • Text-rich, table-rich, or technical documents where you need sub-page citation accuracy: ColPali has a better shot, if you can afford it.

3. Keep them separate and fuse the results. Which brings us to the modality gap.

The Modality Gap

Even in a shared embedding space, images and text tend to cluster with their own kind. We ask these systems questions in text, so text results crowd out the images. The fix is reciprocal rank fusion: process each modality in its own stack, retrieve results from each, and merge them by rank. You can give different modalities different weights, which is where much of the differentiation lies.

Video Is the Same Idea

Video follows from images. Most videos have a timestamped transcript, and every video is a series of frames. You embed the text and the frames at indexing time using the same techniques, keep metadata about where each came from, and at retrieval time get back not just which video but which time frame is most relevant.

Into the Notebook

Tyler picked up with Nadia and her six memos and six charts. Many of her answers exist only in pixels, so the text-only RAG from last time can’t find them. Others have half the answer in a chart and half in a memo, and you need both to answer the way your manager expects.

Before starting, he reminded students to uncomment the model they want in the environment file, because the notebook uses a vision-language model on top of your main key. The default is GPT-4 Mini, and Tyler used Claude.

Try it: pick a strategy

Three ways to find an answer that lives in a chart

How it works

A vision model writes a description of each chart. You embed and search that text, so the image itself is never read at query time.

In the notebook

“Which quarter had the most support tickets?”

ChartQuarterly tickets chart, found because its caption mentions quarters and tickets
Watch out for

If the parser never mentions it, it can’t be found. Richer descriptions or a visual model fix that.

The trade-off

Higher up-front cost, since every image gets described, but very few moving parts.

How it works

Text and images share one embedding space, so a query can match pixels directly. CLIP can look at images, but it can’t read them.

In the notebook

“A bar chart comparing latency across regions”

TextText document
TextText document
TextText document
ChartThe correct bar chart

Illustrative. In the unified ranking, only text documents came back, which should be suspicious when you ask for a bar chart. Ranked on their own, the images did surface the correct chart.

Watch out for

The modality gap. You ask in text, so text results crowd out images even when the answer is in one.

The trade-off

It reads native pixels, but mixing text and images in one ranking can hide the right answer.

How it works

Keep a text store and an image store. Search each one, then merge the two ranked lists by rank. That merge is reciprocal rank fusion.

In the notebook

“Why did the on-call engineers get paged?”

TextThe memo that explains it
ChartIts matching chart

Both landed in the top two, so you read one ranked answer instead of two separate lists.

Watch out for

It has the most pieces to build and tune. Set up the backend and the fusion carefully.

The trade-off

The most robust answers, and cheaper than a multi-vector system like ColPali.

AI Makerspace · The AI FDE Certification

The Out-of-the-Box Framework

Tyler started with a framework, LlamaIndex, to show how far you get for free. Text goes through a BGE small embedder (384 dimensions) and images through a CLIP tower, and each returns its own top hits. The top results go to the vision model, which answered “which quarter had the most support tickets?” by reading a bar chart.

That’s about 30 lines of code for what Tyler called a strong B-plus. The gaps are what you find when you put it in front of customers: no merge rule (text and image hits come back as two separate lists), no verified captions, no token count, and no permission filter, which matters if your data is sensitive.

Step One: Parse the Charts

The vision model first acts as a parser. It turns each image into a structured record: what kind of chart it is, its title, its takeaway, and its data points, so that it can be searched like any other text. This is much faster than paying someone to summarize each chart, but you’re limited by how good the vision model is, so check your numbers before you index them. The notebook compares the parsed numbers against an answer key. An “invented” column flags values that weren’t in the picture but were inferred, like a yearly total computed from four quarters.

Three Strategies, Tested

A. Caption text only. You describe each image in text, embed the text, and index it. No vision embedding is needed. The chart comes back because its title and description mention quarters and tickets, but at query time nothing is reading the image. The limit is how verbose and accurate your descriptions are. If the parser never mentions it, it can’t be found.

B. One shared space with CLIP. CLIP can look at images but can’t read them. In Tyler’s words, it’s illiterate. Asked for a bar chart of latency across regions, the unified ranking returned only text documents, which should be suspicious. Ranking images alone found the right chart. That’s the modality gap in action.

C. Separate stores with reciprocal rank fusion. Keeping the text and CLIP stores separate and fusing by rank, the question “why did the on-call engineers get paged?” returned both the memo and its matching chart in the top two. The answers cite where each came from, so customers can double-check, and combination questions pull from a chart and a document together.

The tradeoffs at a glance:

  • A has a much higher up-front ingestion cost, since you process and describe every image, but very few moving parts.
  • B works on native pixels, but you can run into modality gaps when mixing modalities.
  • C gives the most robust answers, but has the most pieces and takes longer to set up. It’s still cheaper than a multi-vector system like ColPali, as long as you set up your backend and fusion properly.

On the golden checks, A did well on factual text questions but much worse on recall of visual content, B ran into modality problems, and C kept the best performance across both. For a pie chart question, A couldn’t read it and returned several PNGs, while C returned the text and the right image.

Tyler’s debugging tip for strategy A: if the parser never mentions it, the answer is richer descriptions or a visual model.

Video

Tyler sped through video, which is strategy C plus time. Transcripts are broken up by when each piece was said, images carry the time they were shown, and each chunk becomes a window of time with frames and text. Asked when the latency alert came up for review, the system found the slide at 26 to 37 seconds, and also that it was first announced in audio at the start of the presentation.

In enterprise, frame explosion is the enemy. The longer the video, the more expensive the parsing, so capture frames when a slide changes rather than the same slide eight times, and manage start and end times so the cost doesn’t break your budget.

For teams on LangChain, the notebook includes code for running this in that format for observability. Bonus tasks help you test the approaches on your own questions to prepare for Technical Challenge 3.

What’s Next

Technical Challenge 3 asks students to implement an MVP with the right retriever. Next up is evals, a way to verify what you built works, and how you can trust it.

This session recording is available here: [VIDEO LINK]

Follow along for more lessons, or join us for the next cohort in January.

Build. 🏗️ Ship. 🚢 Share. 🚀

Your Curriculum Crew at AI Makerspace

Sources and Links

Curriculum Team

Stay on Top of FDE Field Notes with AI Makerspace

Have a challenge or topic you'd like us to cover, a question about our AI Engineering Bootcamp, AI FDE Certification, or enterprise program sprints that can support you?

Our goal at AI Makerspace is to help AI engineers like you learn by building, and for teams to unlock their full potential and effectiveness.

Please schedule a call with us, or send us an email about what you're looking for to greg@aimakerspace.io.