Skip to content

05. Multimodal RAG

Category: Advanced RAG Architecture
Module: Part V โ€” Advanced Retrieval-Augmented Generation
Difficulty: Advanced


๐Ÿ“– Overview

Traditional Retrieval-Augmented Generation (RAG) systems are primarily designed around text:

Documents
   โ†“
Text Extraction
   โ†“
Chunking
   โ†“
Embeddings
   โ†“
Vector Retrieval
   โ†“
LLM

Enterprise knowledge, however, is rarely text-only.

Important information can exist in:

Text
Images
Tables
Charts
Diagrams
Screenshots
Scanned Documents
Audio
Video
Presentations
Technical Drawings
Forms
Invoices
Contracts

A Multimodal RAG system extends RAG so that retrieval and generation can work across multiple information modalities.

Instead of treating every document as plain text, Multimodal RAG preserves and retrieves the different forms of evidence contained in enterprise knowledge.

The architecture therefore becomes:

                    Enterprise Knowledge
                            โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ–ผ            โ–ผ       โ–ผ        โ–ผ           โ–ผ
      Text        Images   Tables   Audio       Video
       โ”‚            โ”‚       โ”‚        โ”‚           โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ–ผ
                    Multimodal Retrieval
                            โ”‚
                            โ–ผ
                     Context Assembly
                            โ”‚
                            โ–ผ
                   Multimodal Foundation Model
                            โ”‚
                            โ–ผ
                    Enterprise Response

The goal is not simply to "put images into a prompt."

The goal is to build a production-grade retrieval architecture that understands, indexes, retrieves, grounds, validates, and cites multimodal enterprise knowledge.


๐ŸŽฏ Learning Objectives

After completing this chapter, you will be able to:

  • Understand Multimodal RAG
  • Understand why text-only RAG is insufficient for many enterprise workloads
  • Understand multimodal documents
  • Understand multimodal ingestion pipelines
  • Extract text, images, tables, and layout information
  • Understand OCR in Multimodal RAG
  • Understand image embeddings
  • Understand multimodal embeddings
  • Understand cross-modal retrieval
  • Understand image-to-text retrieval
  • Understand text-to-image retrieval
  • Understand image-to-image retrieval
  • Understand multimodal chunking
  • Understand document layout preservation
  • Understand table-aware retrieval
  • Understand chart and diagram retrieval
  • Understand visual document retrieval
  • Design multimodal vector stores
  • Combine text and image retrieval
  • Build multimodal context
  • Use multimodal foundation models
  • Handle scanned documents
  • Handle PDFs containing images and tables
  • Build multimodal enterprise RAG pipelines
  • Combine Multimodal RAG with Graph RAG and SQL RAG
  • Design multimodal citation and provenance
  • Secure multimodal data
  • Evaluate multimodal retrieval and generation
  • Optimize multimodal RAG latency and cost
  • Design production Multimodal RAG systems

๐Ÿง  1. What Is Multimodal RAG?

Multimodal RAG is a RAG architecture that retrieves and uses information from multiple modalities.

For example:

Text
Images
Tables
Charts
Diagrams
Audio
Video

A user may ask:

"According to the architecture diagram,
which service communicates with the payment gateway?"

A text-only RAG system may fail if the relationship exists only inside the diagram.

A Multimodal RAG system can retrieve:

Architecture Diagram
+
Related Documentation

and provide both to the model.


๐Ÿ”Ž 2. Traditional RAG vs Multimodal RAG

Traditional Text RAG

Document
   โ†“
Text Extraction
   โ†“
Chunking
   โ†“
Text Embedding
   โ†“
Vector Search
   โ†“
Text Context
   โ†“
LLM

Multimodal RAG

Document
   โ†“
Multimodal Parsing
   โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ–ผ             โ–ผ             โ–ผ
Text         Images       Tables
โ”‚             โ”‚             โ”‚
โ–ผ             โ–ผ             โ–ผ
Embeddings   Embeddings   Structured Index
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
              โ”‚
              โ–ผ
       Multimodal Retrieval
              โ”‚
              โ–ผ
       Multimodal Context
              โ”‚
              โ–ผ
       Multimodal Model

๐Ÿงฉ 3. What Makes Enterprise Data Multimodal?

Consider a technical architecture document.

It may contain:

Title
Paragraphs
Architecture Diagram
Tables
Code Snippets
Screenshots
Sequence Diagram
Deployment Diagram

A text extractor may capture:

Title
Paragraphs
Table Text
Code

but completely miss the meaning of:

Architecture Diagram
Sequence Diagram
Deployment Diagram

Multimodal RAG attempts to preserve these relationships.


๐Ÿ“š 4. Common Enterprise Multimodal Sources

Typical sources include:

PDF
PowerPoint
Word Documents
Scanned Documents
Images
Architecture Diagrams
Technical Drawings
Invoices
Receipts
Contracts
Forms
Dashboards
Screenshots
Product Catalogs
Medical Images
Satellite Images
Video Recordings
Audio Recordings

๐Ÿง  5. Multimodal RAG Mental Model

A useful mental model is:

                    USER QUERY
                         โ”‚
                         โ–ผ
                 QUERY UNDERSTANDING
                         โ”‚
                         โ–ผ
                 MODALITY ANALYSIS
                         โ”‚
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ–ผ           โ–ผ           โ–ผ
           TEXT        IMAGE       TABLE
             โ”‚           โ”‚           โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ–ผ
                MULTIMODAL RETRIEVAL
                         โ”‚
                         โ–ผ
                 EVIDENCE FUSION
                         โ”‚
                         โ–ผ
                CONTEXT ENGINEERING
                         โ”‚
                         โ–ผ
                MULTIMODAL MODEL
                         โ”‚
                         โ–ผ
                 VALIDATED RESPONSE

๐Ÿงฉ 6. Multimodal Data Model

A multimodal document should not necessarily be represented as one large blob.

Instead:

Document
โ”‚
โ”œโ”€โ”€ Text Blocks
โ”œโ”€โ”€ Images
โ”œโ”€โ”€ Tables
โ”œโ”€โ”€ Charts
โ”œโ”€โ”€ Diagrams
โ”œโ”€โ”€ Metadata
โ””โ”€โ”€ Layout

Each component can have its own representation.


