Multimodal RAG: retrieving images, tables, audio and video as well as text
Multimodal RAG finds and uses images, tables, audio and video alongside text. Use it when the answer lives in a chart, a diagram, a recording or a scanned page that plain text search cannot see.
Multimodal RAG in 60 seconds
- What: retrieval over images, tables, audio and video as well as text, followed by a model that can read the retrieved items.
- Two approaches: embed every media type into one shared vector space, or convert media into text (captions, extracted tables, transcripts) and index that.
- Why: a lot of knowledge is not in prose: charts, screenshots, scanned forms, meeting recordings, product photos.
- Cost: conversion and embedding of media is heavier than text, and storage grows quickly.
- Risk: a poor caption or a bad transcript means the item cannot be found, and the failure is silent.
Where this type fits
Multimodal RAG sits in the structure or media family, with graph, modular and vectorless RAG. Its change is to the data, not the control flow: the loop may be as simple as a single pass, but the things being retrieved are no longer only text. See the overview of RAG types for the map, and multimodal and real-time AI for the models that read these inputs.
The problem it solves
Text-only RAG treats everything as words. If your manuals contain a wiring diagram, a text extractor will skip it, or return the label fragments scattered around it. If your finance reports hold a revenue chart, the numbers in the chart are lost. A recorded training session is invisible unless someone typed up the transcript. The system then answers confidently from whatever text remains, and the key evidence is never seen.
Think of a researcher who may only read the captions of a book and is not allowed to look at the pictures. For many questions the captions are enough. For others, such as 'which terminal does the red wire attach to?', the picture is the answer. Multimodal RAG lets the researcher look at the pictures, and also listen to the recordings.
Tables raise a quieter problem. A table flattened into text loses its row and column structure, so 'Q3 revenue in the EMEA row' becomes a jumble of numbers. Treating a table as its own kind of item, kept with its structure, preserves the relationships that make it useful.
How it works
Two designs are common, and many systems combine them. The first embeds different media directly into one shared vector space using a multimodal embedding model, so a text question and an image land near each other if they mean similar things. The second converts media to text before indexing: captions for images, structured extraction for tables, timestamped transcripts for audio and video. Then ordinary text retrieval works.
- Parse and split by modality: break each source file into text sections, images, tables, audio segments or video scenes, and keep the page or time position of each.
- Represent each item: produce a shared-space embedding, a text surrogate such as a caption or transcript, or both. Keep the original file reference.
- Index with metadata: store the vector, the text surrogate, the modality, the source document, the page or timestamp and the access rights.
- Embed the question: use the same embedding model, or the text surrogate path, so the question can be compared with every modality.
- Retrieve and rerank across modalities: fetch candidates of mixed kinds, then rerank so one modality does not crowd out the rest.
- Read with a multimodal model: pass the actual images, table structures or transcript spans to a model that can use them, and ask for an answer with citations to page or timestamp.
The trade between the two designs is about fidelity and control. A shared embedding space keeps the raw signal, so a visual detail that a caption would miss can still match. It depends, though, on the quality of one embedding model across all media, and it is harder to inspect when something goes wrong. A text surrogate is easy to read, debug, filter and search with keywords. Its weakness is that the caption only contains what the captioning step chose to say.
A practical pattern is to index both. Search with embeddings for recall, and use the surrogate text for keyword matching, filters and the explanation shown to users. Then always pass the original item, not the surrogate, to the model that writes the answer. The surrogate is for finding. The original is for reading.
A worked example
Acme Machines has equipment manuals as scanned PDFs, plus recorded repair walkthroughs. A technician asks: 'What torque setting does the pump bracket need, and is there a video of fitting it?'
- Ingestion (done earlier): the manual is split into text sections, 40 diagrams and 12 tables. Each diagram gets a caption such as 'Exploded view of pump P-200 showing bracket B4 and four bolts'. Each table is stored as rows and columns plus a one-line description. The video is transcribed with timestamps and cut into scenes.
- Question embedding: the question is embedded. Its text surrogate path searches captions, table descriptions and transcript segments as well.
- Candidates: the top results are a table ('Fastener torque values, P-200 series'), a diagram of the bracket, and a transcript segment at 04:12 of video 'Pump P-200 service' that mentions fitting the bracket.
- Rerank: the table and the video segment rank highest. The diagram is kept as supporting context.
- Read: the multimodal model receives the actual table with its structure, the diagram image, and the transcript segment with its timestamp.
- Answer: 'Bracket B4 on pump P-200 needs 25 Nm (torque table, page 31). A walkthrough starts at 04:12 in the service video. The exploded view on page 29 shows the four bolts.' The answer cites page numbers and a timestamp so the technician can check.
[
{'id': 't-31-2', 'modality': 'table', 'surrogate': 'Fastener torque values, P-200 series', 'ref': 'manual-p200.pdf#p31', 'acl': ['field-techs']},
{'id': 'i-29-1', 'modality': 'image', 'surrogate': 'Exploded view of pump P-200 showing bracket B4 and four bolts', 'ref': 'manual-p200.pdf#p29', 'acl': ['field-techs']},
{'id': 'v-12-s5', 'modality': 'video', 'surrogate': 'Fit bracket B4, tighten bolts in a cross pattern', 'ref': 'service-video-12.mp4', 'start_s': 252, 'end_s': 301, 'acl': ['field-techs']}
]Building it
The sketch below shows ingestion with both a shared embedding and a text surrogate, then retrieval with per-modality quotas. Captioning, embedding and the multimodal model are placeholders. The quota step is worth noting: without it, text chunks tend to fill every slot.
MAX_ITEMS = 6
QUOTA = {'text': 3, 'table': 2, 'image': 2, 'video': 2} # limits per modality in the candidate set
# Placeholders: parse_document, caption_model, embed_multimodal, embed_text, vector_store and
# mm_llm stand in for real components.
def ingest(path, acl):
for part in parse_document(path): # yields text, image, table, audio or video parts
if part.modality == 'image':
surrogate = caption_model(part.bytes)
elif part.modality == 'table':
surrogate = describe_table(part.rows) # keep the rows too, not only the description
elif part.modality in ('audio', 'video'):
surrogate = part.transcript # transcript carries start and end times
else:
surrogate = part.text
vector_store.add({
'id': part.id, 'modality': part.modality, 'surrogate': surrogate,
# Two vectors: raw signal for recall, text for keyword and filter paths.
'vec_media': embed_multimodal(part.bytes or surrogate),
'vec_text': embed_text(surrogate),
'ref': part.ref, 'position': part.position, 'acl': acl,
})
def retrieve(question, user):
q_media, q_text = embed_multimodal(question), embed_text(question)
pool = vector_store.search_many([q_media, q_text], top_k=30, filters={'acl': user.groups})
picked, counts = [], {}
for item in rerank(question, pool): # rerank across modalities, best first
if counts.get(item.modality, 0) < QUOTA.get(item.modality, 1):
picked.append(item)
counts[item.modality] = counts.get(item.modality, 0) + 1
if len(picked) == MAX_ITEMS:
break # bound image tokens, which are costly
return picked
def answer(question, user):
items = retrieve(question, user)
# Pass originals to the reader; surrogates were only used to find them.
return mm_llm.generate(question, [load_original(i) for i in items], cite=True)def segment_transcript(words, max_seconds=45):
# words: list of (text, start_s, end_s). Short segments keep each hit close to the moment that matters.
segments, current = [], []
for w in words:
if current and w[2] - current[0][1] > max_seconds:
segments.append({'text': ' '.join(x[0] for x in current),
'start_s': current[0][1], 'end_s': current[-1][2]})
current = []
current.append(w)
if current:
segments.append({'text': ' '.join(x[0] for x in current),
'start_s': current[0][1], 'end_s': current[-1][2]})
return segmentsDesign decisions
- Storage: keep originals in object storage, vectors and surrogates in the index, and a pointer between them. Do not store large binaries in the vector index.
- Embedding strategy: default to indexing both a text surrogate and a shared-space embedding. If you must choose one, choose surrogates first, because they are easier to inspect and fix.
- Latency: do all captioning, table extraction and transcription at ingestion time. At query time, limit the number of images and video segments sent to the model, since each one adds tokens and delay.
- Cost: media processing is the largest bill. Process new files once, cache results by file hash, and skip decorative images such as logos.
- Access control: copy the document's permissions onto every derived item, including captions and transcripts. A transcript of a restricted meeting is as restricted as the recording. See security.
- Versioning: record which captioning and embedding model version produced each entry. A model change means re-embedding, and mixed vectors from two models cannot be compared.
- Failure handling: flag files whose extraction failed or returned empty text, such as a blurred scan. Surface them in a report so someone can fix the source.
Measuring it
- Recall by modality: for questions where the answer lives in a known image, table or video segment, the share of questions whose top results include that item. Report each modality separately, since an average hides the weak one.
- Surrogate quality: on a sample, have reviewers rate whether a caption or description would let them find the item. Poor surrogates explain most misses.
- Transcript accuracy: word error rate on a sample of audio with human transcripts, and the share of segments with correct timestamps.
- Table fidelity: the share of extracted tables whose cells match a human copy. Misaligned columns are the typical fault.
- Answer faithfulness: the share of answer claims supported by the cited item, checked against the original image, table or segment, not the surrogate.
def recall_by_modality(cases, k=5):
# cases: dicts with 'modality' of the gold item, 'gold_id', and 'results' (ranked ids)
totals, hits = {}, {}
for c in cases:
m = c['modality']
totals[m] = totals.get(m, 0) + 1
if c['gold_id'] in c['results'][:k]:
hits[m] = hits.get(m, 0) + 1
return {m: hits.get(m, 0) / n for m, n in totals.items()}When to use it, and when not to
| Situation | Use this type? | Why |
|---|---|---|
| Manuals with diagrams, screenshots or wiring layouts | Yes | The answer is often in the picture, not in nearby text. |
| Reports where key numbers sit in charts and tables | Yes | Text extraction loses the structure that gives numbers their meaning. |
| Recorded meetings, calls or training sessions | Yes | Timestamped transcripts make spoken knowledge searchable and citeable. |
| Mostly prose documents with a few decorative images | No | Text RAG is enough, and media processing adds cost without benefit. |
| Strict data residency or privacy limits on media | Only with care | Captioning and transcription may send media to external services, so check where processing happens. |
| Product catalogues with photos and specifications | Yes | Image similarity and structured attributes together answer 'show me something like this'. |
Trade-offs
| Dimension | Effect | What to do about it |
|---|---|---|
| Quality | Can answer questions that text-only RAG cannot, but quality varies by modality | Measure each modality separately and fix the weakest first. |
| Latency | Reading images and long segments adds tokens and time to the answer step | Limit items per request and precompute everything possible at ingestion. |
| Cost | Captioning, transcription, embedding and storage of media are all heavier than text | Cache by file hash, skip decorative media and process once. |
| Complexity | More parsers, models and index fields to maintain | Start with the one modality that matters most, then add others. |
| Failure modes | Silent extraction errors, unreadable scans, misaligned tables, mixed embedding versions | Report empty or low-confidence extractions and record model versions. |
Compared with related types
Simple RAG is the right baseline for text. Multimodal RAG keeps the same retrieve-then-read flow and widens what can be retrieved, so you can add it to a working simple pipeline one modality at a time. Advanced RAG techniques such as hybrid search and reranking apply here too, and reranking across modalities is where they matter most.
GraphRAG adds structure through entities and relationships, while multimodal RAG adds new kinds of content. They combine well: an image can be a node in a graph, linked to the product it shows. Modular RAG gives a way to organise the parsers, embedders and readers as separate parts.
What this means for your role
Common mistakes
Further reading
- Multimodal and real-time AI, for the models that read images, audio and video.
- Vector search and chunking, for the text retrieval basics this type extends.
Multimodal RAG widens what a retrieval system can see. It pays off where knowledge lives in pictures, tables and recordings, and it stays reliable only when extraction quality is measured for each kind of media.