Adam Massarsch

Seminar for groupsNov 2026

A shared AI room where a study group uploads its material, asks one AI together and rehearses for the seminar.

$0.47 → $0.03 cost per question in a room with seven papers: the first after a pause, then follow-ups read from the prompt cache.

  • Next.js
  • Supabase
  • Claude API
  • Realtime
  • Vercel
Demo · 52 s · no sound · UI in Swedish

The problem

Seminars and group presentations are done together, but students prepare alone, and generic AI chat does not know their material. A group needs one place where everyone sees the same sources, and a way to practise answering hard questions before the real seminar.

What I built

A web app where one person creates a room and the rest of the group joins with a link or a six-character code, no account needed. Inside the room the group shares PDFs, asks a shared AI chat that has read the material and answers with page-level citations, follows a live activity log, and rehearses: individually, or as an AI-led group seminar where each person takes turns answering by voice. Results are visible to the whole group.

The group version took two days to build, on top of a solo practice app I had built first.

How

Next.js 16, TypeScript, Tailwind CSS 4, Supabase (Postgres, Storage, Realtime, anonymous auth), the Anthropic Claude API with the Files API, ElevenLabs for voice, Vercel with a daily cron job.

  • The browser reads, the server writes.

    Row-level security lets a browser read only rooms it is a member of. Every write goes through an API route that checks membership first, with the secret key kept on the server. A script checks that every API route is protected.

  • Prompt caching by design.

    The prompt is ordered stable-first: system prompt, then the room's documents with a one-hour cache breakpoint, then what changes per question. Measured cost per question: about $0.47 for the first question after a pause in a room with seven papers (114,000 tokens), about $0.03 for follow-ups within the hour.

  • Cost is checked before the call, not after.

    Every AI route checks a rolling 24-hour budget for the app and for each room, and logs usage afterwards. Before a chat question the app estimates its cost, including whether the cache is still warm, and refuses the call if it would not fit.

  • Text instead of PDFs.

    Uploaded PDFs are converted to page-marked text before they reach the model. On real files this cut input tokens by 59 %. Scanned PDFs without a text layer fall back to the original file.

The hardest part

Citations the group can trust. Anthropic's built-in citations added 31–46 % more input tokens per question in my measurements, so I had the model write its own compact markers (document, page, quote) instead. The server then checks every quote against the extracted text page by page: a correct marker is kept, a wrong page is corrected, and a quote that cannot be found is removed. This also runs on the live stream, so nobody sees half a marker. In testing, 13 of 13 chat markers and 17 of 17 analysis markers passed, each also checked by hand against the PDF. Clicking a citation opens the PDF at that page with the quote highlighted.

Questions about Seminar for groups?

Email meadam.massarsch@gmail.com