๐Ÿ—๏ธ 7. Multimodal Document Representation

Example:

{
  "document_id": "architecture-001",
  "page": 12,
  "elements": [
    {
      "type": "text",
      "content": "Payment architecture"
    },
    {
      "type": "image",
      "asset_id": "img-128"
    },
    {
      "type": "table",
      "asset_id": "table-22"
    }
  ]
}

This preserves the document structure.


๐Ÿ“ 8. Layout Matters

Consider:

             Architecture Diagram

Service A โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Service B
    โ”‚                   โ”‚
    โ–ผ                   โ–ผ
Database A          Database B

The text alone:

Service A
Service B
Database A
Database B

does not preserve the relationships represented spatially.

Layout-aware processing is therefore important for many enterprise documents.


๐Ÿง  9. Document Layout

A document parser may identify:

Title
Paragraph
Heading
Table
Figure
Caption
Footer
Header
Page Number
Code Block

The ingestion system can preserve:

Bounding Box
Page Number
Element Type
Reading Order
Parent Section

๐Ÿ—๏ธ 10. Multimodal Ingestion Pipeline

flowchart TD
    A["Enterprise Document"] --> B["Document Parser"]

    B --> C["Layout Analysis"]

    C --> D["Text Extraction"]
    C --> E["Image Extraction"]
    C --> F["Table Extraction"]
    C --> G["Chart / Diagram Extraction"]

    D --> H["Text Processing"]
    E --> I["Visual Processing"]
    F --> J["Table Processing"]
    G --> K["Visual Processing"]

    H --> L["Multimodal Index"]
    I --> L
    J --> L
    K --> L

๐Ÿ” 11. OCR

OCR stands for:

Optical Character Recognition

OCR converts text contained in images into machine-readable text.

Example:

Scanned Invoice
      โ†“
      OCR
      โ†“
Invoice Number: INV-1028
Amount: โ‚น42,000
Customer: Acme

OCR is particularly important for:

Scanned PDFs
Invoices
Forms
Receipts
Historical Documents
Screenshots

๐Ÿง  12. OCR Is Not Document Understanding

OCR provides:

Text

but does not necessarily understand:

Layout
Relationships
Tables
Meaning
Visual Context

For example:

Customer: Acme

Amount: โ‚น42,000

may be extracted correctly, but the system may still need layout information to determine which value belongs to which field in a complex form.


๐Ÿงฉ 13. OCR + Layout Understanding

A stronger pipeline is:

Image
 โ†“
OCR
 โ†“
Bounding Boxes
 โ†“
Layout Analysis
 โ†“
Semantic Structure

Example:

{
  "text": "โ‚น42,000",
  "bbox": [320, 480, 430, 520],
  "type": "amount",
  "page": 2
}

๐Ÿ–ผ๏ธ 14. Image Embeddings

Images can be represented as vectors.

Conceptually:

Image
 โ†“
Vision Encoder
 โ†“
Embedding Vector

Example:

Architecture Diagram
       โ†“
[0.12, -0.31, 0.84, ...]

This allows image similarity search.


๐Ÿ”— 15. Multimodal Embeddings

A multimodal embedding model can map different modalities into a compatible semantic space.

Conceptually:

Text โ”€โ”€โ”€โ”€โ”€โ”€โ–บ Embedding Space
Image โ”€โ”€โ”€โ”€โ”€โ–บ Embedding Space

Then:

"Payment architecture"

can potentially retrieve:

Architecture Diagram

even though the query and retrieved object have different modalities.


๐Ÿง  16. Cross-Modal Retrieval

Cross-modal retrieval means the query and result can use different modalities.

Examples:

Text โ†’ Image
Text โ†’ Table
Text โ†’ Diagram
Image โ†’ Text
Image โ†’ Image

Example:

Query:
"Payment gateway architecture"

        โ†“

Retrieved:
architecture-diagram.png

๐Ÿ”Ž 17. Text-to-Image Retrieval

Text Query
   โ†“
Text Embedding
   โ†“
Multimodal Vector Search
   โ†“
Image Embedding
   โ†“
Architecture Diagram

This is useful for:

Architecture Search
Product Image Search
Technical Drawing Search
Visual Knowledge Bases

๐Ÿ–ผ๏ธ 18. Image-to-Text Retrieval

Example:

User uploads:
Architecture Diagram

        โ†“

Visual Embedding

        โ†“

Retrieve:
Architecture Documentation
Runbook
API Documentation

This allows visual information to become a retrieval signal.


๐Ÿ–ผ๏ธ 19. Image-to-Image Retrieval

Example:

Uploaded:
Product Image

       โ†“

Image Embedding

       โ†“

Similar Product Images

This can support:

Visual Product Search
Duplicate Detection
Document Similarity
Visual Knowledge Bases

๐Ÿ“Š 20. Table Retrieval

Tables require special treatment.

Consider:

| Product | Revenue | Growth |
|---------|---------|--------|
| A       | 10M     | 12%    |
| B       | 8M      | 17%    |

Naively embedding the table as plain text may lose:

Column Relationships
Row Structure
Numeric Semantics

A better architecture can preserve both:

Table Structure
+
Natural Language Representation

๐Ÿงฉ 21. Table-Aware Representation

Example:

{
  "type": "table",
  "columns": [
    "Product",
    "Revenue",
    "Growth"
  ],
  "rows": [
    ["A", "10M", "12%"],
    ["B", "8M", "17%"]
  ]
}

The system can additionally generate a textual representation for semantic retrieval.


๐Ÿ“ˆ 22. Charts

Charts contain information that may not exist directly as text.

Example:

Sales Trend
   โ”‚
   โ”‚       โ•ญโ”€โ”€โ”€โ•ฎ
   โ”‚    โ•ญโ”€โ”€โ•ฏ   โ”‚
   โ”‚ โ•ญโ”€โ”€โ•ฏ      โ•ฐโ”€โ”€โ”€
   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
       Jan Feb Mar

Text extraction might only capture:

Sales Trend
Jan
Feb
Mar

The actual trend must be understood visually or reconstructed from structured chart data.


๐Ÿง  23. Chart Understanding

A multimodal pipeline may extract:

Chart Type
Title
Axes
Legend
Labels
Data Points
Trend
Annotations

The representation could be:

