Lab

Things I've built and run myself

Client work stays private. This is where I show the engineering I own end to end, with the source code, measurements and limitations.

Mihir AI · Documented architecture

Inside the hybrid retrieval implementation

Select a stage to see what it does and why it's there. The public assistant is not offered on this site.

STAGE 01 / 07
Question arrives

The widget sends the message with an anonymous session ID and a CSRF token. The Worker validates the JSON shape and caps messages at 2,000 characters.

Why

Cheap checks first. Nothing expensive runs until the request is known to be well formed.

POST /api/chat
{ session_id, csrf_token, message }
→ 400 if body invalid or > 2,000 chars
1.00
Recall@5, hybrid + rerank
0.98
MRR, hybrid + rerank
21
Indexed chunks from 5 files
Free tiers
Designed for low usage costs
Recorded in the original build evaluation on a small, controlled corpus. These numbers describe retrieval on this corpus, not general model quality.
Write-up How I Built Mihir AI The full technical guide: indexing, retrieval, security, evaluation and honest limitations. mihirtrivedi.tech/build ↗ Repository mihir-ai-worker TypeScript Cloudflare Worker: API, security layers, hybrid retrieval and tests. github.com/mtrivediLU ↗ Architecture This website Static HTML, CSS and vanilla JavaScript. The chat widget source remains in the repository and is not loaded on the public site. No framework or bundler. Explore the implementation → Research Random forests for gold prospectivity Graduate research on faults and gold mines in the Superior Province, published in 2023. Read the case study →