Intent Detection and Flow Management Challenge
Objective:
Create a service that classifies user messages, manages conversation flows and maintains context. The service should handle general interactions, FAQ requests, and responses to suicide risk.
You can use fixed responses or integrate with an AI model like GPT.
Flows Types:
- Normal Flow - General mental health support and conversations.
- Check-In Flow - Mood check-in initiated by the system.
Requirements:
-
Intent Detection:
- Classify incoming messages as either FAQ, Suicide Risk, or normal messages.
- For FAQ, provide responses based on Clare's FAQ page.
- For Suicide Risk, respond with a sensitive message and then continue with the previous flow (Normal or Check-In).
-
Flow Management:
- Normal Flow: Initiated by the user and manages general interactions and support.
- Check-In Flow: Initiated by the system (e.g., "How are you doing today?"). Classify the user’s response:
If FAQ or Suicide Risk: Handle accordingly.
Otherwise: Continue with Check-In Flow or Normal Flow based on the current flow.
-
API Endpoints:
- POST /sendMessage: Classify messages and handle flows.
- POST /initiateCheckIn: Start a Check-In Flow and set context.
- GET /retrieveContext: Get the current context for a user.
- POST /updateContext: Update context in Redis.
- Secure endpoints with any authentication method you choose.
-
Data Storage: Use Redis to manage the state of the conversation and its context.
-
Testing: Provide unit and integration tests for your code
Technical Requirements:
- Tech Stack: Node.js with TypeScript, Redis.
- Security: Any authentication method.
- Testing: Use Jest.
- Deployment: Dockerize the app.
Bonus (Optional):