Most RAG systems start with a simple assumption: documents contain text, text can be divided into chunks, and those chunks can be converted into embeddings for semantic search.
That approach works well for articles, documentation, and text-based knowledge bases. But enterprise information rarely exists as plain text.
A financial report may contain important figures inside tables. An engineering manual may explain a process through diagrams. An old contract may be a scanned PDF with no selectable text. A research paper may combine paragraphs, mathematical expressions, charts, and annotated images.
A text-only RAG pipeline can miss much of this information.
Multimodal Retrieval-Augmented Generation (RAG) extends retrieval beyond ordinary text. It enables a system to find and use information across text, images, scanned documents, charts, tables, and other visual elements.
Building it reliably requires more than choosing a multimodal embedding model. Document parsing, OCR, content representation, retrieval, and source tracking all matter.
1. Why Traditional RAG Struggles with PDFs and Images
A conventional RAG pipeline usually looks like this:
- Extract text from documents.
- Split the text into smaller chunks.
- Generate embeddings for each chunk.
- Store the embeddings in a vector database.
- Retrieve relevant chunks when a user asks a question.
- Pass those chunks to an LLM to generate an answer.
The problem appears when important information is not represented in the extracted text.
Consider a PDF containing a table:
| GPU Model | Memory | Bandwidth |
|---|---|---|
| Model A | 80 GB | 2 TB/s |
| Model B | 96 GB | 3 TB/s |
| Model C | 64 GB | 1.5 TB/s |
A basic parser might extract the individual values without preserving their row and column relationships. The resulting text could contain numbers without enough context to determine which model each value belongs to.
The same problem affects charts and diagrams. Extracting the paragraph near an image does not necessarily capture what the image communicates.
Multimodal RAG addresses this by recognizing different content types and processing each one appropriately.
2. Document Parsing: Understand the PDF Before Chunking It
Document parsing is the foundation of a multimodal RAG pipeline.
Instead of treating a PDF as one large text file, a document parser identifies its individual elements, such as:
- Headings and paragraphs
- Tables and individual cells
- Images, charts, and diagrams
- Page numbers and document metadata
- Headers, footers, and reading order
This is called layout-aware document parsing.
For example, consider a technical PDF with a section titled Memory Architecture, followed by a paragraph, a diagram, and a table.
A layout-aware parser can preserve the relationship between the section heading and its contents. That relationship matters because a retrieved table should not lose the context that explains what its values represent.
Modern document-processing systems can also attach descriptions to visual elements and organize the extracted content into structured chunks. Google's Document AI layout parser, for example, identifies document elements and uses their structural relationships to create context-aware chunks.
The important principle is simple: preserve document structure before converting content into embeddings.
Without that step, even a powerful retrieval model may receive incomplete or misleading information.
3. OCR: Making Scanned PDFs Searchable
Not every PDF contains extractable text.
Some PDFs are created from digital documents, where text is stored directly in the file. Others are scanned pages, essentially photographs of printed documents.
A normal text extractor may return nothing useful from a scanned page.
This is where Optical Character Recognition (OCR) becomes important.
OCR detects text inside an image and converts it into machine-readable content.
A typical workflow looks like this:
- Render the scanned PDF page as an image.
- Detect text regions.
- Recognize the characters and words.
- Preserve their positions and page information.
- Store the extracted text as searchable content.
For example, an old invoice might contain a handwritten or printed customer name, invoice number, date, and total amount. OCR makes recognized text available to downstream retrieval.
However, OCR has limitations. It can struggle with low-resolution scans, rotated pages, unusual fonts, handwriting, overlapping text, and complex layouts.
It is also important to understand that OCR is not the same as visual understanding. OCR can identify text inside a diagram, but it does not necessarily understand how the diagram's components connect.
A practical ingestion system should therefore use native text extraction when a PDF already has a reliable text layer and apply OCR where text is embedded in scanned images. Layout analysis can then preserve the relationships between the extracted elements.
4. Multimodal Embeddings: Representing More Than Text
In traditional RAG, an embedding model converts a text chunk into a numerical vector.
A vector database stores these representations and retrieves similar vectors when a user submits a query.
Multimodal embeddings extend this concept to multiple content types.
Depending on the model, an embedding can represent:
- Text passages
- Images and diagrams
- Document pages
- Tables and charts
- Text-and-image combinations
The key capability is that a multimodal model can learn relationships between different modalities.
For example, suppose a document contains an image of a network architecture diagram. A user asks:
Which component connects the application service to the database?
A compatible text-image embedding model may retrieve the diagram using the text query, even when the exact words in the question do not appear in the image.
This is possible because the model learns to represent related textual and visual information in compatible vector spaces.
However, not every embedding model supports this behavior. A standard text embedding model cannot automatically perform image retrieval. Similarly, vectors generated by unrelated embedding models should not be compared as though they belong to the same space.
Three ways to build multimodal retrieval
There is no single architecture that fits every application.
Approach 1: Shared multimodal embedding space
A multimodal embedding model encodes supported content types into compatible vector representations.
A text query can then retrieve related images, while an image query can retrieve related text or other visual content.
This is useful when users need cross-modal search, such as finding diagrams using natural-language questions.
Approach 2: Convert visual content into text
Instead of directly embedding images, the ingestion pipeline extracts OCR text, captions, image descriptions, and structured representations of tables or charts.
These textual representations are then indexed using a conventional text embedding model.
This approach is often easier to integrate into an existing text-based RAG system. Its quality, however, depends heavily on how accurately the visual information is extracted and described.
Approach 3: Separate indexes for different modalities
Store text, images, and structured table content in separate indexes.
At query time, retrieve candidates from the relevant indexes and combine their results. A reranker can then compare the candidates and prioritize the most useful evidence.
This gives developers more control over specialized retrieval but adds complexity to indexing and query orchestration.
These approaches can also be combined. For example, a system might use text embeddings for paragraphs, visual embeddings for diagrams, and a structured database for numerical tables.
5. How to Retrieve Images, Charts, and Diagrams
Images require more careful processing than simply storing an image URL in a database.
During ingestion, an image can be represented through several complementary signals:
- The original image or a cropped region
- OCR-extracted text, where applicable
- A caption or nearby document description
- A visual description generated by a vision-language model (VLM)
- An image embedding
These representations serve different purposes.
An image embedding can help locate visually or semantically related images. OCR helps find text visible inside an image. A caption or VLM-generated description can make the image easier to discover through natural-language search.
For example, a technical manual may contain a diagram showing a load balancer distributing traffic across three application servers.
A visual description could record that the image contains a load balancer, three application servers, and their connection paths.
A query such as Show me the architecture diagram for traffic distribution can then retrieve the relevant image.
But generated descriptions should not become unquestioned facts. They are useful retrieval metadata, not a replacement for the original visual evidence.
For charts, the requirements are stricter. A description such as GPU performance comparison may help find a chart, but it cannot answer which GPU has the highest throughput.
When numerical accuracy matters, the pipeline should extract the chart's underlying values or use a visual model to interpret the chart and verify the result against the source.
6. Tables Need Structure, Not Just Embeddings
Tables are particularly challenging because their meaning depends on the relationships between rows, columns, headers, and values.
Converting a table into unstructured text can destroy these relationships.
A better strategy is to preserve the table as structured data and create a searchable textual representation alongside it.
For example:
Table title: GPU Memory Comparison
Structured representation:
| GPU Model | Memory | Bandwidth |
|---|---|---|
| Model A | 80 GB | 2 TB/s |
| Model B | 96 GB | 3 TB/s |
Searchable representation:
- Model A has 80 GB of memory and 2 TB/s memory bandwidth.
- Model B has 96 GB of memory and 3 TB/s memory bandwidth.
The structured version supports exact comparisons and calculations. The textual version supports semantic retrieval.
For larger tables, divide the content into logical row groups while preserving the original column headers in every group. Store the table title, page number, units, and relevant section heading as metadata.
For example, a question asking Which GPU has the highest memory bandwidth? requires comparing numerical values, not just finding a semantically similar paragraph.
For complex calculations, use a structured query or table-processing layer rather than expecting vector similarity search to perform arithmetic reliably.
7. Putting the Multimodal RAG Pipeline Together
A production-oriented pipeline can be organized into two stages.
Ingestion
- Document loading: Accept PDFs, images, and other supported file formats.
- Layout parsing: Detect text blocks, headings, tables, figures, and reading order.
- Content extraction: Extract native text, apply OCR to scanned content, and preserve table structures.
- Visual processing: Generate image crops, captions, or visual descriptions when useful.
- Chunking: Create separate, context-preserving representations for paragraphs, tables, and visual elements.
- Embedding and indexing: Generate compatible embeddings and store the content with its metadata.
Retrieval and generation
- Query understanding: Identify whether the question requires textual, visual, tabular, or combined evidence.
- Candidate retrieval: Search the relevant indexes using semantic, keyword, or structured retrieval.
- Result fusion: Combine candidates retrieved from different sources.
- Reranking: Re-evaluate the most promising results against the original question.
- Context construction: Supply the relevant text, table data, and image references to the generation model.
- Answer generation: Generate an answer grounded in the retrieved evidence, with references to the original document and page.
A vision-language model can be especially useful when the answer depends on interpreting a retrieved diagram, chart, or other visual element.
The distinction between retrieval and reasoning matters: finding the correct image is one task; understanding what it communicates is another.
8. Metadata and Source Tracking Matter
Every extracted element should retain enough information to locate its original source.
A practical record might look like this:
{
"document_id": "manual-042",
"element_id": "figure-12-03",
"content_type": "image",
"page_number": 12,
"section": "Network Architecture",
"caption": "Application traffic flow",
"image_uri": "storage/manual-042/page-12/figure-03.png",
"access_group": ["engineering"]
}
For a table or text chunk, the same record can include a table identifier, row range, text content, or page coordinates.
This metadata serves several purposes:
- Answers can cite the correct PDF and page.
- Users can inspect the original image or table.
- Results can respect document-level access permissions.
- Updated documents can be re-indexed without losing their relationships.
- Developers can investigate retrieval failures.
Source tracking should be part of ingestion, not something added after generation.
9. Common Mistakes When Building Multimodal RAG
Several implementation decisions can reduce retrieval quality:
- Flattening entire PDFs into plain text: This loses headings, layout, and relationships between elements.
- Applying OCR to everything: Digital PDFs may already contain accurate text, so unnecessary OCR adds cost and can introduce recognition errors.
- Embedding huge tables as one chunk: This makes it harder to retrieve specific rows or values.
- Trusting generated image captions blindly: A VLM can misinterpret diagrams, labels, or chart values.
- Discarding page references: Relevant evidence becomes difficult to verify or display.
- Using incompatible embedding spaces: Text and image vectors from unrelated models cannot automatically support cross-modal similarity.
- Testing only text retrieval: A system may perform well on paragraphs but fail on scanned pages, charts, and tables.
Evaluation should test each content type separately. Measure whether the correct page, image, or table is retrieved, whether its relevant details are preserved, and whether the final answer is supported by the original source.
Conclusion
Multimodal RAG makes enterprise knowledge more accessible by allowing retrieval systems to work with the information hidden inside PDFs, images, tables, charts, and diagrams.
But better embeddings alone do not solve the problem.
Reliable systems need layout-aware parsing, selective OCR, structure-preserving table extraction, appropriate visual representations, compatible embeddings, and traceable source metadata.
The best architecture is not necessarily the one that sends every document through the most advanced vision model. It is the one that understands what kind of information each document contains and chooses the right way to extract, index, retrieve, and verify it.



