Sessions
List Sessions
/api/chat/sessions
List chat sessions with optional filters.
Query Parameters
Filter by user UUID
Filter by node UUID
Response
Create Session
/api/chat/sessions
Create a new chat session for learning a subconcept.
Body Parameters
User UUID
Subconcept node UUID
201 Created
End Session
PATCH/api/chat/sessions/:id
End a chat session.
Body Parameters
ISO 8601 timestamp (defaults to current time)
Messages
List Messages
GET/api/chat/sessions/:sessionId/messages
Retrieve all messages in a session, ordered by creation time.
Message UUID
Session UUID
User UUID
system, user, or assistantlearning, hint_request, hint_response, or evaluationMessage content
Exercise success indicator
JSON metadata about success
ISO 8601 timestamp
Create Message
POST/api/chat/sessions/:sessionId/messages
Manually create a message (rarely used - prefer the tutor endpoint).
Interactive Tutor
/api/chat/sessions/:sessionId/tutor
Interactive tutoring - send student message, receive AI tutor response.
Flow
- Start: Send empty
contentto begin the session - Teach: Tutor explains a chunk and asks a question
- Answer: Student responds with
[ANSWER]prefix - Evaluate: Tutor evaluates, gives feedback, moves to next chunk
- Complete: Session auto-ends when all chunks are covered
Body Parameters
User UUID
Student message content:
- Empty string: Start session
[ANSWER] ...: Answer to checkpoint question[CLARIFICATION] ...: Request hint/clarification
Data URL for drawing answer (for
draw question type):
data:image/png;base64,... or data:image/jpeg;base64,...Response
Tutor’s response (includes explanation, question, and question type)
Whether the subconcept is fully taught (session auto-ends if true)
List of tools the tutor called (e.g.,
["generate_example", "create_exercise"])Array of reasoning steps from the tutor agent
Tutor Tools
The tutor has access to these tools:check_student_progress- Load diagnostic results for parent conceptcheck_prerequisite_mastery- Check if prerequisites are masteredgenerate_example- Create a worked examplecreate_exercise- Create a practice problemvisualize_concept- Create an ASCII/text diagramrecord_exercise_result- Persist exercise attempt + update mastery score
Hints
Create Hint Event
/api/chat/hints
Record a hint request event.
Body Parameters
User UUID
Node UUID
Session UUID
Request message UUID
Response message UUID
Array of message UUIDs referenced in the hint
List Hints
GET/api/chat/hints?userId=USER_ID&nodeId=NODE_ID
Retrieve hint events with optional filters.
Message Kinds
Normal tutoring exchange
Student requested clarification (
[CLARIFICATION])Tutor’s clarification response
Student’s answer to a checkpoint question (
[ANSWER])Question Types
The tutor can ask three types of questions:Text-based answer expected
Code or pseudocode expected
Drawing/diagram expected (submit via
drawingImageDataUrl)