The web application for sushrutalgs.ai, an AI study assistant for advanced surgical exam prep that answers questions with citations traced back to standard textbooks, with a streaming chat interface, branching conversations, inline figures and tables, and the marketing, sign-up and onboarding flows around it.
Surgery residents revising for advanced exams cannot act on an answer they cannot check. A chat box that streams confident prose is worse than useless there: if a claim does not point back to a page, a figure or a table in a standard textbook, it is not revisable, it is just fluent. So the web client's job was never to render text. It was to keep every answer attached to its sources while the answer is still arriving, from a browser that must never hold a backend key.
An answer does not arrive as a document. It arrives as an interleaved stream of eight server-sent-event frame types (thinking steps, metadata, text, citations, figure and table artifacts, error, done), any of which can stop mid-flight when the connection drops or a token expires. Buffering until the stream ends is the easy version, and it makes a long answer feel broken, so the client has to render as frames land and keep message state consistent through partial and aborted answers. Studying is also not linear: a user retries a question, or edits it to ask a sharper one, and a flat message list can only serve that by destroying the answer they were comparing against.
It is live at sushrutalgs.ai as the primary client, carrying the streaming chat, the citation and figure rendering, and the sign-up and onboarding path into the product. Session verification is cheap in practice: the JWKS cache behind it runs above a 99.9 percent hit rate, so a signed-in request almost never pays for a key fetch. The honest cost is weight. The production build ships roughly 2 MB of client JavaScript, which is more than a text-first reading interface should need, and trimming it is the open work; the proxy in front of the asset buckets is the other standing tax, and that one I would pay again.
A study thread in the web app: a question, the streamed answer, and the textbook citations behind it.
In numbers
The 2 MB is the one number here I would not defend on principle, only on priority order: getting citations to render correctly while a stream is still arriving came first, and trimming the bundle is next, not skipped.