0Pricing
LangChain / RAG / Vector DBs · درس

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 يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. استخدام RAG لتوليد التعليمات البرمجية والمساعدة
  2. بناء أنظمة RAG آنية
  3. الاتجاهات الناشئة والأبحاث في RAG
  4. RAG متعدد الوسائط مع الصور والجداول
← العودة إلى LangChain / RAG / Vector DBs