Case study 04
This Site, and the Agent Inside It
The portfolio is its own case study: a terminal with a RAG agent over everything on it, built to run at $0.
React Router · React Three Fiber · TypeScript · Cloudflare Workers AI · RAG

problem
A portfolio that claims AI engineering should have to prove it on the page. Most sites settle for a chat widget bolted into a corner: no context, no character, and it breaks the moment an API key expires or a free tier runs dry. The bar here was a working AI product with real constraints. Zero monthly cost, no broken states, and an interface that says something about how I think.
approach
Everything starts from one content layer. The same typed modules generate the pages, a virtual file system for the built-in terminal, the agent's retrieval corpus, and an llms.txt for AI crawlers. One source of truth, four surfaces. The terminal is summonable from anywhere as a floating window, and typing shaurya boots an agent REPL the way a CLI tool would. Retrieval is deliberately lexical, since tf-idf over a small corpus beats an embedding pipeline at this scale, and generation runs on Cloudflare Workers AI's free tier behind a rate-limited function. If the model is unreachable, the agent falls back to retrieval-composed answers instead of failing. The demo can't die. The hero object is the same philosophy applied to 3D: a retro CRT rasterized to live text every frame, made of the same material as the terminal.
outcome
A fully static site with one serverless function, streaming cited answers, and no failure mode a visitor can see, at $0/month. Every architectural decision is inspectable; the site you are reading is the system diagram. It encodes my working rules for agent products: retrieve before you generate, cite what you retrieved, and design the degraded path before the happy one.