This page covers the most common issues encountered when running Mesa de Ayuda IA locally. The system has several moving parts — Docker containers, a Python virtual environment, ChromaDB on disk, and a Next.js frontend — that must start in the correct order and be configured consistently. Most errors fall into one of the categories below.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.
Error connecting to PostgreSQL on backend startup
Error connecting to PostgreSQL on backend startup
Symptom: The backend fails to start with a message such as
could not connect to server or connection refused on port 5433.Cause: The Docker PostgreSQL container has been started but has not yet finished initializing. Docker reports the container as “running” before the database process inside it is ready to accept connections.Solution:- Start only the infrastructure containers first, and wait for them to reach the healthy state:
- Confirm the
postgrescontainer is healthy before proceeding:TheSTATUScolumn should showhealthy, not justrunning. The healthcheck runspg_isreadyevery 5 seconds with up to 5 retries, so allow 10–30 seconds afterdocker-compose up. - Only then start the backend:
The
docker-compose.yml configures a healthcheck on the postgres service using pg_isready -U mesa_ayuda_user -d mesa_ayuda_db. If you see repeated restarts, check Docker Desktop logs for the mesa_ayuda_db container for initialization errors.Error 429 from Gemini (Rate Limit Exceeded)
Error 429 from Gemini (Rate Limit Exceeded)
Symptom: Agent responses fail with an error like
429 Resource has been exhausted or RESOURCE_EXHAUSTED: Quota exceeded for quota metric.Cause: The Google AI Studio free tier is limited to 15 requests per minute (RPM). Mesa de Ayuda IA uses LangGraph, which fires multiple sequential Gemini API calls for a single chat message:- 1 call for the classifier node (intent detection)
- 1 call per agent node invoked (up to 3 for mixed-intent queries)
- 1 call for the consolidator node (if multiple agents ran)
- For local testing: Wait 10–15 seconds between chat messages. This gives the RPM counter time to reset before the next multi-call chain.
- For production: Upgrade to a paid Gemini API tier, which offers significantly higher RPM quotas and removes the 15 RPM cap.
- For load testing: Use
scripts/test_production.pywith atime.sleep()between calls to simulate realistic pacing without triggering rate limits.
Error: 'This model is no longer available'
Error: 'This model is no longer available'
Symptom: The backend starts but all chat requests fail with an error such as Using the
404 models/gemini-1.5-flash is no longer available or This model version has been deprecated.Cause: The LLM_MODEL_NAME in your .env (or its default in app/config.py) points to a deprecated Gemini model name. Google periodically retires specific model versions and replaces them with newer ones or stable aliases.Solution:Open backend/.env and set the model to the latest stable alias:-latest suffix ensures the backend always resolves to the most recent non-deprecated version of that model family without requiring a manual .env update every time Google releases a new version.Restart the backend after saving .env:Error: 'collection not found' in ChromaDB
Error: 'collection not found' in ChromaDB
Symptom: Chat requests fail with The script will:
Collection col_catalogo not found (or col_politicas / col_proceso_ventas). The backend starts without errors, but the first message returns an exception.Cause: The ChromaDB vector collections have not been populated. The data/chroma_db/ directory is either empty or does not exist because scripts/ingest.py was never run.Solution:Run the ingestion script from the backend/ directory with the virtual environment activated and GOOGLE_API_KEY set in .env:- Load the three knowledge-base documents from
data/raw/ - Split them into chunks using
RecursiveCharacterTextSplitter - Generate embeddings with
GoogleGenerativeAIEmbeddings(models/gemini-embedding-001) - Persist three separate collections to
data/chroma_db/:col_catalogo,col_politicas, andcol_proceso_ventas
Frontend cannot connect to the backend (API errors in the browser)
Frontend cannot connect to the backend (API errors in the browser)
Symptom: The Next.js UI loads at
http://localhost:3000 but chat messages fail with network errors, CORS errors in the browser console, or the frontend shows “could not reach the server”.Cause: Either the backend is not running on port 8000, or the CORS middleware is not configured to allow requests from http://localhost:3000.Solution:-
Confirm the backend is running:
You should receive a
200 OKresponse. If not, start the backend first. -
Check that CORS is configured correctly. In
app/main.py, the allowed origins are hardcoded tohttp://localhost:3000:If you are serving the frontend from a different port or domain, updateallow_originsaccordingly or add aCORS_ORIGINSenv var and wire it into the middleware configuration. -
When running via
docker-compose, the frontend container usesNEXT_PUBLIC_API_BASE_URL=http://localhost:8000/api/v1. Ensure this variable is set correctly indocker-compose.ymlor the frontend’s.env.local.
SQLite fallback is active instead of PostgreSQL
SQLite fallback is active instead of PostgreSQL
Symptom: The backend logs a warning like
Falling back to SQLite at startup, or conversation history is lost after restarting the backend. The PostgreSQL audit_logs table appears empty when queried directly.Cause: The backend includes a fallback mechanism that switches to a local SQLite database if the PostgreSQL container is not reachable or if DATABASE_URL is misconfigured. This is intentional for resilience, but it means audit records and conversation history are written to a local file rather than PostgreSQL.Solution:- Start the PostgreSQL container:
- Verify the
DATABASE_URLinbackend/.envmatches the credentials indocker-compose.yml:Note the non-standard port 5433 — the container maps5433on the host to5432inside Docker. - Restart the backend. On a successful connection you should see a structlog line confirming that SQLAlchemy created the tables in PostgreSQL.
Backend starts but agents return 'could not connect to ChromaDB'
Backend starts but agents return 'could not connect to ChromaDB'
Symptom: The backend starts cleanly and accepts requests, but every chat response fails with a ChromaDB path error or Alternatively, set After correcting the working directory or path, run
no such file or directory for data/chroma_db/.Cause: The CHROMA_PERSIST_DIR setting defaults to the relative path data/chroma_db/. This path is resolved relative to whichever directory uvicorn was launched from. If you start uvicorn from the repository root instead of from backend/, Python resolves the path as ./data/chroma_db/ relative to the root, which does not exist.Solution:Always start uvicorn from inside the backend/ directory:CHROMA_PERSIST_DIR to an absolute path in backend/.env:python scripts/ingest.py from within backend/ to ensure the collections are written to the correct location.Getting Help
If you encounter an issue not covered above, please open a GitHub issue in the project repository. Include:- The exact error message and stack trace from the backend terminal
- The output of
docker-compose ps(to confirm container health states) - The relevant section of your
backend/.env(withGOOGLE_API_KEYredacted) - The steps you followed before the error occurred