{
  "chart_type": "line",
  "title": "Monthly Sales",
  "x_axis": ["Jan", "Feb", "Mar"],
  "trend": "increasing"
}

๐Ÿ–ผ๏ธ 24. Diagram Understanding

Enterprise diagrams may represent:

Architecture
Data Flow
Network
Sequence
State
Deployment
Business Process

A multimodal model can analyze:

Nodes
Edges
Labels
Spatial Relationships
Visual Grouping

๐Ÿ—๏ธ 25. Architecture Diagram Example

        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚   Client    โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
               โ–ผ
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚ API Gateway โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ–ผ               โ–ผ
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚ Payment  โ”‚    โ”‚  Auth    โ”‚
 โ”‚ Service  โ”‚    โ”‚ Service  โ”‚
 โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
      โ”‚
      โ–ผ
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚PostgreSQLโ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The graph of relationships may be:

Client
  โ†“
API Gateway
  โ†“
Payment Service
  โ†“
PostgreSQL

API Gateway
  โ†“
Auth Service

A multimodal system can retrieve the diagram and derive these relationships.


๐Ÿ”— 26. Multimodal RAG and Knowledge Graphs

Visual relationships can be transformed into graph knowledge.

Architecture Diagram
        โ†“
Vision Understanding
        โ†“
Entity Extraction
        โ†“
Relationship Extraction
        โ†“
Knowledge Graph

Example:

Payment Service
    DEPENDS_ON
PostgreSQL

This connects Multimodal RAG with Knowledge Graph RAG.


๐Ÿง  27. Multimodal RAG and SQL

Tables and charts may contain structured information.

For example:

Financial Report
     โ†“
Table
     โ†“
Revenue by Region

A production system may transform the information into:

Structured Data

and store it in SQL.

Then:

Multimodal Source
       โ†“
Table Extraction
       โ†“
SQL

can enable exact analytical queries.


๐Ÿ”€ 28. Multimodal + SQL + Graph + Vector

A mature enterprise system may combine:

                    Enterprise Query
                           โ”‚
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ–ผ             โ–ผ             โ–ผ
          Vector          SQL          Graph
             โ”‚             โ”‚             โ”‚
             โ–ผ             โ–ผ             โ–ผ
           Text          Tables     Relationships
             โ”‚             โ”‚             โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
                       Multimodal
                       Evidence
                           โ”‚
                           โ–ผ
                          LLM

This creates a broader enterprise knowledge fabric.


๐Ÿงฉ 29. Multimodal Chunking

Traditional chunking:

Document
 โ†“
Text Chunks

Multimodal chunking may preserve:

Text Chunk
+
Related Image
+
Related Table
+
Caption
+
Page
+
Section

Example:

{
  "chunk_id": "chunk-102",
  "text": "Payment architecture...",
  "images": [
    "architecture-12.png"
  ],
  "tables": [
    "dependency-table-12"
  ],
  "page": 12,
  "section": "Payment Architecture"
}

๐Ÿง  30. Parent-Child Multimodal Retrieval

A child chunk may represent:

Paragraph

while the parent context contains:

Section
+
Diagram
+
Table

Retrieval can find the child and return the parent multimodal context.

Query
 โ†“
Child Retrieval
 โ†“
Parent Document Context
 โ†“
Text + Image + Table
 โ†“
LLM

๐Ÿ”Ž 31. Caption-Based Image Retrieval

Images can be enriched with generated captions.

Example:

Image:
architecture.png

Caption:

"Microservices architecture showing an API Gateway
connected to Payment and Authentication services."

Then:

Caption
 โ†“
Text Embedding
 โ†“
Vector Store

can support image retrieval.


๐Ÿง  32. Image Metadata

Useful image metadata includes:

Document ID
Page
Section
Image Type
Caption
Bounding Box
Creation Date
Source
Access Policy
Related Text
Related Entities

๐Ÿงฉ 33. Multimodal Index

A production index may contain:

Text Index
Image Index
Table Index
Metadata Index

or a unified multimodal vector index.

Conceptually:

                  Multimodal Index
                         โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                โ–ผ                โ–ผ
     Text Vectors    Image Vectors    Metadata
        โ”‚                โ”‚                โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ–ผ
                   Retrieval Layer

๐Ÿ—๏ธ 34. Unified vs Separate Indexes

Unified Index

Text
Image
Table
   โ†“
Shared Embedding Space

Advantages:

Cross-Modal Search
Simpler Retrieval Model

Separate Indexes

Text Index
Image Index
Table Index

Advantages:

Modality-Specific Optimization
Independent Scaling
Specialized Retrieval

A hybrid approach is often useful.


๐Ÿ”€ 35. Hybrid Multimodal Retrieval

flowchart TD
    A["User Query"] --> B["Query Analysis"]

    B --> C["Text Retrieval"]
    B --> D["Image Retrieval"]
    B --> E["Table Retrieval"]

    C --> F["Text Candidates"]
    D --> G["Image Candidates"]
    E --> H["Table Candidates"]

    F --> I["Candidate Fusion"]
    G --> I
    H --> I

    I --> J["Cross-Modal Re-ranking"]

    J --> K["Multimodal Context"]

๐Ÿง  36. Modality-Aware Query Routing

Not every query needs every modality.

Example:

"What does the refund policy say?"
        โ†“
Text

"Show the architecture diagram for payments."
        โ†“
Image

"What was revenue in Q2?"
        โ†“
SQL / Table

"Which service connects to the payment gateway?"
        โ†“
Graph + Image + Text

The query planner should determine which modalities are relevant.


๐Ÿ”Ž 37. Modality Router

class ModalityRouter:

    def route(self, query):
        """
        Return required retrieval modalities.
        """
        raise NotImplementedError

Possible result:

[
    "text",
    "image",
    "table"
]

๐Ÿ—๏ธ 38. Multimodal Retriever Interface

A capability-oriented architecture can expose:

class MultimodalRetriever:

    def retrieve(
        self,
        query,
        modalities=None,
        filters=None,
        top_k=10
    ):
        raise NotImplementedError

This keeps the application independent of a specific retrieval implementation.


๐Ÿ›๏ธ 39. Ports & Adapters Architecture

