TAI BUI
Back to curriculum
BuildPython

Multimodal RAG and Cross-Modal Retrieval

Vision-native document RAG is one slice. Production multimodal RAG goes wider: it retrieves across text, images, audio, and video for workflows like trip planning ("find me a quiet vegan brunch with natural light"), medical triage ("what injury matches this photo + these notes"), e-commerce ("outfits similar to this selfie, in my size"), and field service ("diagnose this engine sound plus photo of the part"). Three 2025 surveys by Abootorabi et al., Mei et al., and Zhao et al. codified the sub-problems: cross-modal retrieval, retrieval fusion, generation grounding, and multimodal evaluation. This lesson reads the surveys, then designs a production pipeline.

TIME: ~180 minutesPREREQUISITES: Phase 12 · 23 (ColPali), Phase 11 (RAG basics)

Learning Objectives

  • Design cross-modal retrieval: text → image, image → text, audio → video, etc.
  • Compare three fusion strategies: score fusion, attention-based fusion, MoE fusion.
  • Explain generation grounding: what "cite your sources" looks like when sources are a mix of modalities.
  • Name the three canonical multimodal RAG surveys of 2025 and their sub-problem taxonomy.

The Problem

Single-modality RAG is a settled pattern: embed the query, embed the chunks, retrieve, stuff the results into the LLM. Multimodal RAG adds four requirements:

  1. Multiple retrieval heads, because each modality needs embeddings in a compatible space.
  2. Fusion of retrieval results across modalities.
  3. Generation grounding that cites sources across modalities.
  4. Evaluation metrics that cover cross-modal signal.

The 2025 surveys arrive at the same taxonomy.

Warm-up0/3
1. In basic single-modality RAG from Phase 11, what happens once the query has been embedded?Warm-up
A flow of three boxes: user query, embedding model producing a query vector, then a dashed box asking what the next step is. Below it, four stored chunks each with its own vector, and a separate LLM box.
Typed schematic of the setup in the stem.
2. ColPali (Phase 12 · 23) retrieves documents in which way?Warm-up
Three schematic document pages, each with a title bar, text lines, a small bar chart and a few lines at the bottom. To the right, a dashed box reads ColPali retrieves pages with a question mark.
Schematic pages (typed). The stem names ColPali; how it retrieves is the question.
3. Two embedding vectors are compared with cosine similarity, and the result is close to 1. What does that indicate?Warm-up
Two items, a photo and a caption, each with a row of eight bars standing for its embedding vector. Arrows from both vectors lead to a box that reads cosine similarity, result close to 1.
Typed schematic; the bar heights are illustrative, not real embeddings.
Check: The Problem0/1
1. Which of these is one of the four things multimodal RAG needs beyond embed, retrieve, and generate?Define
Top: a single-modality pipeline of three boxes, embed, retrieve and generate. Below: a query connected to three stores, text docs, photos and audio clips, next to a dashed region titled four extra requirements holding four question-mark boxes.
Typed schematic of the stem.

The Concept

Cross-modal retrieval

Retrieve documents of modality B given a query of modality A. There are three patterns.

  1. Shared embedding space. CLIP and CLAP produce text + image and text + audio embeddings in a shared space, so cosine similarity across modalities works directly. You are limited to what CLIP-style training pairs cover.

  2. Per-modality encoder + translation. A text encoder, an image encoder, and a small translator module that maps between the spaces. Sen2Sen by Gupta et al. and other 2024 designs work this way. It is flexible but adds moving parts.

  3. VLM as encoder. Use a VLM's hidden states as the retrieval representation, and any modality the VLM supports works. Quality is higher and so is the cost.

My pick: CLIP / SigLIP 2 for text+image, CLAP for text+audio, and VLM hidden states when you need frontier-quality cross-modal retrieval.

Fusion strategies

Say you retrieved 10 results: 5 images, 3 text passages, 2 audio clips. How do you merge them?

Score fusion is the cheapest. Each modality has its own retriever and returns its own scores. Normalize the scores within each modality, then sum. It is simple and often good enough.

