Мультимодальный RAG с изображениями и таблицами
Расширьте RAG за пределы обычного текста: извлекайте информацию из изображений, диаграмм и структурированных таблиц и рассуждайте на их основе.
«Мультимодальный RAG с изображениями и таблицами» — бесплатный урок LangChain / RAG / Vector DBs на CoddyKit. Это урок 4 из 4. Ты можешь прочитать весь урок бесплатно ниже — а потом практиковать его прямо в браузере с встроенным редактором кода и ИИ-репетитором 24/7. Это часть пути обучения LangChain / RAG / Vector DBs, и твой прогресс синхронизируется между веб-версией и приложением CoddyKit. Курс LangChain / RAG / Vector DBs содержит 4 уроков всего.
Части этого урока еще не переведены и отображаются на английском.
Beyond Plain Text
Real documents contain images, charts, and tables. Multimodal RAG indexes and retrieves these non-text elements so the model can answer questions that depend on them.
What Counts as Multimodal
Multimodal sources include scanned pages, diagrams, screenshots, photos, and spreadsheet-style tables embedded in PDFs or web pages.
- Images
- Charts and figures
- Tables
Strategy 1: Describe Then Embed
Use a vision model to generate a text description of each image, then embed the description with your normal text embeddings. Retrieval stays text-based.
caption = vision_model.describe(image)
store.add_texts([caption], metadatas=[{"image": image_id}])Strategy 2: Multimodal Embeddings
Models like CLIP embed images and text into the same vector space, so a text query can directly match an image without a caption step.
Handling Tables
Tables lose meaning when flattened. Preserve structure by converting each table to Markdown or HTML before chunking so rows and headers stay linked.
table_md = "| Year | Revenue |\n|---|---|\n| 2024 | 10M |\n| 2025 | 12M |"
store.add_texts([table_md], metadatas=[{"type": "table"}])Summarizing Large Tables
For wide or long tables, store both a natural-language summary (for retrieval) and the raw table (for the answer), linking them by id.
Routing by Modality
At query time, detect what the question needs. A request about a chart should retrieve image elements; a numeric lookup should target tables.
Passing Images to the LLM
Multimodal LLMs accept images directly in the prompt. After retrieving the relevant image, include it alongside the question for grounded reasoning.
messages = [{"role": "user", "content": [
{"type": "text", "text": "What trend does this chart show?"},
{"type": "image_url", "image_url": {"url": img_url}},
]}]Citing Visual Sources
Track which image or table produced an answer in metadata, so you can show the user the exact figure or table the model relied on.
Cost and Latency
Vision calls and image embeddings cost more than text. Cache captions, downscale images, and only invoke vision when the query truly needs it.
Putting It Together
Extract images and tables during loading, index them via captions or multimodal embeddings, route queries by modality, and feed the right element to a multimodal LLM.
Quick Check
Test your understanding of multimodal RAG.
Recap
You extended RAG to multiple modalities:
- Describe-then-embed or multimodal embeddings for images
- Preserve table structure as Markdown
- Route queries by modality
- Feed images to a multimodal LLM and cite visual sources
Часто задаваемые вопросы
Урок «Мультимодальный RAG с изображениями и таблицами» бесплатный?
Да — полный текст урока «Мультимодальный RAG с изображениями и таблицами» бесплатно доступен здесь в веб-версии. Чтобы практиковать его интерактивно (встроенный редактор кода и ИИ-репетитор 24/7) и разблокировать остальной курс LangChain / RAG / Vector DBs, подпишись на CoddyKit PRO. Курс LangChain / RAG / Vector DBs содержит 4 уроков всего.
Чему я научусь в уроке «Мультимодальный RAG с изображениями и таблицами»?
Расширьте RAG за пределы обычного текста: извлекайте информацию из изображений, диаграмм и структурированных таблиц и рассуждайте на их основе. Ты практикуешь LangChain / RAG / Vector DBs с помощью реального кода, который запускаешь прямо в браузере, и ИИ-репетитор 24/7 отвечает на твои вопросы во время урока.
Нужен ли мне опыт, чтобы начать LangChain / RAG / Vector DBs?
Предыдущий опыт не требуется. LangChain / RAG / Vector DBs на CoddyKit структурирован для всех уровней — от новичков до продвинутых, поэтому ты можешь начать отсюда или с самого начала и учиться в своем темпе. Это урок 4 из 4.
Сколько времени занимает урок «Мультимодальный RAG с изображениями и таблицами»?
Большинство уроков CoddyKit занимают около 5–10 минут. Каждый из них компактный и интерактивный, поэтому ты постоянно делаешь прогресс и продолжаешь с того же места в веб-версии и приложении.
Можно ли писать и запускать код в этом уроке LangChain / RAG / Vector DBs?
Да. Каждый урок LangChain / RAG / Vector DBs включает встроенный редактор кода, поэтому ты пишешь и запускаешь реальный код прямо в браузере и получаешь моментальную обратную связь от AI — локальная установка не требуется.
Все уроки этого курса
- RAG для генерации и дополнения кода
- Создание систем RAG реального времени
- Новые тенденции и исследования в области RAG
- Мультимодальный RAG с изображениями и таблицами