Inspiration

The idea for Digital Twin comes from watching the modern student experience. Today, students face constant pressure to perform, which often harms their mental health. Issues like burnout, anxiety, and lack of motivation are common. Most study tools focus only on efficiency and output, ignoring emotional well-being.

I realized that students need more than just task trackers or study timers. They need a smart companion that understands their stress, motivation, and emotions. This led to the concept of Digital Twin, an AI study companion designed to support students as whole individuals, not just users who produce results.

What I Built

Digital Twin is an emotion-aware, AI-powered study companion that supports both learning and mental well-being. It uses a multi-stage intelligent system that analyzes intent, emotional state, and context before interacting with a language model. This makes the system efficient, scalable, and flexible.

At its core is an Intelligent Chat Engine that sorts messages into academic, emotional, study-related, or general categories. It uses rule-based logic with confidence scoring. A decision layer then selects the best response strategy—empathetic, supportive, motivating, or neutral—and generates context-aware prompts before calling the AI model for responses.

A key feature of the system is the Burnout Prevention System, which continuously evaluates risk based on several factors:

  • Sustained high stress
  • Declining motivation trends
  • Persistent negative mood
  • Excessive study hours
  • Poor sleep patterns

These signals combine into a burnout risk score (0–100), which triggers responses ranging from gentle break suggestions to urgent rest recommendations.

The system also tracks mood, motivation, stress, confusion, and break frequency over time. This allows for early intervention instead of just reacting to issues.

The frontend is built with React and Tailwind CSS, providing a modern, responsive interface with voice-first interaction through custom speech hooks. Users can customize their Digital Twin’s name, avatar, and voice settings. The backend is developed with Node.js, Express, and MongoDB, which includes secure authentication and cloud-based media handling.

How I Built It

The architecture centers around modular intelligence components:

  • Message classification and intent detection
  • Decision layer for choosing response strategies
  • Context and memory management
  • Dynamic prompt generation based on user state
  • Emotion, stress, and burnout analysis modules

Each interaction follows this optimized flow:

  1. Rule-based message classification (no initial LLM cost)
  2. User state retrieval
  3. Response strategy selection
  4. Loading the appropriate context window (5–50 messages)
  5. Dynamic prompt generation
  6. AI model invocation
  7. Response delivery
  8. Selective memory updates

This hybrid approach significantly reduces unnecessary AI calls while maintaining high response quality.

Challenges Faced

One major challenge was handling messages with both academic and emotional signals. I solved this by using multi-dimensional classification with confidence weighting. This approach allows the system to prioritize emotional support while still offering academic guidance.

Another challenge was balancing efficiency with intelligent behavior. By combining rule-based logic with generative AI, I reduced API usage by about 70% while keeping responses relevant and meaningful.

Detecting burnout was also tough since symptoms vary for each person. A weighted, multi-factor model helped identify burnout risk even when some signs were subtle. Managing dynamic conversation memory and recommending breaks without overwhelming users required careful tuning.

Integrating voice features also brought challenges related to browser compatibility and reliability. I addressed this by adding fallback options that switch to text input when voice features aren't available.

What I Learned

I learned how to design decision layers before calling language models. I discovered how emotional context can improve the usefulness of AI systems. I also learned about cost-effective AI system design under real-world limits, key points for building voice-first user experiences, and how to build and launch a complete system within a short timeframe.

Impact

Digital Twin shifts educational technology away from productivity-focused tools and toward holistic learning support. By identifying burnout and emotional stress early, the system helps students develop healthier study habits, supports mental well-being, and connects academic performance with personal care.

Built With

Share this project:

Updates