The system can be deployed in two ways: Docker Compose (recommended for production and staging) or bare-metal Python (recommended for development or environments where Docker is unavailable). Both modes expose the FastAPI application on portDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/gcapella0/agente-inteligente-expedientes/llms.txt
Use this file to discover all available pages before exploring further.
8000.
- Docker Compose
- Bare Metal
Docker Compose deployment
Docker Compose is the recommended production deployment method. The provideddocker-compose.yml runs a single container (agente-expedientes) and connects to MongoDB and Ollama running directly on the host — they are intentionally kept outside the container network for simpler data management and persistence.Prerequisites
- Docker Engine 24+ and Docker Compose v2
- MongoDB 6+ running on the host at port
27017 - An active internet connection (for pulling the base image and OpenRouter calls), or Ollama running on the host at port
11434for local LLM inference
Ghostscript (used for PDF compression by StorageAgent) is included in the Docker image — you do not need to install it on the host for Docker deployments.
docker-compose.yml overview
env_file: .envloads your full configuration. Theenvironmentblock then overridesMONGO_URItomongodb://host.docker.internal:27017— no manual adjustment toMONGO_URIis needed for single-server deployments.OLLAMA_HOSTin theenvironmentblock is present for reference but is not read by the application code —OllamaProviderreadsOLLAMA_BASE_URLfromsrc/config.py. If using Ollama, setOLLAMA_BASE_URL=http://host.docker.internal:11434in your.envfile directly, or update it at runtime viaPUT /config/llm.extra_hosts: host.docker.internal:host-gatewaymakes the host machine reachable from inside the container athost.docker.internalon both Linux and macOS/Windows.- Volumes
./dataand./logsare bind-mounted so document files and logs persist outside the container lifecycle. restart: unless-stoppedensures the service restarts automatically after host reboots.
Deploy steps
Configure environment variables
.env and set at minimum:JWT_SECRET_KEY— change from the default placeholderMAIL_USERandMAIL_PASS— your IMAP credentialsOPENROUTER_API_KEY— if using OpenRouter, or setLLM_PROVIDER=ollamafor local inference
Create data and log directories
Dockerfile also creates them inside the image as a fallback.Build the image
pip install -r requirements.txt. Subsequent builds are fast thanks to Docker layer caching.Operations commands
Verification
After starting the service by either method, confirm it is healthy:| URL | Description |
|---|---|
http://localhost:8000/ui | Web UI — login with admin@uneg.edu.ve / admin123 |
http://localhost:8000/docs | Interactive Swagger / OpenAPI documentation |
GET http://localhost:8000/info | Returns API version, total endpoint count, and enabled capabilities |
Security checklist
Before exposing the service to any network beyondlocalhost, complete the following:
-
Change
JWT_SECRET_KEY— replace the defaultcambiar-en-produccion-clave-larga-y-complejawith a cryptographically random value: -
Change the admin password — the default
admin123is hardcoded as the first-run seed. Log in to the web UI at/uior callPOST /auth/change-passwordto update it immediately. -
Restrict CORS origins —
src/api/main.pycurrently allowshttp://localhost:3000andhttp://localhost:8080as CORS origins. For production, update theallow_originslist to your actual frontend domain(s) only. -
Use HTTPS — place the service behind a reverse proxy (nginx or Caddy) that terminates TLS. Never expose port
8000directly to the internet over plain HTTP. -
Protect MongoDB — enable MongoDB authentication and use credentials in
MONGO_URI(e.g.,mongodb://user:password@host:27017/expedientes_uneg). Ensure MongoDB is not exposed on a public interface.