← Back to Portfolio

Ask Qi

Ask a chatbot version of me about my projects, research, coursework, or badminton. Your question goes to a Python backend I deployed on Render, which adds my persona and calls the Google Gemini API — so the API key never touches this page.

Checking backend…
0/500
How this works (frontend ↔ backend)

Two halves living at two different URLs, talking over JSON:

  1. This page (GitHub Pages, static HTML/CSS/JS) collects your question and fetch()es my backend. It sends nothing but your message and the last few turns of the conversation.
  2. The backend (Flask on Render) validates the input, rate-limits by IP, attaches the system prompt that makes the bot answer as me, and calls the Gemini API with a key stored in a Render environment variable. It replies with JSON { "reply": … }.
  3. This page renders that reply as text. Errors — bad input, rate limit, backend asleep, model unreachable — come back as JSON too and are shown in the chat instead of failing silently.

Endpoints used: GET /health (wake the server on page load), GET /suggestions (the chips above), POST /chat (every question).

Because Render's free tier sleeps after ~15 minutes idle, the very first request can take around 50 seconds while the server boots. Everything after that is fast.