flowchart LR
    A["RAG Application"] --> B["Multimodal Retrieval Port"]

    B --> C["Text Adapter"]
    B --> D["Image Adapter"]
    B --> E["Table Adapter"]

    C --> F["Text Index"]
    D --> G["Image Index"]
    E --> H["Structured Store"]

The application layer should depend on capabilities rather than infrastructure SDKs.


๐Ÿง  40. Multimodal Foundation Models

A multimodal model can process multiple input types.

Conceptually:

Text
Image
Audio
Video
   โ”‚
   โ–ผ
Multimodal Model
   โ”‚
   โ–ผ
Reasoning / Generation

For RAG, retrieved evidence may therefore include:

Text Chunks
+
Images
+
Tables

in a single model request.


๐Ÿ”— 41. Multimodal Context

Instead of:

CONTEXT:
Text only

a prompt may contain:

TEXT:
Payment service documentation...

IMAGE:
Architecture diagram...

TABLE:
Service dependencies...

The model can reason over the combined evidence.


๐Ÿง  42. Context Ordering

Context ordering matters.

A possible structure:

SYSTEM INSTRUCTIONS

USER QUESTION

RELEVANT TEXT

RELEVANT TABLES

RELEVANT IMAGES

SOURCE METADATA

RESPONSE REQUIREMENTS

The exact structure depends on the model and workload.


๐Ÿงฉ 43. Visual Context Selection

Do not blindly pass every retrieved image.

Use:

Relevance
+
Resolution
+
Page Relationship
+
Entity Relationship
+
Source Quality

Example:

10 retrieved images
       โ†“
Visual Re-ranking
       โ†“
Top 2 relevant diagrams
       โ†“
LLM

๐Ÿ” 44. Image Re-ranking

Candidate images can be ranked using:

Text-Image Similarity
+
Metadata
+
Entity Match
+
Section Match
+
Recency

Example:

Image A โ†’ 0.94
Image B โ†’ 0.82
Image C โ†’ 0.63

Only the strongest candidates need to reach the generation stage.


๐Ÿง  45. Multimodal Evidence Fusion

Different modalities can provide different evidence.

Example:

Text:
"Payment Service uses PostgreSQL."

Image:
Architecture diagram showing
Payment Service โ†’ PostgreSQL.

Graph:
PaymentService --USES--> PostgreSQL.

The system can combine:

Text Evidence
+
Visual Evidence
+
Graph Evidence

to improve grounding.


๐Ÿ›ก๏ธ 46. Evidence Agreement

A production system can detect whether different evidence sources agree.

Text:
Payment Service โ†’ PostgreSQL

Image:
Payment Service โ†’ PostgreSQL

Graph:
Payment Service โ†’ PostgreSQL

Agreement:

High Confidence

But:

Text:
Payment Service โ†’ MySQL

Image:
Payment Service โ†’ PostgreSQL

requires additional validation.


โš ๏ธ 47. Conflicting Multimodal Evidence

Enterprise documents may contain contradictory information.

Example:

Old Architecture Diagram
        โ†“
MySQL

New Architecture Document
        โ†“
PostgreSQL

A production system should consider:

Source Authority
+
Document Version
+
Timestamp
+
Validity

rather than simply combining both.


๐Ÿ•’ 48. Multimodal Freshness

Visual documents can become stale.

Example:

Architecture Diagram
Version 1

may no longer represent:

Current Architecture

Metadata should include:

Version
Created At
Updated At
Effective Date
Status

๐Ÿ“š 49. Document Versioning

A useful model:

Architecture Document
      โ”‚
      โ”œโ”€โ”€ v1
      โ”œโ”€โ”€ v2
      โ””โ”€โ”€ v3

Retrieval should normally prefer:

Current Approved Version

unless the user explicitly requests historical information.


๐Ÿง  50. Multimodal Provenance

Every visual evidence item should retain:

Document ID
Page
Element ID
Bounding Box
Source URI / Reference
Version
Timestamp
Extraction Method

Example:

{
  "asset_id": "image-928",
  "document_id": "architecture-v4",
  "page": 12,
  "section": "Payment Architecture",
  "bbox": [120, 240, 980, 740],
  "version": "4.0"
}

๐Ÿ”— 51. Multimodal Citations

Text citations:

Document โ†’ Page โ†’ Section

Image citations:

Document โ†’ Page โ†’ Figure

Table citations:

Document โ†’ Page โ†’ Table

The final response should preserve the connection between the generated claim and its evidence.


๐Ÿงพ 52. Citation Example

Response:

The Payment Service communicates with the
Authentication Service through the API Gateway.

Evidence:

Architecture Document
Page 12
Figure 3

This is stronger than simply citing:

architecture.pdf

๐Ÿง  53. Multimodal RAG Grounding

Grounding means that generated claims should be supported by retrieved evidence.

For example:

Claim:
Payment Service uses PostgreSQL.

Evidence:
Architecture Diagram
+
Architecture Documentation

The generation layer should avoid adding unsupported details.


๐Ÿšจ 54. Multimodal Hallucination

Multimodal models can hallucinate:

Objects
Relationships
Numbers
Text
Chart Trends
Labels

For example:

Image:
No database shown

Model:
"The diagram shows PostgreSQL."

This is a visual hallucination.


๐Ÿ›ก๏ธ 55. Multimodal Response Validation

Validation can compare generated claims against:

Retrieved Text
Retrieved Tables
Retrieved Images
Retrieved Graph Facts

Conceptually:

Response
 โ†“
Claim Extraction
 โ†“
Evidence Matching
 โ†“
Unsupported Claim Detection
 โ†“
Correction / Rejection

๐Ÿง  56. Table Grounding

If a model answers:

"Revenue was โ‚น12.4 million."

the system should be able to identify:

Table
Row
Column
Value

as evidence.


๐Ÿ“ˆ 57. Chart Grounding

If a model says:

"Revenue increased continuously during Q1."

the evidence should point to:

Chart
+
Relevant Series
+
Time Range

rather than only the surrounding text.


๐Ÿงฉ 58. Multimodal Response Contract

A structured internal response can contain:

{
  "answer": "...",
  "claims": [
    {
      "text": "Payment Service uses PostgreSQL.",
      "evidence": [
        {
          "type": "image",
          "asset_id": "architecture-12"
        },
        {
          "type": "text",
          "chunk_id": "chunk-812"
        }
      ]
    }
  ]
}