Attention-based fusion concatenates all retrieved items and lets a small attention network weight them. It needs training.

MoE fusion uses a gating network to route to modality-specific experts. Different query types route differently, so a visual question weights images higher.

The production default is score fusion with a slight bias toward the query's dominant modality. Move to MoE if an A/B test shows clear wins on your domain.

Generation grounding

The LLM should cite which retrieved item drove each claim. With mixed modalities the formats look like this:

  • Text source: standard citation [1].
  • Image source: [img 3] with a short caption.
  • Audio: [audio 2 at 0:34].

To get this behavior, train the generator on grounding-aware data where each claim in the training target is tagged with its source index. At inference the model then emits citations on its own.

The 2025 surveys

Abootorabi et al. (arXiv:2502.08826, "Ask in Any Modality") give a taxonomy for multimodal RAG covering retrieval, fusion, and generation. It has the broadest coverage of the three.

Mei et al. (arXiv:2504.08748, "A Survey of Multimodal RAG") focus on sub-task benchmarks and failure modes, which makes it the one to read when you design evaluation.

Zhao et al. (arXiv:2503.18016) wrote a vision-focused survey that is strong on ColPali-family work.

Read all three and you have the state of the art as of spring 2025. Most of the sub-problems are still open.

MuRAG, the foundational paper

MuRAG (Chen et al., 2022) was the first multimodal RAG. It retrieved images and text from a multimodal KB and generated answers from them, which showed the idea was feasible before the VLM wave. Modern systems like REACT, VisRAG, and M3DocRAG build on it.

A production trip-planner example

Query: "find me a quiet vegan brunch with natural light."

The pipeline:

  1. Decompose the query. "quiet" maps to an audio or review keyword, "vegan brunch" to a menu item, and "natural light" to an image feature.
  2. Retrieve per modality:
    • Text retrieval on reviews: "vegan brunch, quiet ambiance."
    • Image retrieval on restaurant photos: "natural light, airy."
    • Audio retrieval on ambient-sound clips: "low decibel, no music."
  3. Fuse scores so each restaurant gets a composite score.
  4. Send the top-k restaurants to a VLM generator along with the evidence, and return an answer with citations.

That goes well beyond text-RAG. Each modality adds signal that text alone misses.

Agentic multimodal RAG

Multi-hop retrieval handles the case where the first pass does not return a high-confidence answer: the LLM reformulates the query and retrieves again. The agentic RAG patterns from Phase 14 apply here. Two examples:

  • Retrieve the initial top-10, then the LLM says "too noisy, filter for <40 dB" and re-retrieves.
  • Retrieve images, notice that one shows a menu, then retrieve the menu text and answer.

This adds complexity, but it handles queries that single-shot retrieval cannot.

Evaluation

Cross-modal evaluation is still immature. The common proxies:

  • Recall@k per modality.
  • Fused top-k accuracy.
  • Human-judged end-to-end satisfaction.
  • Task-specific outcomes (bookings completed, purchases made).

No standard benchmark spans all modalities, so most papers evaluate on domain-specific tasks.

