Multimodal RAG Architecture
Use this skill when a knowledge base contains more than plain text. Treat images, tables, equations, layout, captions, and cross-page structure as first-class evidence instead of stripping everything into text chunks.
When Text-Only RAG Fails
Switch to multimodal RAG when:
- Important answers live in tables, charts, screenshots, diagrams, figures, or equations
- PDFs have layout-dependent meaning such as forms, invoices, manuals, or scientific papers
- The same concept appears across text, image, and table regions
- Long documents cause retrieval to miss sparse visual evidence
- Users ask for answers that require comparing visual and textual context
Architecture
Parse by modality
- Text blocks
- Tables
- Figures and images
- Equations
- Captions
- Page and section layout
Create multimodal evidence nodes
- Preserve source document, page, bounding box, modality, caption, extracted text, and raw asset pointer.
- Attach normalized text summaries for retrieval.
- Keep original media accessible for answer verification.
Build relationships
- Figure-to-caption
- Table-to-section
- Equation-to-explanation
- Cross-page continuation
- Visual element-to-text mention
Retrieve in stages
- Query rewrite into text, table, and visual intents.
- Hybrid lexical/vector retrieval over summaries and extracted text.
- Graph traversal to pull adjacent evidence.
- Optional visual reranking for image-heavy answers.
Generate with provenance
- Cite document, page, modality, and region.
- Distinguish extracted facts from model interpretation.
- Re-open raw assets when the answer depends on visual detail.
Design Rules
- Do not OCR everything and discard layout.
- Do not embed raw image summaries without retaining the image.
- Do not answer from captions alone when the figure itself matters.
- Prefer smaller modality-specific indexes over one overloaded index.
- Keep chunk boundaries aligned to document structure, not fixed token counts.
- Record extraction confidence for OCR, table parsing, and visual descriptions.
Helper Script
Use rag_modality_audit.py to scan a folder and estimate whether a corpus needs multimodal handling:
python scripts/rag_modality_audit.py ./docs
References
Read architecture-checklist.md when implementing or reviewing a multimodal RAG pipeline.
External grounding:
1---2name: multimodal-rag-architecture3description: Use when designing or auditing RAG over PDFs, images, tables, charts, equations, video frames, or heterogeneous documents where text-only chunking loses important evidence.4---56# Multimodal RAG Architecture78Use this skill when a knowledge base contains more than plain text. Treat images, tables, equations, layout, captions, and cross-page structure as first-class evidence instead of stripping everything into text chunks.910## When Text-Only RAG Fails1112Switch to multimodal RAG when:1314- Important answers live in tables, charts, screenshots, diagrams, figures, or equations15- PDFs have layout-dependent meaning such as forms, invoices, manuals, or scientific papers16- The same concept appears across text, image, and table regions17- Long documents cause retrieval to miss sparse visual evidence18- Users ask for answers that require comparing visual and textual context1920## Architecture21221. **Parse by modality**23 - Text blocks24 - Tables25 - Figures and images26 - Equations27 - Captions28 - Page and section layout29302. **Create multimodal evidence nodes**31 - Preserve source document, page, bounding box, modality, caption, extracted text, and raw asset pointer.32 - Attach normalized text summaries for retrieval.33 - Keep original media accessible for answer verification.34353. **Build relationships**36 - Figure-to-caption37 - Table-to-section38 - Equation-to-explanation39 - Cross-page continuation40 - Visual element-to-text mention41424. **Retrieve in stages**43 - Query rewrite into text, table, and visual intents.44 - Hybrid lexical/vector retrieval over summaries and extracted text.45 - Graph traversal to pull adjacent evidence.46 - Optional visual reranking for image-heavy answers.47485. **Generate with provenance**49 - Cite document, page, modality, and region.50 - Distinguish extracted facts from model interpretation.51 - Re-open raw assets when the answer depends on visual detail.5253## Design Rules5455- Do not OCR everything and discard layout.56- Do not embed raw image summaries without retaining the image.57- Do not answer from captions alone when the figure itself matters.58- Prefer smaller modality-specific indexes over one overloaded index.59- Keep chunk boundaries aligned to document structure, not fixed token counts.60- Record extraction confidence for OCR, table parsing, and visual descriptions.6162## Helper Script6364Use [rag_modality_audit.py](./scripts/rag_modality_audit.py) to scan a folder and estimate whether a corpus needs multimodal handling:6566```bash67python scripts/rag_modality_audit.py ./docs68```6970## References7172Read [architecture-checklist.md](./references/architecture-checklist.md) when implementing or reviewing a multimodal RAG pipeline.7374External grounding:7576- [RAG-Anything arXiv paper](https://arxiv.org/abs/2510.12323)77- [RAG-Anything GitHub repository](https://github.com/HKUDS/RAG-Anything)78- [VimRAG HuggingFace paper page](https://huggingface.co/papers/2602.12735)79- [Alibaba-NLP/VRAG GitHub repository](https://github.com/Alibaba-NLP/VRAG)80- [HM-RAG arXiv paper](https://arxiv.org/abs/2504.12330)81