This guide walks you through a complete local deployment of Mesa de Ayuda IA — from cloning the repository to chatting with all five AI agents in your browser. Follow the steps in order and you should have a fully working system in approximately 10 minutes.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.
Steps
Get a Google Gemini API Key
All LLM inference and embedding generation use Google Gemini, which requires an API key. The free tier is sufficient for local development.
- Go to https://aistudio.google.com/apikey
- Sign in with a Google account
- Click Create API key and copy the generated key
.env file in the next step.Configure environment variables
Copy the provided template and open the new file for editing:Open The
backend/.env and fill in your values. The critical fields are shown below:.env file is listed in .gitignore — your API key will never be committed to version control.Start PostgreSQL and Phoenix with Docker
From the project root directory (not inside Wait until both containers are Healthy, not just Running. You can check status with:PostgreSQL has a built-in health check (
backend/ or frontend/), start the database and observability containers:pg_isready) that confirms it is accepting connections. Allow 5–10 seconds after the up command before proceeding.Install Python dependencies and start the backend
Create a virtual environment, install all dependencies, and launch the FastAPI server:On first start, SQLAlchemy automatically creates all required tables in PostgreSQL — no manual migrations needed. You will see log lines confirming this:The following tables are created automatically:
Leave this terminal running. Open a new terminal for the next step.
| Table | Description |
|---|---|
conversations | Chat session history (IDs and auto-generated titles) |
messages | Individual messages, RAG sources, and Base64 image attachments |
oportunidades | CRM opportunity records written by the Action Agent |
audit_logs | Per-request telemetry: intent, agents invoked, latency |
Ingest documents into ChromaDB
In a new terminal (with the backend still running in the previous one), run the ingestion script from the This script reads the three knowledge-base documents from
The script clears existing collections before re-indexing, so you can safely re-run it if you update the source documents.
backend/ directory:data/raw/, splits them into chunks, generates embeddings via Gemini, and stores each document in its own ChromaDB collection:| Document | ChromaDB Collection |
|---|---|
01_Catalogo_Productos_Precios.txt | col_catalogo |
02_Politicas_Comerciales_Descuentos_Credito.txt | col_politicas |
03_Proceso_Ventas_CRM.txt | col_proceso_ventas |
Start the frontend
In a third terminal, install Node.js dependencies and start the Next.js development server:Open http://localhost:3000 in your browser. You should see the Mesa de Ayuda IA chat interface ready to use.
Active services
Once all steps are complete, the following services are running:| Service | URL | Description |
|---|---|---|
| Backend API | http://localhost:8000/docs | Interactive Swagger UI for all REST endpoints |
| Frontend UI | http://localhost:3000 | Next.js chat interface |
| Phoenix Observability | http://localhost:6006 | LangGraph traces, token usage, and per-agent latency |
| PostgreSQL | localhost:5433 | Database (accessible via any PostgreSQL client) |