Skip to content
RAG Explained Better

Embedding Images and Text Together for RAG

How multimodal retrieval works, and the evaluation problem it creates.

Multimodal embeddings encode images (and often other media like audio/video) and text into one shared vector space. That shared-space design lets a text query retrieve images and an image query retrieve text without forcing every modality through captioning first.

How do multimodal embeddings put images and text in one space?

Multimodal embeddings align modalities through contrastive training: paired image+caption examples land close in embedding space, while unpaired examples are pushed apart.

The most well-known example is CLIP, trained on 400M image–text pairs with dual encoders (OpenAI, 2021). ImageBind extends this idea to six modalities aligned via images (Meta, 2023).

Shared-space multimodal embeddings: image encoder and text encoder project into a shared vector space, then nearest-neighbor retrieval aligns cross-modal matches.

What is the modality gap in multimodal embeddings?

Even after contrastive alignment, dual-encoder models can leave a modality gap: each modality clusters into its own “cone” that does not fully overlap with the other.

Weaviate’s multimodal guide summarizes the “Mind the Gap” problem (Liang et al., NeurIPS 2022 / arXiv:2203.02053): contrastive loss optimizes relative pair ranking, but it does not directly force inter-cone alignment distance to close, so cross-modal accuracy can remain unpredictable and biased.

Practical symptom

You can see high performance for text↔text retrieval while text↔image retrieval is inconsistent, because the embedding space geometry still has a residual modality mismatch.

Should you embed natively or convert images to text first?

Production systems usually pick between three shapes: native shared-space multimodal embeddings, a text-bridge (caption/OCR then text-embed), or separate per-modality indexes with later fusion.

Elastic’s multimodal RAG writeups frame these as the core options:

Native vs text-bridge vs separate retrieval for multimodal embeddings
Approach What you store Main trade-off
Native shared-space Image+text in one vector space Training/data heavy; geometry drift risk
Text-bridge (caption/OCR) Caption/OCR text embeddings Conversion can lose layout/tone/spatial cues
Separate retrieval Per-modality indexes Fusion/glue cost; more orchestration

If your “conversion destroys the signal” risk is high (layout-heavy PDFs, diagrams, visual actions), native embeddings or separate indexes are often safer. If your images are mostly documentation captions and OCR is reliable, caption-first can be cheaper and easier to operate.

When should you use multimodal embeddings?

You should use multimodal embeddings when your corpus signal is not contained in text alone—especially when OCR mangles meaning, when layout matters, or when users search by visual examples.

Multimodal retrieval is usually not the right default when your corpus is pure text: text embeddings are typically cheaper/faster, and multimodal ingestion adds cost without necessarily improving grounded retrieval.

Why is multimodal retrieval hard to evaluate?

Multimodal retrieval is hard to evaluate because text-centric RAG metrics do not measure multimodal grounding and cross-modal ranking quality.

IBM highlights that available benchmarks are primarily text-based and do not include multimodal grounding/reasoning; it also notes that robust evaluation remains an open area (IBM Think key challenges). The MRAG survey (Liang et al., arXiv:2504.08748) further emphasizes that evaluation involves humans, rule-based methods, or LLM-MLLM judges with different trade-offs, and multimodal grounding datasets and metrics are still evolving.

How do you implement multimodal embeddings for RAG?

You implement multimodal embeddings for RAG by choosing an approach (native shared-space vs text-bridge vs separate retrieval), embedding corpus+query with the matching multimodal/bridge pipeline, storing the vectors in a vector database, and retrieving with cosine/ANN—then using the retrieved media as evidence for generation when available.

Stores and APIs differ, but the pattern stays:

  • Embed documents and queries consistently. Use the same multimodal encoder (or same OCR/caption pipeline) for both indexing and search.
  • Use a vector store that accepts your vector shape. Weaviate provides multimodal example retrieval patterns such as near_text / near_media; Elastic and others implement similar cross-modal nearest-neighbor search.
  • Route to a runnable end-to-end template. See building the pipeline for the pinned orchestration skeleton.
What are multimodal embeddings?

Multimodal embeddings encode images (and often other modalities like audio/video) and text into a shared vector space. That shared space enables cross-modal retrieval: text queries can retrieve images, and image queries can retrieve text.

How does CLIP work?

CLIP aligns images and captions by contrastive training: paired image–caption examples are pushed close in the shared embedding space, while mismatched pairs are pushed apart. Weaviate’s multimodal guide summarizes that CLIP was trained on 400M image–text pairs (OpenAI, 2021).

Native vs caption-then-embed?

Native shared-space multimodal embeddings store vectors for multiple modalities directly. Caption-then-embed (OCR/caption then text-embed) reuses the text retrieval stack but can lose spatial tone/layout signal. Separate retrieval indexes each modality and fuses results; it’s often more complex but can preserve modality-specific accuracy.

When is text-only enough?

Text-only is usually enough when your corpus signal is already captured in text (and OCR/captioning would be faithful). In that case, text embeddings are typically cheaper and faster, while multimodal ingestion adds cost without necessarily improving grounded retrieval.

Why is multimodal eval hard?

Multimodal retrieval is hard to evaluate because common RAG metrics are text-centric and do not measure multimodal grounding or cross-modal ranking quality. IBM’s key challenges and the MRAG survey (Liang et al., arXiv:2504.08748) emphasize that datasets and judges for multimodal grounding remain an active area of research.