File size: 5,258 Bytes
6b559f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4821868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6b559f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# IDEAS.md β€” HopeV1.0 Future Ideas

Ideas to explore and implement when time permits.
Add new ideas here during conversations so nothing gets lost.

---

## TTS & Voice

- [ ] **Try ElevenLabs voice** β€” "Sarah" or "Aria" voice sounds like a real teacher. 
  Free tier: 10K chars/month. Paid: $5/month for 30K chars. Best quality available.
  Integration: replace `kokoro_tts_to_wav()` with ElevenLabs API call.

- [ ] **Try OpenAI TTS "nova" voice** β€” Very natural, warm. Pay-per-use ($0.015/1K chars).
  Good middle ground between Kokoro (free) and ElevenLabs (best).

- [ ] **Emotion-aware TTS** β€” Detect if the LLM reply is praise vs. question vs. correction,
  and adjust TTS speed/tone accordingly. Kokoro supports speed tuning per-segment.

- [ ] **Child voice profiles** β€” Let teacher set age group (5–7, 8–10, 10–12) which adjusts
  story complexity, question difficulty, and TTS speed automatically.

---

## Stories & Content

- [ ] **Story library expansion** β€” Currently 7 hardcoded stories. Load stories from a
  JSON/CSV file so teachers can add new ones without touching code.

- [ ] **Grade-level tagging** β€” Tag each story with difficulty level so the bot can pick
  an appropriate story based on student's grade.

- [ ] **Curriculum alignment** β€” Align stories and questions to specific English curriculum
  standards (e.g., CBSE, ICSE).

- [ ] **Multi-language support** — Whisper already supports Hindi→English translation.
  Could add regional language greetings/encouragement while keeping English content.

---

## Session & Pedagogy

- [ ] **Grammar correction mode (2 phases)**
  Phase 1 (current): Bot is encouraging only. Does NOT correct grammar.
  Phase 2 (future): After N sessions or when confidence is high, bot identifies grammatical
  errors in the student's speech and gently asks them to repeat correctly.

  **Important implementation note:** Whisper (ASR) transcribes speech as-is and does NOT
  auto-correct grammar β€” it faithfully passes through mistakes (e.g. "I goed to school"
  stays as-is). This is correct behaviour. The Qwen LLM is what should identify errors.
  The `fixed_prompt` in `coach_core.py` controls this β€” currently it says nothing about
  grammar correction.

  To implement Phase 2: add a `correction_mode: bool` flag to session state, and modify
  the per-session user message to instruct Qwen to gently point out one grammar mistake
  per turn and ask for a repeat.

- [ ] **Adaptive questioning** β€” If child answers incorrectly, ask a simpler follow-up
  instead of moving to the next question. Requires tracking answer quality in state.

- [ ] **Progress tracking** β€” Save session history per phone number (story read,
  questions asked, accuracy, date). Expose a teacher dashboard.

- [ ] **Pronunciation feedback** β€” Use Whisper confidence scores to detect when a child
  is struggling to pronounce words and gently correct.

- [ ] **Session summary to teacher** β€” At end of session, send a WhatsApp text summary
  to a teacher's number: "Student answered 2/3 questions correctly. Story: Hare & Turtle."

---

## Infrastructure

- [ ] **Move bridge to Railway.app** *(HIGH PRIORITY β€” planned)*
  Current HuggingFace bridge has intermittent SSL issues with Meta's API and
  goes to sleep on free tier. Railway.app fixes both:
  - No outbound SSL issues
  - Always-on (no sleep)
  - Cost: ~$0.50/month (well within $5 free credit)
  Steps:
  1. Push `hope-whatsapp-bridge` to GitHub repo
  2. Connect to Railway β†’ Deploy from GitHub
  3. Add env vars: VERIFY_TOKEN, WHATSAPP_TOKEN, PHONE_NUMBER_ID, GPU_SERVER_URL, HF_TOKEN
  4. Get Railway domain β†’ update Meta webhook URL
  5. Revert `send_audio()` to direct upload method (no link workaround needed)
  6. Remove `/audio/{filename}` serve endpoint (no longer needed)

- [ ] **Persistent session storage** β€” Current sessions saved to `/tmp/` which is lost
  on Space restart. Use HuggingFace dataset repo or a small SQLite DB on a
  persistent volume for session state.

- [ ] **Gradio Space upgrade** β€” Currently on Gradio 4.36.1; latest is 4.44+. Upgrade
  carefully β€” check that `api_name="whatsapp"` still works after upgrade.

- [ ] **WhatsApp message queueing** β€” If GPU server is busy, queue incoming messages
  and process in order. Currently parallel requests can conflict.

---

## Meta / WhatsApp

- [ ] **Permanent WhatsApp token** β€” Move from temporary 24h token to permanent
  System User token via Meta Business Settings. (See CLAUDE.md for steps.)

- [ ] **Meta Business Verification** β€” Required to message any user (not just test numbers).
  Allows real students to start sessions by messaging the number.
  Submit at: business.facebook.com β†’ Business Verification.

- [ ] **WhatsApp template messages** β€” For business-initiated conversations (bot starts
  the session, not the student), need approved message templates from Meta.

---

## UI / Admin

- [ ] **Teacher web dashboard** β€” Simple web UI to: view active sessions, see transcripts,
  add new stories, adjust number of questions per story.

- [ ] **QR code onboarding** β€” Generate a WhatsApp QR code that students can scan to
  start their first session automatically (sends "start" on their behalf).