This supports downstream validation and citation.


๐Ÿ” 59. Multimodal Security

Images and documents may contain sensitive information.

Examples:

Screenshots
Credentials
Customer Data
Internal Architecture
Financial Information
Personal Information
Security Diagrams

Security controls should apply to:

Original Assets
Extracted Text
Embeddings
Metadata
Retrieved Context
Model Inputs
Generated Outputs

๐Ÿ›ก๏ธ 60. Image-Level Authorization

A user may be allowed to access:

Architecture Overview

but not:

Security Architecture Diagram

Therefore authorization should be evaluated at the asset level.


๐Ÿ‘ฅ 61. Multi-Tenant Multimodal RAG

Tenant boundaries should be preserved across:

Documents
Images
Tables
Embeddings
Metadata
Graph Entities
SQL Data

Example:

Tenant A
 โ”œโ”€โ”€ Text
 โ”œโ”€โ”€ Images
 โ”œโ”€โ”€ Tables
 โ””โ”€โ”€ Graph Data

Tenant B
 โ”œโ”€โ”€ Text
 โ”œโ”€โ”€ Images
 โ”œโ”€โ”€ Tables
 โ””โ”€โ”€ Graph Data

Cross-tenant retrieval must be prevented.


๐Ÿง  62. Multimodal PII

PII may exist inside images even when metadata contains no obvious PII.

For example:

Screenshot
   โ†“
Customer Name
Account Number
Phone Number

OCR can expose this information.

Therefore security and privacy scanning should consider both:

Extracted Text
+
Visual Content

๐Ÿงช 63. Multimodal Evaluation

Evaluation should cover multiple layers:

Document Parsing
OCR
Image Retrieval
Text Retrieval
Table Retrieval
Cross-Modal Retrieval
Evidence Fusion
Answer Generation
Citation

๐Ÿ“Š 64. Retrieval Metrics

For retrieval:

Recall@K
Precision@K
MRR
NDCG

For image retrieval:

Text-to-Image Recall@K
Image-to-Text Recall@K
Image-to-Image Recall@K

๐Ÿง  65. Visual Question Answering Evaluation

For visual questions:

Question
+
Image
โ†’
Expected Answer

Example:

Question:
Which service is connected to PostgreSQL?

Image:
Architecture Diagram

Expected:
Payment Service

๐Ÿ“Š 66. Multimodal Groundedness

Evaluate:

Is the answer supported by the image?

Is the answer supported by the table?

Is the answer supported by the text?

Are citations pointing to the correct evidence?

๐Ÿงช 67. Multimodal Evaluation Dataset

Example:

{
  "question": "Which service uses PostgreSQL?",
  "image": "architecture-12.png",
  "expected_answer": "Payment Service",
  "evidence": {
    "page": 12,
    "figure": 3
  }
}

A production evaluation set should include:

Easy Visual Questions
Complex Diagrams
Tables
Charts
OCR Cases
Cross-Modal Questions
Conflicting Evidence
Low-Quality Images

๐Ÿšจ 68. Multimodal Failure Modes

Common failures include:

OCR Errors
Image Retrieval Failure
Incorrect Image Interpretation
Wrong Table Extraction
Layout Loss
Chart Misinterpretation
Incorrect Cross-Modal Linking
Stale Visual Evidence
Missing Provenance
Visual Hallucination
Context Overflow
High Inference Cost

๐Ÿงฉ 69. Low-Resolution Images

Poor image quality can cause:

Unreadable Text
Missing Labels
Incorrect Diagram Interpretation

A preprocessing pipeline may use:

Resolution Detection
+
Selective Upscaling
+
Cropping
+
OCR

Only apply expensive processing where required.


๐Ÿ–ผ๏ธ 70. Image Cropping

Instead of passing a full page:

Page
 โ”œโ”€โ”€ Header
 โ”œโ”€โ”€ Paragraph
 โ”œโ”€โ”€ Diagram
 โ”œโ”€โ”€ Footer

retrieve only:

Relevant Diagram Region

This can reduce:

Visual Noise
Inference Cost
Context Size

๐Ÿ” 71. Region-Level Retrieval

A document image can be divided into regions:

Page
โ”‚
โ”œโ”€โ”€ Region A โ†’ Text
โ”œโ”€โ”€ Region B โ†’ Table
โ”œโ”€โ”€ Region C โ†’ Diagram
โ””โ”€โ”€ Region D โ†’ Caption

Each region can have independent metadata and embeddings.


๐Ÿง  72. Visual Chunking

Visual chunking is analogous to text chunking.

Text:
Paragraph Chunk

Image:
Region Chunk

Table:
Table Chunk

Diagram:
Diagram Chunk

The retrieval layer can then operate at the appropriate granularity.


๐Ÿงฉ 73. Multimodal Parent-Child Retrieval

Parent:
Page 12

Children:
 โ”œโ”€โ”€ Paragraph 12.1
 โ”œโ”€โ”€ Diagram 12.1
 โ”œโ”€โ”€ Table 12.1
 โ””โ”€โ”€ Caption 12.1

A query may retrieve:

Diagram 12.1

but return:

Diagram
+
Caption
+
Related Paragraph

This provides richer context.


โšก 74. Performance Optimization

Multimodal processing can be expensive.

Optimization areas include:

OCR
Image Embeddings
Visual Embeddings
Vision Model Calls
Image Storage
Network Transfer
Context Size

๐Ÿ’ฐ 75. Cost Optimization

Avoid sending every image to a multimodal model.

Use a funnel:

Broad Retrieval
      โ†“
Metadata Filtering
      โ†“
Text / Caption Retrieval
      โ†“
Visual Re-ranking
      โ†“
Top Images
      โ†“
Vision Model

This reduces expensive inference.


โšก 76. Two-Stage Multimodal Retrieval

flowchart TD
    A["User Query"] --> B["Cheap Candidate Retrieval"]

    B --> C["Top 50 Candidates"]

    C --> D["Metadata / Text Filtering"]

    D --> E["Top 10 Candidates"]

    E --> F["Visual Re-ranking"]

    F --> G["Top 3"]

    G --> H["Multimodal LLM"]

This is usually more scalable than sending dozens of images directly to the model.


๐Ÿง  77. Modality-Specific Caching

Cache:

