Shraddha Yeolekar
← All projects
Project 02 · Live public AI

Ask AI

GuardrailsLive

A public chatbot at ask.shraddhayeolekar.com that answers questions about my work using only my resume and GitHub projects, and cites its sources.

Key decision
Run the cheapest, most predictable guardrail before the model.
Why
A keyword filter refuses risky questions (salary, comparisons with other people, protected-class topics, jailbreak attempts) without calling Gemini. It runs before the five-a-day rate limit, so a refused question doesn't use up a visitor's quota. After the model, citations that don't match a real source are dropped.
Gave up
Some fair questions get refused by a blunt keyword list. For a bot that speaks in my name, I'd rather refuse a fair question than answer a risky one.
before the model · deterministic after the model Killswitch Spamcheck Keywordpre-filter Rate limit5 / day GeminiJSON + cites Citationcheck Answer off → paused bot → rejected risky → refusal no model call, no quota spent 6th ask → tomorrow unknown link → dropped refusals and answers are logged to a database for review
Every check before the model can stop a request. The highlighted pre-filter is the key decision: it costs nothing, behaves the same way every time, and runs before the rate limit.

How it's built

Everything except the model and the GitHub content runs on Cloudflare: one Worker, with storage, spam protection and deployment from the same platform.

Cloudflare outside Cloudflare Visitor page + Turnstile widget Static assetsthe page Turnstilespam check Worker /api/search guardrails in order context.mdresume, bundled in KV kill switch daily limits README cache D1query log GitHub READMEsre-fetched after 24h Gemini 2.5 FlashJSON: answer + citations question + token verify token bundled sources + question log on push to main GitHub repomain branch Workers Buildsbuild + deploy SecretsAPI keys deploys attached at runtime
The request path runs across the top: the visitor sends a question to one Worker, which talks to every other piece. The deploy path is along the bottom. Only Gemini and GitHub sit outside Cloudflare.
PieceWhat it does
WorkerReceives each question, runs the guardrails in order, calls Gemini and checks the citations. Everything else falls through to the static page.
KVThree jobs: the kill-switch flag, a per-visitor daily counter that expires after about a day, and the cached GitHub READMEs.
D1Logs every question and answer, and whether the pre-filter blocked it, so real traffic can be reviewed.
TurnstileSpam check. The Worker verifies the token server-side before the question goes any further.
context.mdThe resume and project notes, bundled into the Worker at deploy time.
GitHub READMEsFour project write-ups fetched live and cached for 24 hours, so they stay current without a redeploy.
Gemini 2.5 FlashAnswers from the provided sources only, returning structured JSON: the answer, its citations and a "grounded" flag.
Workers BuildsBuilds and deploys automatically on every push to main. API keys live in Cloudflare's secrets, not in the code.