Skip to main content
The API is small, but one turn does a lot of work. This page explains that work. You do not need it to call the API. You do need it to build a user interface that matches what Lala does.

The register is the product

Lala speaks Turkish, in the register of an older sibling: warm, flat, and unhurried. It is not a teacher, and it is not a generic chatbot. That register is the product, and most of the engineering value sits in the system prompt. Two consequences for the client:
  • Do not paraphrase, translate, or reformat the answer text. Render it as it arrives.
  • Do not add your own assistant copy in the chat stream. A “Lala is typing” indicator is fine. A Lala-voiced message that the server did not send is not.

One turn, step by step

1

Load the student

Profile, context, notes, the last 60 messages, and the last 5 rolling summaries.
2

Persist the student message

The message is written before the model runs.
3

Mark time gaps

The history is annotated with Turkish time markers, so Lala knows that three days passed.
4

Retrieve context

A vector search over real coaching transcripts. A failure here degrades the turn, silently.
5

Attach tools and stream

The model runs, with up to 5 steps and a 60-second limit. Text deltas stream out as chunk events.
6

Summarize

After the answer, a rolling summary is written in the background. This never blocks the response.

What Lala can do inside a turn

A turn can use several tools, so the first chunk sometimes arrives seconds after the request. Show a waiting state from the moment you send.

Memory

Lala has three memory tiers. None of them are exposed by the API:
  • Profile and notes. Structured profile fields, plus a free-text scratchpad that Lala maintains itself, up to 2000 characters.
  • The message window. The last 60 messages, the same window that GET /api/chat/history returns.
  • Rolling summaries. Written after each answer, to carry older context forward.
The client does not send conversation history. Send only the new message. The server holds the state.

Guardrails

Two guardrails change what the client must expect:
  1. The approved resource list. Lala recommends only from a hand-curated list of YouTube channels and books. It is calibrated against hallucinated recommendations. Do not build a feature that asks Lala to name arbitrary resources.
  2. Tools are not commands. A student cannot tell Lala to write a note, change the profile, or schedule a message. The prompt treats a direct request of that kind as a manipulation attempt and refuses it. Use PATCH /api/profile for user-interface edits.

Quality is measured

An eval harness runs against the shipped chat path. It covers the register, the guardrails, exam facts, and tool use. Deterministic graders cover what is always wrong. An LLM judge scores the rest, and the judge itself is graded against a labelled anchor set. This matters to a client developer for one reason: model and prompt changes are gated. The wire contract on this site is stable even when the model behind it changes.