Skip to content

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 ​

RouteRole
POST /predictionCreates a versioned prediction with interview_id, interview_source, and method type.
POST /submit-answerAccepts one text/media answer. Media is stored and transcribed; text can immediately unlock downstream tasks.
POST /submit-multiple-answersAccepts 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/textInternal callback for a completed transcript.
POST /predictions/resultInternal callback for DSC/GPT result fragments.
GET /question-pathReturns 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 versionQuestion pathResult formatASROpenAIDSCChoice calculation
1_0_01_0_01_0_01_0_01_0_01_0_0none
1_0_11_0_01_0_01_0_11_0_01_0_0none
1_1_01_1_01_1_01_0_11_0_01_0_01_0_0
1_2_01_1_01_2_01_0_11_0_01_0_01_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.

TaskRequired inputOutput
openai_two_q_plus_sadqs-01-02sadness flag and sad chief-complaint terms
openai_two_q_plus_boredomqs-03, qs-03-04-01, qs-03-04-02boredom flag
openai_two_q_plus_suicidal_thoughtqs-07-01suicidal-thought flag
openai_suicidal_severityqs-07-03suicidal severity, rank, and detail
dsc_depression_rankall configured narrative answersdepression rank
choice_calculationconfigured qsc-* choicestwo-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-golang is the current production-v2 GPT consumer.
  • The production-v2 Python GPT service definitions are retained but not running; dmind-aiservice-openai-gpt-python remains a compatibility-era implementation.
  • The current converter is an ECS service behind an internal ALB. lambda-media-convert is the earlier Lambda implementation and is not in this runtime path.
  • global-asr-service is a separate service. The controller production-v2 path uses the DMIND-specific ASR FIFO and its competing workers.