Check: The Concept0/21
1. What is cross-modal retrieval?Define
On the left, a photo of a sunlit room used as the query. An arrow labelled retrieve leads to two text snippets of restaurant reviews: lots of windows, and airy space lots of sun.
Typed example. Snippets are phrases from the corpus in main.py; the picture does not show a real retrieval run.
2. What is score fusion, and what does the Fusion strategies section call the production default?Define
Three columns of result chips from three retrievers: 3 text, 5 image and 2 audio. Arrows from all three columns lead down to a dashed box that reads score fusion with a question mark.
Typed schematic of the lesson's 10-result example.
3. What does attention-based fusion do, and how does it compare with score fusion?Define
Ten result chips, 5 image, 3 text and 2 audio, with an arrow down to a dashed box labelled attention-based fusion and then to a fused result.
Typed schematic.
4. What does MoE fusion do with retrieval results from several modalities?Define
Three boxes, reviews, photos and ambient clips, each with an arrow into a dashed box labelled MoE fusion, which leads to a ranking box.
Typed schematic.
5. How should a grounded multimodal answer cite its sources?Define
An answer card with three claims, about windows, a bright room and a low ambient level, each followed by an empty dashed citation slot. Beside it, three source boxes: a review passage, a restaurant photo and an ambient-sound clip.
Typed example. The sentences are invented for illustration.
6. What is MuRAG?Define
A list of five references with author, title and arXiv number: Abootorabi et al. Ask in Any Modality, Mei et al. A Survey of Multimodal RAG, Zhao et al. Vision RAG Survey, Chen et al. MuRAG, and Liu et al. REACT. The MuRAG row is highlighted.
Entries copied from the lesson's reading list.
7. What is agentic multi-hop retrieval?Define
Three connected steps and a dashed box: retrieve images as hop 1, a retrieved photo is shown, the LLM sees a menu in the photo, then a dashed box reading next step with a question mark. A line below says what comes next is left out.
The first half of the lesson's second multi-hop example, drawn as a typed schematic.
8. Which description matches the per-modality encoder plus translation pattern?Define
Two boxes side by side. The left is a text space with three labelled points: natural light, dim and airy. The right is an image space with three points: photo 1, photo 2 and photo 3. Nothing connects the two boxes.
Typed schematic. Point positions are illustrative.
9. What is the state of multimodal RAG benchmarking, per the Evaluation section?Define
Four boxes for text, image, audio and video. A dashed bar below spans all four and reads one benchmark that spans all four, question mark. A line asks how the field evaluates cross-modal systems today.
Typed schematic.
10. Why does score fusion normalize each modality's scores before summing them?Explain
Three retriever boxes, text, image and audio, each labelled scores, feed a highlighted box labelled normalize per modality, then a sum box, then a ranking.
Typed schematic of the stem.
11. Why is the generator trained on data in which each claim is tagged with its source index?Explain
Three source boxes, a review, a photo and an audio clip, next to a training target card. The target has three sentences, each ending in a source tag: src 1, src 2 and src 3.
Typed example; the sentences and the src tag style are illustrative.
12. Why does the lesson make score fusion the production default and treat MoE fusion as a later move?Explain
Two boxes side by side: score fusion, marked production default, and MoE fusion, marked a later move. A line asks why this order.
Typed schematic of the stem.
13. You are building text+image search and text+audio search. Which encoder pairing does the Cross-modal retrieval section recommend?Apply
Two rows. Top row: a text query and an image library, each linked to a dashed box labelled encoder with a question mark, with the label image search. Bottom row: the same with an audio library, labelled audio search.
Typed schematic of the stem.
14. Your team needs to design an evaluation for a multimodal RAG system. Which 2025 survey does the 2025 surveys section point you to?Apply
Under the task heading design the evaluation for a multimodal RAG system, three survey cards: Abootorabi et al. Ask in Any Modality, Feb 2025; Zhao et al. Vision RAG Survey, Mar 2025; Mei et al. A Survey of Multimodal RAG, Apr 2025.
Titles and months come from the lesson and main.py. The picture does not say what each covers.
15. In the trip-planner query "find me a quiet vegan brunch with natural light", which retrieval head addresses the phrase "natural light"?Apply
The query find me a quiet vegan brunch with natural light, with the words natural light underlined. Below it, one corpus record, Sunday Plant Bistro, with its review text, two plain photo thumbnails and an ambient level of 38 dB.
Review text and 38 dB are from main.py's corpus; the thumbnails are generic placeholders, not the restaurant's real photos.
16. An initial audio retrieval for a quiet-restaurant query returns noisy results. Which response fits the Agentic multimodal RAG section?Apply
Six audio clip thumbnails with jagged waveforms, labelled clip 1 to clip 6, returned for a quiet restaurant query. Below them an LLM box and a line asking what the agentic loop does about the noisy results.
Typed schematic; the waveforms are drawn, not recordings.
17. Plain score fusion applies one fixed set of weights to every query. Which problem follows, and how does MoE fusion avoid it?Analyze
Two query boxes, query 1 and query 2, each with an arrow into a single box labelled fixed weights 0.3 / 0.4 / 0.3. Text below asks what problem follows and how MoE fusion avoids it.
Typed schematic. The weights are the ones main.py passes in round 1.
18. A multimodal RAG system retrieves the right restaurants, but its answers carry no per-claim sources, so users cannot tell which photo or clip backed a claim. Which ingredient is missing?Analyze
A pipeline of query, retrieve plus fuse, and generator, ending in an answer card with two claims about Sunday Plant Bistro and the note no source on any claim. A box on the left records the user question: which photo or clip backed this claim?
Typed example based on the stem.
19. A small team must ship text+image product search in a month and has no labeled data to train a fusion network. Which design fits?Design
Three constraint rows: deadline one month, modalities text plus image product search, and labeled data for training fusion none. A line below reads text retriever plus image retriever, then a fusion step with a question mark.
Typed summary of the stem.
20. A field-service app diagnoses faults from engine audio plus a part photo. Most queries resolve in one pass, a few come back low confidence, and latency matters. Which design fits?Design
An engine audio waveform and a part photo feed a box labelled fused retrieval, which leads to a fault diagnosis box. A line says most queries resolve in one pass, a few come back low confidence, and latency matters.
Typed schematic of the stem; the waveform and photo are drawn.
21. You must evaluate a trip-planner multimodal RAG, and no standard benchmark spans all of its modalities. Which plan fits?Design
Reviews, photos and ambient clips feed a fusion box, then an answer box, then the user. A dashed bar below reads no standard benchmark spans all of these modalities.
Typed schematic of the stem.

