Multimodalny RAG z obrazami i tabelami
Rozszerz RAG poza zwykły tekst, aby wyszukiwać informacje w obrazach, wykresach i tabelach strukturalnych oraz wnioskować na ich podstawie.
Multimodalny RAG z obrazami i tabelami to bezpłatna lekcja LangChain / RAG / Vector DBs na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej LangChain / RAG / Vector DBs, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs LangChain / RAG / Vector DBs zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
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
Często zadawane pytania
Czy lekcja „Multimodalny RAG z obrazami i tabelami” jest bezpłatna?
Tak — pełny tekst „Multimodalny RAG z obrazami i tabelami” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu LangChain / RAG / Vector DBs, przejdź na CoddyKit PRO. Kurs LangChain / RAG / Vector DBs zawiera 4 lekcji w sumie.
Co nauczysz się w „Multimodalny RAG z obrazami i tabelami”?
Rozszerz RAG poza zwykły tekst, aby wyszukiwać informacje w obrazach, wykresach i tabelach strukturalnych oraz wnioskować na ich podstawie. Ćwiczysz LangChain / RAG / Vector DBs z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć LangChain / RAG / Vector DBs?
Nie wymagamy żadnego doświadczenia. LangChain / RAG / Vector DBs w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.
Ile czasu zajmuje lekcja „Multimodalny RAG z obrazami i tabelami”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji LangChain / RAG / Vector DBs?
Tak. Każda lekcja LangChain / RAG / Vector DBs zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- RAG do generowania i wspomagania tworzenia kodu
- Tworzenie systemów RAG działających w czasie rzeczywistym
- Nowe trendy i badania w dziedzinie RAG
- Multimodalny RAG z obrazami i tabelami