Skip to main content

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.

Mesa de Ayuda IA is built around five independent, specialized AI agents. Every agent is a Python subclass of the abstract BaseAgent class, owns a ChromaDB vector collection as its knowledge source, loads its behavior from a dedicated Markdown system-prompt file, and is registered at startup in the global AgentRegistry. The LangGraph StateGraph orchestrator classifies each incoming request and routes it to the appropriate agent — or to multiple agents in parallel for mixed-intent queries — before consolidating the answers into a single coherent response.

Catalog Agent

Answers questions about Patito S.A. products, technical specifications, list prices, and stock availability. Intent: catalogo_precios.

Policies Agent

Handles discount limits, authorization levels, credit terms, warranties, and return policies. Intent: politicas_comerciales.

Sales Process Agent

Guides sales reps through the CRM pipeline stages, data requirements, and opportunity-closing criteria. Intent: proceso_ventas.

Multimodal Agent

Identifies products from uploaded images using Gemini Vision, then cross-references the catalog for pricing and availability. Intent: multimodal.

Action Agent

The only write-capable agent: collects opportunity data, validates required fields, requests confirmation, then registers via LangChain function calling. Intent: accion_registro.

Agent comparison

Agent nameIntent categoryChromaDB collectionKnowledge document
agente_catalogocatalogo_precioscol_catalogo01_Catalogo_Productos_Precios.txt
agente_politicaspoliticas_comercialescol_politicas02_Politicas_Comerciales_Descuentos_Credito.txt
agente_proceso_ventasproceso_ventascol_proceso_ventas03_Proceso_Ventas_CRM.txt
agente_multimodalmultimodalcol_catalogo(shares catalog collection)
agente_accionaccion_registrocol_proceso_ventas03_Proceso_Ventas_CRM.txt
For the mixta intent, the orchestrator runs agente_catalogo, agente_politicas, and agente_proceso_ventas in parallel and passes all three partial answers to a consolidation step.

How to add a new agent

Every new agent follows the same four-step pattern:
  1. Extend BaseAgent — create a new file under backend/app/agents/.
  2. Implement the four abstract propertiesname, description, collection_name, and system_prompt_path.
  3. Write a system prompt — add a Markdown file under backend/app/prompts/.
  4. Register the agent — import and instantiate it in backend/app/agents/__init__.py inside register_all_agents().
The registry pattern means the orchestrator never needs to be modified; it discovers agents through AgentRegistry at runtime.

BaseAgent abstract interface

The following excerpt shows the abstract property stubs and the process_query signature that every agent must satisfy. The concrete implementation in BaseAgent provides the full RAG→prompt→LLM→result pipeline as a default; subclasses that need a different flow (such as MultimodalAgent and AccionAgent) override process_query directly.
from abc import ABC, abstractmethod
from app.schemas.agent import AgentResult
from app.rag.retriever import retrieve_context
from app.core.llm import get_llm
from app.utils.logger import logger
from langchain_core.messages import SystemMessage, HumanMessage

class BaseAgent(ABC):
    """
    Clase base para todos los agentes especializados.
    Define el flujo estándar RAG + LLM.
    """

    @property
    @abstractmethod
    def name(self) -> str:
        """Nombre del agente (ej. agente_arquitectura)"""
        pass

    @property
    @abstractmethod
    def description(self) -> str:
        """Descripción de lo que hace el agente"""
        pass

    @property
    @abstractmethod
    def collection_name(self) -> str:
        """Nombre de la colección ChromaDB de este agente"""
        pass

    @property
    @abstractmethod
    def system_prompt_path(self) -> str:
        """Ruta al archivo Markdown con el prompt del agente"""
        pass

    def process_query(self, question: str) -> AgentResult:
        """
        Flujo principal del agente:
        1. Busca en su colección ChromaDB
        2. Inyecta el contexto en su prompt
        3. Invoca al LLM
        4. Retorna el resultado con las fuentes
        """
        ...

AgentResult schema

Every agent returns an AgentResult Pydantic model. Downstream consumers (the consolidator and the API response) rely on this contract:
from pydantic import BaseModel
from typing import List
from app.schemas.chat import SourceInfo

class AgentResult(BaseModel):
    """Resultado devuelto por un agente individual tras procesar una consulta"""
    agent_name: str
    answer: str
    sources: List[SourceInfo] = []
    tokens_input: int = 0
    tokens_output: int = 0
Each SourceInfo entry in sources carries document_name, content_snippet (first 200 characters of the matched chunk), and relevance_score from the ChromaDB cosine-similarity search.

Build docs developers (and LLMs) love