AERIS-AQ is an air-quality decision-support API for operational and policy workflows.
- Accurate, source-aware air-quality responses
- Conservative health guidance for sensitive populations
- Clean failure behavior (no stack traces or internal tool leaks)
- Free-tier cold-start handling for deployments that sleep when idle
- Leaner prompt instructions for lower token cost and more stable outputs
POST /api/v1/agent/chat- primary conversational endpointPOST /api/v1/air-quality/query- structured multi-source air data queryGET /api/v1/sessions- list sessionsPOST /api/v1/sessions/new- create sessionGET /api/v1/sessions/{session_id}- session detailsDELETE /api/v1/sessions/{session_id}- delete sessionGET /health- liveness + startup metadataGET /health/detailed- component health and metricsGET /health/readiness- readiness gate for free-tier warmup
If your deployment sleeps during inactivity (for example free Render), enable:
FREE_TIER_DEPLOYMENT=true
COLD_START_WAIT_SECONDS=50Behavior:
- During warmup,
POST /api/v1/agent/chatreturns503with:status: warming_upmessageexplaining the server is waking upretry_afterseconds
GET /health/readinessreturns503until warmup window ends.- Database and timeout handlers include a cold-start hint when applicable.
python -m venv .venv
. .venv/Scripts/activate # Windows PowerShell
pip install -r requirements.txt
copy .env.example .env
python -m uvicorn interfaces.rest_api.main:app --host 0.0.0.0 --port 8000Open docs at http://localhost:8000/docs.
Required/important settings:
AI_PROVIDER=gemini
AI_MODEL=gemini-1.5-flash
AI_API_KEY=...
DATABASE_URL=sqlite:///./data/chat_sessions.db
ENABLED_DATA_SOURCES=waqi,airqo,openmeteo,carbon_intensity,defra,uba,nsw
FREE_TIER_DEPLOYMENT=false
COLD_START_WAIT_SECONDS=50- Treat outputs as decision support, not a medical diagnosis.
- For high-risk alerts, always include local authority validation paths in your frontend/workflow.
- Monitor
/health/detailedand/metricsin production. - Keep API keys and secrets out of client applications.
pytest -qRun before deployment after config or prompt changes.
interfaces/rest_api/- API routes and app bootstrapdomain/services/- core agent orchestrationcore/memory/prompts/- system instruction builderinfrastructure/api/- external provider integrationsshared/config/- settings and environment handlingtests/- integration and behavior tests