# AI Service Technical AI job service for Portal workloads. The first version owns only AI job lifecycle and metrics. Business data stays in domain services such as `telephony`, `monitoring-tg` and `monitoring-pf`. ## API - `POST /api/v1/jobs` creates one job. - `POST /api/v1/jobs/batch` creates many jobs with shared defaults. - `GET /api/v1/jobs/{id}` returns technical job state and result. - `POST /api/v1/jobs/{id}/retry` resets failed/running jobs to `pending`. - `GET /api/v1/stats` returns queue and error counters. - `GET /healthz` returns process health. - `GET /readyz` checks PostgreSQL readiness. ## Configuration - `HTTP_HOST`, default `0.0.0.0` - `HTTP_PORT`, default `8080` - `DATABASE_URL`, required - `MIGRATE_ON_START`, default `true` ## Next integration step `telephony` should first mirror low-risk analysis jobs into this service while continuing local processing. Remote execution can then be enabled by feature flag per task type.