Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sdarionicolas-boop/AgroIA-RAG/llms.txt

Use this file to discover all available pages before exploring further.

AgroIA uses pydantic-settings to load configuration from a config/.env file at startup. The Settings class in src/utils/config.py defines every supported variable with its type and default value. All variable names are case-insensitive, so DB_HOST and db_host are treated identically. Variables not defined in the class are silently ignored.

Initial setup

1

Copy the example file

cp config/.env.example config/.env
2

Fill in your credentials

Open config/.env in your editor and set at minimum DB_PASSWORD, GEE_PROJECT_ID, and INGESTA_SECRET_KEY.
3

Verify the configuration loads

python -c "from src.utils.config import settings; print(settings.db_host)"
Never commit config/.env to version control. It contains database passwords and API keys. Ensure it is listed in .gitignore.

Database variables

body.DB_HOST
string
default:"localhost"
Hostname or IP address of the PostgreSQL server. When running inside Docker Compose, this value is automatically overridden to host.docker.internal by the service environment block.
body.DB_PORT
number
default:"5432"
TCP port on which PostgreSQL is listening.
body.DB_NAME
string
default:"agri_db"
Name of the PostgreSQL database that holds the informes_lotes and lote_historial tables.
body.DB_USER
string
default:"agri_user"
PostgreSQL role used to connect. Must have CREATE TABLE, INSERT, UPDATE, and SELECT privileges on the target database.
body.DB_PASSWORD
string
required
Password for DB_USER. There is no default — the application will fail to connect if this is left empty.
Docker Compose overrides DB_HOST to host.docker.internal for the api and streamlit services, so the containers can reach a PostgreSQL instance running on the host machine. You do not need to change this variable manually when using Compose.

Google Earth Engine

body.GEE_PROJECT_ID
string
required
Google Cloud project ID registered for Earth Engine access. Used by src/pipeline/gee_extractor.py to call ee.Initialize(project=...). Without this value the pipeline cannot retrieve Sentinel-2 imagery.

API authentication

body.INGESTA_SECRET_KEY
string
required
Bearer token required to call the /ingesta and /ingesta/geojson endpoints. Set this to a long, random string and share it only with trusted clients.

Ollama variables

body.OLLAMA_URL
string
default:"http://localhost:11434"
Base URL of the Ollama HTTP server. When running inside Docker Compose, this is automatically overridden to http://host.docker.internal:11434 so containers can reach Ollama on the host.
body.EMBEDDING_MODEL
string
default:"nomic-embed-text"
Ollama model name used to generate 768-dimensional embeddings. Must match the dimensionality of the embedding column in informes_lotes (vector(768)). See AI model setup for details.
body.GENERATION_MODEL
string
default:"gemma3:4b"
Ollama model name used for RAG generation (the agronomic expert LLM). See AI model setup for details.

Optional integrations

body.TELEGRAM_TOKEN
string
Bot token from @BotFather on Telegram. Maps to the telegram_token field in src/utils/config.py. Required only when running python start.py --bot. If left empty the rest of the system starts normally. See Telegram bot guide for setup instructions.

Docker Compose overrides

When you start AgroIA with docker-compose up, the api and streamlit services override two variables regardless of what is set in config/.env:
VariableOverridden valueReason
DB_HOSThost.docker.internalReach host-machine PostgreSQL from inside the container
OLLAMA_URLhttp://host.docker.internal:11434Reach host-machine Ollama from inside the container
All other variables are read directly from config/.env via the env_file directive.

Build docs developers (and LLMs) love