CTT-FISEI course assistant
Telegram course assistant with live operator handoff


A Telegram assistant for course inquiries by text and voice. I designed the system and the operator dashboard at the 2026 UTA Hackathon. AI agents I orchestrated wrote the code.
- Year
- 2026
- Context
- UTA 2026 Hackathon · CTT-FISEI Technology Workshops
- Code
- GitHub
- from planning to the bot and dashboard in production
- 85 min
- agent test cases passing, six of them attacks
- 19/19
- unit tests, in CI on GitHub Actions
- 46
- Gemini models in the fallback chain
- 5
The system
The assistant answers around the clock and recommends one or two of CTT-FISEI's 18 courses based on each person's profile. It answers questions and guides enrollment. The dashboard shows each message and the prospect's status. When an operator takes over, the AI pauses and the operator replies through the same bot.
Architecture
Technical decisions
A single LLM call per message, with JSON output validated with zod (reply, lead state, intent, profile and whether a human is needed): half the latency and tokens of chaining a classifier and a generator. The model is never the source of commercial data: prices come from the database, every amount in a reply is checked against the catalog and the enrollment link is built by the server. The dashboard reads from Supabase in real time and writes only through the authenticated API: the public key can't change anything.
What it does
- Replies in the user's language and understands voice notes: Gemini transcribes them, with no other service.
- Real catalog of 18 courses, synced every six hours with the CTT's official website; if the site goes down or changes its HTML, the previous catalog is kept. Each course's status is computed from the date in Ecuador and the site's enrollment button: the site listed 2025 courses that had already ended as open.
- Profiles the prospect through conversation (name, interest, level, availability, participant type) and quotes the price for their audience: UTA student, UTA graduate or staff, or general public.
- The AI pauses on its own when the user is frustrated or asks for a person. On taking over, the operator gets an automatic summary (interest, objections, next step); on handing back, the AI picks up knowing what the human said.
- Layered defence against prompt injection: user input is delimited as data, a pre-check catches false authority, DAN, "reveal your prompt" or "promised" prices, and the output is checked against the catalog. If it fails, it regenerates once or sends a safe reply.
- Never leaves the user without an answer: a chain of five Gemini models, each with its own quota, skips 429s, 404s and 5xx errors.
- Live metrics: people served, distribution by state, hot leads, handovers, blocked manipulation attempts, latency, tokens and model fallbacks.
- Operator sign-in with an HMAC token, attempt limits and constant-time comparison; Telegram webhook with
secret_tokenand read-only RLS for the dashboard. - 19 agent evaluation cases passing (sales, objections, closing, frustration, typos, English and six attacks), 46 unit tests and CI on GitHub Actions.
One concrete problem
The AI spoke after the operator had taken over
A message takes a second or two between arriving and Gemini replying. If the operator clicked "Take over" in that gap, the AI's reply went out anyway and crossed with theirs: the pause was checked when the message arrived, not when the reply was sent. Now ai_paused is read again right before sending. If the operator took over during inference, the reply isn't sent: it's stored as discarded and the dashboard shows it struck through, so you can see what the AI would have said.
Screenshots
The operator has taken over: the AI paused because the prospect asked for an advisor. The conversation is a demo. The automatic summary for the advisor: interest, objections, state and next step. Live metrics: the prospect thermometer, handovers, blocked manipulation attempts, latency and tokens. The 18 courses synced with the official website, each with its computed status. The public page: the QR code to the bot and the courses open for enrollment. Operator sign-in, on mobile.
My part
The whole project, on my own. I worked out the challenge and the rubric, designed the architecture and the data model, decided what to cut to make the deadline, set up Telegram, Gemini, Supabase, Render and Vercel, and tested the bot as a real user on every iteration. The code was written by AI agents I orchestrated: Claude Code planned, wrote a tight spec per task (allowed files, contracts and definition of done), launched the implementers (Cursor Agent CLI, up to three in parallel on separate folders), reviewed every diff, ran the tests and deployed. 23 tasks, one commit per task.
ScopeBuilt at a hackathon: planning started at 11:36 and the deadline was 13:00. The first version (bot, dashboard and handover) was in production before the cutoff; the rest of the day went into the real catalog, the CTT's visual identity, robustness, tests and CI.
Stack
- NestJS
- TypeScript
- Supabase
- PostgreSQL
- Gemini API
- grammY
- zod
- React
- Vite
- Tailwind CSS
- GitHub Actions
- Render
- Vercel