OCR Results
Image Embeddings
Generated Captions
Table Extraction
Vision Analysis

For immutable documents:

Process Once
+
Reuse Many Times

๐Ÿ—„๏ธ 78. Asset Storage

Original assets should generally be stored separately from embeddings.

Object Storage
   โ”‚
   โ”œโ”€โ”€ Original PDF
   โ”œโ”€โ”€ Images
   โ”œโ”€โ”€ Cropped Regions
   โ””โ”€โ”€ Extracted Assets

Vector Store
   โ”‚
   โ””โ”€โ”€ Embeddings + Metadata

The vector store should not necessarily become the primary binary asset store.


๐Ÿงฉ 79. Multimodal Metadata

Useful metadata:

asset_id
document_id
page
section
modality
mime_type
caption
entities
created_at
updated_at
version
tenant_id
access_policy
source_uri

๐Ÿ—๏ธ 80. Production Multimodal RAG Architecture

flowchart TD
    A["Enterprise Sources"] --> B["Ingestion Layer"]

    B --> C["Document Parsing"]

    C --> D["Text"]
    C --> E["Images"]
    C --> F["Tables"]
    C --> G["Audio / Video"]

    D --> H["Text Embeddings"]
    E --> I["Visual Embeddings"]
    F --> J["Structured Representation"]
    G --> K["Transcription / Visual Processing"]

    H --> L["Multimodal Retrieval Layer"]
    I --> L
    J --> L
    K --> L

    L --> M["Metadata Filtering"]

    M --> N["Cross-Modal Re-ranking"]

    N --> O["Evidence Fusion"]

    O --> P["Context Engineering"]

    P --> Q["Multimodal Foundation Model"]

    Q --> R["Response Validation"]

    R --> S["Citation / Attribution"]

    S --> T["Enterprise Response"]

๐Ÿ”„ 81. End-to-End Multimodal RAG

                     ENTERPRISE SOURCES
                             โ”‚
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ–ผ               โ–ผ               โ–ผ
           Text            Images          Tables
             โ”‚               โ”‚               โ”‚
             โ–ผ               โ–ผ               โ–ผ
       Text Parsing      Vision/OCR      Table Parsing
             โ”‚               โ”‚               โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ–ผ
                    Multimodal Indexing
                             โ”‚
                             โ–ผ
                       Query Analysis
                             โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ              โ–ผ              โ–ผ
            Text           Image          Table
          Retrieval       Retrieval      Retrieval
              โ”‚              โ”‚              โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ–ผ
                     Candidate Fusion
                             โ”‚
                             โ–ผ
                      Re-ranking
                             โ”‚
                             โ–ผ
                   Evidence Selection
                             โ”‚
                             โ–ผ
                  Multimodal Context
                             โ”‚
                             โ–ผ
                    Multimodal LLM
                             โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ–ผ                 โ–ผ
                Validation         Citation
                    โ”‚                 โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ–ผ
                   Enterprise Response

๐Ÿง  82. Multimodal RAG + Agentic RAG

Agents can use modality-specific tools.

Agent
 โ”‚
 โ”œโ”€โ”€ Text Search
 โ”‚
 โ”œโ”€โ”€ Image Search
 โ”‚
 โ”œโ”€โ”€ Table / SQL Tool
 โ”‚
 โ”œโ”€โ”€ Knowledge Graph
 โ”‚
 โ”œโ”€โ”€ OCR
 โ”‚
 โ””โ”€โ”€ Vision Analysis

Example:

User:
"Analyze the architecture diagram and
identify the database used by Payment Service."

Agent
 โ†“
Image Retrieval
 โ†“
Vision Analysis
 โ†“
Knowledge Graph Verification
 โ†“
Response

๐Ÿ”— 83. Multimodal RAG + Knowledge Graph

A diagram can become graph evidence:

Image
 โ†“
Vision Model
 โ†“
Entities
 โ†“
Relationships
 โ†“
Knowledge Graph

The graph can then be queried independently.

This creates a pipeline:

Visual Knowledge
       โ†“
Structured Knowledge
       โ†“
Graph Retrieval
       โ†“
RAG

๐Ÿ”€ 84. Multimodal RAG + SQL

Tables can become structured data:

PDF Table
   โ†“
Table Extraction
   โ†“
Validation
   โ†“
Structured Data
   โ†“
SQL

This allows questions such as:

"What was the highest revenue region
in the annual report?"

to be answered using exact structured computation rather than visual approximation.


๐Ÿข 85. Enterprise Multimodal Knowledge Fabric

flowchart TD
    A["Enterprise Knowledge"] --> B["Knowledge Fabric"]

    B --> C["Documents"]

    B --> D["Vector Store"]

    B --> E["Knowledge Graph"]

    B --> F["SQL"]

    B --> G["Image / Media Store"]

    C --> H["RAG Orchestrator"]
    D --> H
    E --> H
    F --> H
    G --> H

    H --> I["Multimodal Foundation Model"]

    I --> J["Validation"]

    J --> K["Enterprise Response"]

๐Ÿง  86. Multimodal Query Router

A production router may classify queries into:

TEXT_ONLY
IMAGE_REQUIRED
TABLE_REQUIRED
GRAPH_REQUIRED
SQL_REQUIRED
MULTIMODAL

Example:

class QueryModality:

    TEXT_ONLY = "text"
    IMAGE = "image"
    TABLE = "table"
    GRAPH = "graph"
    SQL = "sql"
    MULTIMODAL = "multimodal"

๐Ÿงฉ 87. Capability-Based Architecture

Rather than coupling the application to one multimodal provider:

class VisionProvider:

    def analyze_image(self, image, prompt):
        raise NotImplementedError


class OCRProvider:

    def extract_text(self, image):
        raise NotImplementedError


class EmbeddingProvider:

    def embed_text(self, text):
        raise NotImplementedError

    def embed_image(self, image):
        raise NotImplementedError

Cloud- or model-specific implementations can sit behind these interfaces.


๐Ÿ›๏ธ 88. Ports & Adapters

                    Application
                         โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ          โ–ผ          โ–ผ
          VisionPort  OCRPort  EmbeddingPort
              โ”‚          โ”‚          โ”‚
              โ–ผ          โ–ผ          โ–ผ
          Adapter A   Adapter B   Adapter C
              โ”‚          โ”‚          โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ–ผ
                  AI / Cloud Services

