Add sleep-quality-tracker ability: personalised sleep coaching with habit correlation - #357
Conversation
…abit correlation and weekly pattern insights
🔀 Branch Merge CheckPR direction: ✅ Passed — |
✅ Community PR Path Check — PassedAll changed files are inside the |
✅ Ability Validation Passed |
🔍 Lint Results🔧 Formatting fixes availableThis PR is from a fork, so fixes could not be pushed automatically. Download the git apply autofix.patch✅
|
uzair401
left a comment
There was a problem hiding this comment.
Hey @hassan1731996, I hope you are doing great. The ability idea is great, I'd just like you to make a couple of improvements to it.
Right now main.py asks the user for their name and other details every time it's triggered. A lot of that can come from the platform profile the memory system already maintains. It keeps user_profile.md and user_summary.md in persistent storage, so you can read them with read_file("user_profile.md", in_ability_directory=False) (and user_summary.md) and pull the name and context from there, only falling back to asking if they're empty. Just read them, don't write to them, they're platform owned. There's more on this in docs/Agent-Memory-and-Context-Injection.md.
On top of that, you can pick up the user's sleep data by catching it in normal conversation, the way you did in your other abilities, instead of a fixed question flow. That would automate the data gathering and save the user the manual back and forth.
Thanks!
…nd collapse morning check-in
- Read user name from user_profile.md / user_summary.md on first run; only
ask if platform profile is empty
- Collapse 3-question morning check-in to one open question ('How'd you
sleep?') with LLM extracting hours, quality, and notes from the natural
reply; add single targeted follow-up only when hours are genuinely absent
Summary
What makes it unique vs Alexa
Alexa forgets every morning. This ability builds a personal pattern database across weeks and surfaces correlations that are literally impossible without persistent memory — the longer you use it, the more personalised the insights become.
Trigger phrases
"how did I sleep","sleep check-in","log my sleep","sleep report","sleep patterns","tips for tonight","evening habits", and moreSDK patterns applied
create_key-first storage withsuccesscheckbackground_daemon_modeset beforeCapabilityWorkerin daemoncall()while Trueloop for multi-turn follow-upsTest plan
"how did I sleep"→ 3-question check-in → logged + insight spoken"sleep report"with <2 nights → "not enough data yet""sleep report"with 5+ nights → summary + LLM correlation"evening habits"→ 4-question flow → saved to today's entry"tips for tonight"→ personalised tip spokenvalidate_ability.pypasses (exit 0)