Skip to main content
A Hawkings tutor is a chat that knows the lesson. It has read the lesson content and the activities, and it answers in the language and tone you configure on the parent course. This guide shows you how to wire one up in ~15 lines of client code.

What you’ll build

A chat panel next to a lesson. The student types a question; the tutor streams a grounded answer; the student can keep going.

1. Start a thread

A thread is the unit of conversation. You start one per (student, activity) pair:
Persist thread.id somewhere keyed on (student, activity). Reuse it across page loads.

2. Send a message

For streaming responses (recommended for UI):
The chunk object also carries citations — pointers into the lesson content the tutor used. Render them as footnote-style links next to the streamed text.

3. Read the history

When the student returns later, replay the thread:

4. Wire the UI

Minimal React example:

How tutor grounding works

The tutor’s context window is built from:
  1. The parent Course’s ai.instructions (tone, voice, scope).
  2. The Lesson content + activities.
  3. The student’s prior thread messages (truncated by token budget).
It does not see other students’ submissions, other lessons in the course, or the rest of the platform. That isolation is intentional — it’s what makes the tutor predictable. For grounded research-augmented tutoring, attach a research artefact:

Auth: don’t ship your platform key

Use the token flow so the session key in the browser is scoped to one student:

Cost & limits

  • ~$0.02 per student-question on default settings.
  • Threads have a soft cap of 50 messages; over that, the SDK summarises the oldest messages automatically.
  • A tutor.send call returns within 5–15 seconds for non-streaming and starts streaming within 1 second.