AI Platform Pipeline
Responsibility
dmind-aiservice-aicontroller owns the prediction lifecycle used by Prescreening and IVR. It accepts text, audio, video, or choice answers; coordinates conversion, transcription, depression scoring, and GPT classification; persists partial state; and exposes a single polled result.
Production-v2 is currently running controller image dmind-ai-service-ai-controller:v1.2.0 in AWS account 564141170168, region ap-southeast-1.
End-to-end flow
Media conversion is synchronous from the controller's perspective: it uploads the source, calls the converter, and enqueues the converted key only after conversion completes. The ASR implementations are competing consumers of one FIFO; the controller does not select an implementation for each message.
Public and worker-facing APIs
| Route | Role |
|---|---|
POST /prediction | Creates a versioned prediction with interview_id, interview_source, and method type. |
POST /submit-answer | Accepts one text/media answer. Media is stored and transcribed; text can immediately unlock downstream tasks. |
POST /submit-multiple-answers | Accepts the choice-method answers and performs configured score/action calculation. |
GET /result?prediction_id=... | Returns PROCESSING until every required result for the selected method is complete, then returns FINISH. |
POST /predictions/text | Internal callback for a completed transcript. |
POST /predictions/result | Internal callback for DSC/GPT result fragments. |
GET /question-path | Returns the configured question path for a service version and method. |
The production workers normally use the result FIFO queue instead of calling the internal callback routes directly. The controller consumer reads message attribute type and dispatches store_text or save_result.
Although request binding permits an omitted type, clients using result format 1_1_0 or 1_2_0 require TEXT, AUDIO, VIDEO, or CHOICE; without a method the prediction cannot reach FINISH. CHOICE routes, bundle entries, and result fields remain for compatibility, but the current Prescreening and IVR journeys do not select that method.
Version routing
The requested service version is a compatibility bundle, not only a response label.
| Service version | Question path | Result format | ASR | OpenAI | DSC | Choice calculation |
|---|---|---|---|---|---|---|
1_0_0 | 1_0_0 | 1_0_0 | 1_0_0 | 1_0_0 | 1_0_0 | none |
1_0_1 | 1_0_0 | 1_0_0 | 1_0_1 | 1_0_0 | 1_0_0 | none |
1_1_0 | 1_1_0 | 1_1_0 | 1_0_1 | 1_0_0 | 1_0_0 | 1_0_0 |
1_2_0 | 1_1_0 | 1_2_0 | 1_0_1 | 1_0_0 | 1_0_0 | 1_0_0 |
Changing a dependency mapping changes existing clients that request that service version; an incompatible mapping is represented by a new bundle.
Task triggering
After a transcript is stored, the controller checks whether all answers required by each task have TRANSCRIBE_SUCCESS status.
| Task | Required input | Output |
|---|---|---|
openai_two_q_plus_sad | qs-01-02 | sadness flag and sad chief-complaint terms |
openai_two_q_plus_boredom | qs-03, qs-03-04-01, qs-03-04-02 | boredom flag |
openai_two_q_plus_suicidal_thought | qs-07-01 | suicidal-thought flag |
openai_suicidal_severity | qs-07-03 | suicidal severity, rank, and detail |
dsc_depression_rank | all configured narrative answers | depression rank |
choice_calculation | configured qsc-* choices | two-question flags, depression.rank_choice, depression.level, and suicidal.rank for configured severe choices; it does not populate suicidal.severity |
The result format derives depression level from configured outputs and reports FINISH only after every method-required result is successful.
Active versus retained implementations
- The Go worker
dmind-aiservice-openai-gpt-golangis the current production-v2 GPT consumer. - The production-v2 Python GPT service definitions are retained but not running;
dmind-aiservice-openai-gpt-pythonremains a compatibility-era implementation. - The current converter is an ECS service behind an internal ALB.
lambda-media-convertis the earlier Lambda implementation and is not in this runtime path. global-asr-serviceis a separate service. The controller production-v2 path uses the DMIND-specific ASR FIFO and its competing workers.