Use It

code/main.py is a stdlib-only toy over a five-restaurant corpus. It contains:

  • Three mock retrievers (text, image, audio). The text one is keyword counting over review text, the image one matches tags like natural_light and airy, and the audio one scores restaurants by ambient decibel level when the query says "quiet" or "calm".
  • Score fusion that combines the modality scores with configurable weights. It is a plain weighted sum, with no per-modality normalization.
  • A generator stub that prints the ranked restaurants with their citation tags. No model is involved.
  • A simple agentic loop that reformulates the query when the top fused score falls below a confidence floor.
Check: Use It0/6
1. In main.py, a query containing "quiet" makes audio_retrieve score each restaurant as max(0, 1 - ambient_db / 80). What does Sunday Plant Bistro, at 38 dB, receive?Apply
A terminal quoting the quiet branch of audio_retrieve: the if line, the loop over the corpus, and the line scores[r.id] = max(0.0, 1.0 - r.ambient_db / 80.0). Below it, a table of five restaurants with their ambient dB: Sunday Plant Bistro 38, Orange Grove Cafe 68, Vine & Leaf 55, Morning Glow 42, Steak Central 72. Sunday Plant Bistro's audio score cell is a question mark.
The lines and decibel levels are from main.py. Only Sunday Plant Bistro is asked about.
2. For the query "find me a quiet vegan brunch with natural light", main.py's image_retrieve looks for the tag natural_light. What does Vine & Leaf, tagged warm_lighting, score?Apply
A terminal quoting the lines that add natural_light to the tag hints when the query contains light. Below it, a table of five restaurants with their image tags. The Vine & Leaf row, tagged warm_lighting, is highlighted with a question mark in the score column.
Tags and lines are from main.py. The scoring line is left out on purpose.
3. In main.py's trace, round 1 ranks Sunday Plant Bistro first at 0.69, and main() passes a confidence floor of 0.7. What does agentic_loop do next?Apply
A terminal showing only the first line of the trace, round 1 with top r1 and confidence 0.69, followed by a placeholder for the rest. Below it a bar filled to 0.69 with a marker at the floor 0.7, and the call agentic_loop(query, confidence_floor=0.7).
The round 1 line is real output of main.py; the lines after it are hidden.
4. In round 2 of main.py the weights change from 0.3/0.4/0.3 to 0.3/0.5/0.2 for text/image/audio. Sunday Plant Bistro has text 0.43, image 1.0, audio 0.525. What is its fused score?Apply
A table with the text, image and audio columns: round 1 weights 0.3, 0.4, 0.3; round 2 weights 0.3, 0.5, 0.2, with a question mark in the fused column; and Sunday Plant Bistro's scores 0.43, 1.0 and 0.525. A line states that fused is the sum of weight times score.
Numbers are from the stem and main.py.
5. One restaurant's reviews repeat "vegan brunch" so often that its text score passes 1.0, and it can outrank restaurants that match far better on photos and ambient sound. Which part of the toy explains this?Analyze
A card with typed review text repeating vegan brunch many times, an arrow to a box saying text score passes 1.0, and two boxes saying photos match poorly and ambient sound matches poorly. All feed a dashed box that combines the three scores into a ranking.
Typed example based on the stem; the review text is invented.
6. A user asks for a "vegan brunch with airy space", with no mention of quiet or calm. main.py's audio_retrieve returns 0.5 for every restaurant. What effect does audio have on the ranking?Analyze
A table of five restaurants with text, image and audio scores for the query vegan brunch with airy space, and a question mark in each fused cell. The audio column reads 0.50 for every restaurant. Morning Glow has text 0.80 and image 1.00.
Text and image scores are main.py output for this query; the fused column is hidden.

