IVR Data and Integrations
MongoDB collection
The configured dmind-ivr MongoDB database contains one application collection: interview.
Important embedded structures:
result_ai.two_q_plus:sad,boredom, andsuicidal_thoughtbooleans.result_ai.suicidal: score, level, and display detail.result_ai.chief_complaint.sad: classified complaint terms.timestamps[]: call step, optional choice, and client-provided timestamp.
The recent-severe query filters phone_number and created_at >= now - 1 day, sorted newest first.
Redis session
Key pattern: session:<session_id>.
The JSON value contains:
| Field | Purpose |
|---|---|
interview_id | Mongo interview _id. |
prediction_id | AI controller prediction UUID. |
final_question_submitted | UTC timestamp used for AI-duration measurement. |
timestamp_count | Per-session call-progress counter used by rate limiting. |
Redis loss expires active sessions and prevents subsequent authenticated route calls, but durable Mongo records remain.
External dependencies
| Dependency | Direction | Contract |
|---|---|---|
| IVR caller application | Inbound | Sends access key, stable session_id, call timestamps, MP3 answers, and result polling. |
| AI controller | Outbound | /prediction, /submit-answer, and /result. Open the AI pipeline →. |
| MongoDB Atlas | Read/write | Durable interview, call-progress, fallback, AI-result, and feedback data. |
| ElastiCache Redis | Read/write | Active session-to-interview/prediction mapping and TTL state. |
| CloudWatch Metrics | Write | Buffered RESPONSE_COUNT and AI_DURATION metrics. |
| CloudWatch Logs | Write | Structured application and request logs from ECS. |