The Multimodal Agent (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/geremyjampiersalasgarcia-eng/Caso_Practico_Semillero_IA/llms.txt
Use this file to discover all available pages before exploring further.
agente_multimodal) extends the standard RAG pattern with a two-stage vision pipeline. When a user attaches a product image, the agent first passes the base64-encoded image to Gemini’s multimodal capabilities to visually identify and describe the product, then queries the col_catalogo ChromaDB collection with the resulting description to retrieve pricing, availability, and any other catalog data. The final response integrates both the visual analysis and the catalog context into a single coherent answer.
When it triggers
The multimodal agent is invoked automatically whenever theimage field is present in the ChatRequest payload. The intent classifier returns multimodal with confidence = 1.0 the moment an image is detected — regardless of the text question — so no additional routing configuration is required.
Agent properties
| Property | Value |
|---|---|
name | agente_multimodal |
collection_name | col_catalogo |
system_prompt_path | backend/app/prompts/multimodal_prompt.md |
| Knowledge base | Shares col_catalogo with agente_catalogo |
| Intent trigger | multimodal (auto-detected when image field is present) |
Source class
MultimodalAgent overrides process_query to accept the optional image_data: Optional[str] parameter and implement the two-stage pipeline described below.
Sending an image
Include theimage field in the POST /api/v1/chat request body as a base64 data URI:
question field is still required and provides the user’s intent (e.g., identifying the product, asking for its price, checking availability). The image field drives routing to agente_multimodal automatically.
Test images
The repository ships with two sample product images you can use immediately to verify the agent end-to-end:“¿Qué producto es este? ¿Está en el catálogo y cuánto cuesta?”
How it works
The multimodal pipeline runs in two sequential Gemini calls: Step 1 — Vision analysis. The base64 image and the multimodal system prompt are sent together toChatGoogleGenerativeAI as a multimodal HumanMessage with type: "image_url" and type: "text" content parts. Gemini Vision describes the item visible in the image and attempts to match it against the known Patito S.A. product lines (Pro, Lite, and accessories).
Step 2 — Catalog cross-reference. The textual description produced in Step 1 is used as the query string for a retrieve_context() call against col_catalogo. The most relevant catalog chunks are retrieved and injected into a consolidation prompt alongside the visual analysis and the user’s original question.
Step 3 — Response consolidation. A second LLM call combines the image description and catalog context to produce the final response: identified product, list price, availability status, and any other relevant catalog information. A 2-second sleep between calls prevents hitting Gemini’s free-tier rate limit (15 RPM).
If the image cannot be matched to a known product, the agent states this clearly rather than guessing.