This keeps the application architecture portable.


๐Ÿงช 89. Practical Exercise

Build a multimodal document collection:

architecture.pdf
annual-report.pdf
invoice-samples.pdf
product-catalog.pdf

Extract:

Text
Images
Tables
Metadata

Then index them.


๐Ÿ”Ž 90. Practice Queries

Test:

1. Find the architecture diagram for the payment platform.

2. Which service connects to PostgreSQL?

3. What does the architecture diagram show?

4. What was the highest-revenue region?

5. Find the invoice containing customer Acme.

6. What amount appears on the invoice?

7. Which database is shown in the deployment diagram?

8. Compare the architecture in version 2 and version 3.

๐Ÿงช 91. Compare Retrieval Strategies

Implement:

A. Text-only RAG

B. Image-only Retrieval

C. Text + Image Retrieval

D. Text + Image + Table Retrieval

E. Text + Image + Table + Graph

Measure:

Retrieval Recall
Answer Accuracy
Groundedness
Citation Accuracy
Latency
Cost

๐Ÿ“Š 92. Example Evaluation Matrix

Architecture Retrieval Grounding Latency Cost
Text RAG Text Medium Low Low
Image Retrieval Visual Medium Medium Medium
Text + Image High High Medium Medium
Text + Image + Table High High Medium Medium
Full Multimodal + Graph + SQL Very High Very High High High

The exact results depend on the dataset and implementation.


๐Ÿšจ 93. Common Mistakes

Mistake 1 โ€” Converting Everything to Text

This can destroy visual relationships.


Mistake 2 โ€” Sending Every Image to the LLM

This increases:

Latency
Cost
Context Noise

Mistake 3 โ€” Ignoring Layout

Spatial relationships can contain important meaning.


Mistake 4 โ€” Treating OCR as Complete Understanding

OCR provides text, not complete visual semantics.


Mistake 5 โ€” Ignoring Tables

Tables should often be represented structurally.


Mistake 6 โ€” Ignoring Provenance

Visual evidence should be traceable to:

Document
Page
Figure
Region

Mistake 7 โ€” Ignoring Versioning

Old diagrams can produce incorrect answers.


Mistake 8 โ€” Trusting Vision Models Blindly

Visual models can hallucinate objects and relationships.


Mistake 9 โ€” Ignoring Security

Images can contain highly sensitive information.


Mistake 10 โ€” Building Multimodal Infrastructure Without a Use Case

Multimodal processing can be expensive.

Start with a measurable business requirement.


๐Ÿง  94. Design Principles

Principle 1 โ€” Preserve Modality

Do not convert everything to text if visual structure carries meaning.


Principle 2 โ€” Retrieve Before Reasoning

Use retrieval to reduce the amount of visual and textual information sent to the model.


Principle 3 โ€” Use the Right Representation

Text โ†’ Text Embedding
Image โ†’ Visual Embedding
Table โ†’ Structured Representation
Graph โ†’ Relationship Representation

Principle 4 โ€” Preserve Layout

Page and region relationships can be critical.


Principle 5 โ€” Preserve Provenance

Every multimodal asset should be traceable.


Principle 6 โ€” Route by Modality

Do not perform expensive visual reasoning when text retrieval is sufficient.


Principle 7 โ€” Validate Visual Claims

Multimodal models can hallucinate.


Principle 8 โ€” Combine Modalities

Different modalities often provide complementary evidence.


Principle 9 โ€” Secure Every Representation

Protect:

Original
OCR
Embedding
Metadata
Retrieved Context

Principle 10 โ€” Optimize the Expensive Path

Use:

Filtering
Caching
Re-ranking
Cropping
Batching

before expensive multimodal inference.


๐Ÿ“‹ 95. Production Checklist

โ˜ Identify multimodal use cases
โ˜ Identify supported modalities
โ˜ Identify source systems
โ˜ Identify document types

โ˜ Implement document parsing
โ˜ Implement layout extraction
โ˜ Implement OCR
โ˜ Implement image extraction
โ˜ Implement table extraction
โ˜ Implement chart extraction
โ˜ Implement diagram extraction

โ˜ Preserve page information
โ˜ Preserve bounding boxes
โ˜ Preserve section relationships
โ˜ Preserve captions
โ˜ Preserve document versions

โ˜ Generate text embeddings
โ˜ Generate image embeddings
โ˜ Define multimodal embedding strategy
โ˜ Build multimodal indexes
โ˜ Build metadata indexes

โ˜ Implement text retrieval
โ˜ Implement image retrieval
โ˜ Implement table retrieval
โ˜ Implement cross-modal retrieval
โ˜ Implement modality routing
โ˜ Implement candidate fusion
โ˜ Implement re-ranking

โ˜ Implement multimodal context assembly
โ˜ Implement visual context selection
โ˜ Implement context compression

โ˜ Implement vision model integration
โ˜ Implement response validation
โ˜ Implement citation resolution
โ˜ Implement provenance tracking

โ˜ Implement authentication
โ˜ Implement authorization
โ˜ Implement tenant isolation
โ˜ Protect sensitive images
โ˜ Protect OCR output
โ˜ Protect embeddings

โ˜ Implement asset versioning
โ˜ Implement freshness tracking
โ˜ Implement deletion handling

โ˜ Evaluate OCR quality
โ˜ Evaluate image retrieval
โ˜ Evaluate text retrieval
โ˜ Evaluate table retrieval
โ˜ Evaluate cross-modal retrieval
โ˜ Evaluate groundedness
โ˜ Evaluate citation accuracy

โ˜ Monitor retrieval latency
โ˜ Monitor vision inference latency
โ˜ Monitor OCR latency
โ˜ Monitor model cost
โ˜ Monitor context size
โ˜ Monitor failed retrievals

โ˜ Cache embeddings
โ˜ Cache OCR
โ˜ Cache image analysis
โ˜ Use candidate filtering
โ˜ Use visual re-ranking
โ˜ Control multimodal model calls

โ˜ Build regression datasets
โ˜ Test conflicting evidence
โ˜ Test stale documents
โ˜ Test low-quality images
โ˜ Test security boundaries