Ship It

This lesson produces outputs/skill-multimodal-rag-designer.md. Give it a product spec with a multimodal query flow and it designs the retrievers, fusion, generator, and evaluation.

Author's Note

I'd run main.py and read the two rounds of the trace before anything else. On the trip-planner query, round 1 puts Sunday Plant Bistro on top at 0.69, which is under the 0.7 floor that main() passes in, so the loop reformulates. Round 2 lifts it to 0.73 and the top-3 list prints with citation tags attached. You can watch fusion, a confidence check, and a retry happen in about a screen of output.

My bet is that the part worth poking at is the weights, not the retrievers. The retrievers are crude on purpose: keyword counts, tag matches, and a decibel formula. The reformulation does not touch text retrieval at all. It appends words to the query and re-runs image and audio retrieval, but the original query already triggers the same tag hints and the quiet branch, so those scores come out identical. The only thing that moves the result is the weight shift from 0.3/0.4/0.3 to 0.3/0.5/0.2, which is what lifts 0.69 to 0.73. Change those numbers and watch the ranking move. That is a hand-set version of the dominant-modality bias from the Fusion strategies section, in a form you can feel.

I'd also keep the toy in proportion. The text score is a keyword count divided by query length, so it is not on the same 0-to-1 scale as the other two, and fuse() does not normalize it. The survey-grade version normalizes within each modality first, as described above, and swaps these mock retrievers for CLIP-style or CLAP-style embeddings. The generator here only formats citations, so the grounding training described earlier is not something this file demonstrates.

Exercises

  1. Propose a medical-triage multimodal RAG: query = photo of injury + text symptoms. What modalities retrieve from what KB?

  2. Score fusion is a simple weighted sum. What failure mode does it have that MoE fusion avoids?

  3. Read Abootorabi et al.'s taxonomy (Section 3). What are the three canonical sub-problems and how do they map to your chosen product?

  4. Design an eval spec for a trip-planner multimodal RAG. What metrics cover image recall, audio recall, and composite correctness?

  5. Agentic multi-hop RAG has a latency tax per round-trip. At what query difficulty does the accuracy gain justify the latency?

Key Terms

TermWhat people sayWhat it actually means
Cross-modal retrieval"Query one modality, retrieve another"Text query retrieves images; image query retrieves text; requires a shared space or translator
Score fusion"Combine scores"Weighted sum of per-modality retrieval scores; simplest fusion
MoE fusion"Modality-routed experts"Gating network picks which modality's scores to trust per query
Grounded generation"Cite your sources"Each claim in the answer tagged with the source index
MuRAG"First multimodal RAG"2022 paper that established the multimodal RAG pattern
Agentic multi-hop"Reformulate and retry"LLM re-queries retrievers when first-pass confidence is low

Further Reading

Code

Ships With