Run a full study session — observe, predict, and practice in one flow
Run a complete learning loop.
Ensure Screenpipe is running. If not, start it:
curl -s http://localhost:3030/health 2>/dev/null || (npx screenpipe@latest record > /dev/null 2>&1 & sleep 5)
Use the screenpipe MCP tools to check what the user has been doing in the last hour. Summarize the learning-relevant content.
For each learning-relevant observation, POST a screen_capture event to the Cognition API:
TOKEN=$(cat ~/.cognition/token)
curl -s -X POST -H "x-api-key: $TOKEN" -H "Content-Type: application/json" \
https://cognition-api.fly.dev/v1/events \
-d '{ "event": { ... screen_capture event ... } }'
Use the event schema from llms.txt. Generate proper UUIDs for event_id and idempotency_key.
Fetch recommendations and learner state. Show the user what's decaying.
Get the world model plan for optimal intervention:
curl -s -X POST -H "x-api-key: $TOKEN" \
"https://cognition-api.fly.dev/v1/world-model/plan?user_id=USER_ID"
Check the interleaving plan for concept pairing:
curl -s -H "x-api-key: $TOKEN" \
"https://cognition-api.fly.dev/v1/interleaving/plan?user_id=USER_ID"
Based on recommendations, run 3-5 exercises:
For each question:
After all exercises, show:
Session Complete!
━━━━━━━━━━━━━━━━
Questions: 5
Correct: 4/5 (80%)
Concepts strengthened: 3
• useEffect cleanup: 43% → 68% (+25%)
• SQL JOINs: 52% → 52% (missed — review again tomorrow)
• Git rebase: 61% → 78% (+17%)
Next session recommended: tomorrow at 2pm
Record a session_event (type: "end") to close the session.