๐Ÿ“š 96. Key Takeaways

  • Multimodal RAG extends RAG beyond text-only knowledge.
  • Enterprise knowledge often exists in images, tables, charts, diagrams, audio, and video.
  • OCR is important for scanned documents but does not replace visual understanding.
  • Layout information can be critical for preserving document meaning.
  • Images can be represented using visual embeddings.
  • Multimodal embeddings can enable cross-modal retrieval.
  • Text-to-image retrieval allows natural-language queries to find visual evidence.
  • Image-to-text retrieval allows visual inputs to retrieve textual documentation.
  • Image-to-image retrieval supports visual similarity use cases.
  • Tables should often retain their structural representation.
  • Charts and diagrams can contain information that plain text extraction loses.
  • Multimodal chunking should preserve relationships between text, images, tables, captions, and sections.
  • Parent-child retrieval can return richer multimodal context.
  • Caption generation can make visual assets easier to retrieve.
  • Separate or unified multimodal indexes can be used depending on requirements.
  • Modality-aware routing can reduce unnecessary inference cost.
  • Cross-modal re-ranking can improve retrieval quality.
  • Multimodal evidence should preserve provenance.
  • Visual evidence should be linked to document, page, figure, or region.
  • Multimodal models can hallucinate visual facts and therefore require grounding and validation.
  • Conflicting visual and textual evidence should be resolved using source authority, version, and temporal metadata.
  • Knowledge Graphs can represent relationships extracted from diagrams and visual documents.
  • SQL can provide exact structured computation for information extracted from tables.
  • Multimodal RAG can therefore work together with Vector RAG, Graph RAG, and SQL RAG.
  • Security must apply to original assets, OCR, embeddings, metadata, and retrieved context.
  • Multimodal RAG can be significantly more expensive than text-only RAG.
  • Candidate filtering, caching, cropping, and re-ranking help control cost.
  • Production Multimodal RAG requires evaluation, observability, provenance, security, and governance.

๐Ÿง  Final Mental Model

                         ENTERPRISE KNOWLEDGE
                                  โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ–ผ              โ–ผ           โ–ผ           โ–ผ              โ–ผ
      TEXT          IMAGES      TABLES      AUDIO          VIDEO
       โ”‚              โ”‚           โ”‚           โ”‚              โ”‚
       โ–ผ              โ–ผ           โ–ผ           โ–ผ              โ–ผ
    Parsing          OCR      Extraction  Transcription   Processing
       โ”‚              โ”‚           โ”‚           โ”‚              โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ–ผ
                         MULTIMODAL INDEXING
                                  โ”‚
                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                     โ–ผ            โ–ผ            โ–ผ
                  Text Index   Image Index  Structured Index
                     โ”‚            โ”‚            โ”‚
                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ–ผ
                           QUERY ANALYSIS
                                  โ”‚
                                  โ–ผ
                         MODALITY ROUTING
                                  โ”‚
               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
               โ–ผ                  โ–ผ                  โ–ผ
             Text              Image              Table
           Retrieval          Retrieval          Retrieval
               โ”‚                  โ”‚                  โ”‚
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ–ผ
                         CANDIDATE FUSION
                                  โ”‚
                                  โ–ผ
                         CROSS-MODAL RANKING
                                  โ”‚
                                  โ–ผ
                       EVIDENCE SELECTION
                                  โ”‚
                                  โ–ผ
                       CONTEXT ENGINEERING
                                  โ”‚
                                  โ–ผ
                     MULTIMODAL FOUNDATION MODEL
                                  โ”‚
                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                       โ–ผ                     โ–ผ
                   Validation             Citation
                       โ”‚                     โ”‚
                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                  โ–ผ
                        ENTERPRISE RESPONSE

The central idea is:

Multimodal RAG preserves and retrieves knowledge in the form in which it actually exists, rather than forcing every enterprise artifact into plain text.

A mature enterprise architecture therefore becomes:

                  Enterprise Knowledge
                          โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ                 โ–ผ                 โ–ผ
     Documents          Images            Tables
        โ”‚                 โ”‚                 โ”‚
        โ–ผ                 โ–ผ                 โ–ผ
   Vector Search      Visual Search      SQL
        โ”‚                 โ”‚                 โ”‚
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ”‚
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ–ผ                         โ–ผ
      Knowledge Graph             Other Sources
             โ”‚                         โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                          โ–ผ
                   Evidence Fusion
                          โ”‚
                          โ–ผ
                 Context Engineering
                          โ”‚
                          โ–ผ
                Multimodal Foundation Model
                          โ”‚
                          โ–ผ
                  Response Validation
                          โ”‚
                          โ–ผ
                  Citation / Attribution
                          โ”‚
                          โ–ผ
                  Enterprise Response

The important architectural principle is:

                    RIGHT KNOWLEDGE
                           โ”‚
                           โ–ผ
                    RIGHT MODALITY
                           โ”‚
                           โ–ผ
                    RIGHT RETRIEVER
                           โ”‚
                           โ–ผ
                    RIGHT EVIDENCE
                           โ”‚
                           โ–ผ
                  MULTIMODAL REASONING
                           โ”‚
                           โ–ผ
                  VALIDATED RESPONSE

Multimodal RAG is therefore not simply:

RAG + Images

It is a broader retrieval architecture that combines:

Multimodal Ingestion
+
Layout Understanding
+
Modality-Specific Indexing
+
Cross-Modal Retrieval
+
Evidence Fusion
+
Multimodal Reasoning
+
Provenance
+
Validation
+
Security
+
Observability

This makes Multimodal RAG particularly valuable for enterprise applications involving technical documentation, architecture repositories, financial reports, invoices, contracts, product catalogs, dashboards, engineering documents, visual knowledge bases, and other domains where critical information exists outside plain text.


๐Ÿงญ Chapter Navigation

Part V โ€” Advanced Retrieval-Augmented Generation

Previous:
04. SQL RAG

Next:
06. Agentic RAG

Section:
05 โ€” Advanced RAG Architecture

Advanced RAG Architecture Path

01 Advanced RAG Architecture
        โ†“
02 Graph RAG
        โ†“
03 Knowledge Graphs for RAG
        โ†“
04 SQL RAG
        โ†“
05 Multimodal RAG
        โ†“
06 Agentic RAG

Enterprise AI Engineering Handbook
Building Production-Grade Enterprise AI Systems โ€” One Chapter at a Time.