Get Learning Signals
get_learning_signalsRetrieve a student's behavioral signals to determine what to show next: momentum state, seen content, and recommended interaction type.
Instructions
Retrieve behavioral signals that inform what Coach should show a student next.
Composes data from two sources: Supabase (profiles.routing_signals, for already-seen content) and Firestore (last activity timestamp, for momentum). Returns translated behavioral labels only — never raw dormancy-decay scores or internal routing fields. This mirrors the translation Coach already does internally via behaviorLabels.ts.
Args:
student_id (string): The student's unique identifier.
Returns: JSON object with schema: { "studentId": string, "momentumState": "building" | "steady" | "dormant" | "returning", "seenContentIds": string[], // content already shown, for dedup "daysSinceLastSession": number, "recommendedInteractionType": "read" | "decide" | "reflect" }
Examples:
Use when: "What should Coach show this student right now?" -> check recommendedInteractionType and filter coachContent.ts by seenContentIds
Use when: deciding whether to show comeback/re-engagement copy -> check momentumState === "returning"
Error Handling:
A student with no activity history returns momentumState: "dormant" and daysSinceLastSession: 999 (sentinel for "never active"), not an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| student_id | Yes | The student's unique identifier (Firebase Auth UID / Supabase user_id — these are the same value across both systems). |