Projects
Things built in the open, explained in enough detail that you could build them yourself.
An AI tutor that shows its retrieval
The tutor on this site is a small, inspectable RAG system: heading-aware chunking, BM25 or hybrid retrieval, grounded prompts and visible sources.
Most chat assistants hide how they found their answer. This one shows it: every answer lists the retrieved passages, their retrieval scores and how many tokens of the context window the request used.
The knowledge base is built from the articles and labs on this site at deploy time. Articles are split at their section headings, and each chunk carries its article title and heading path so it still makes sense on its own.
Retrieval uses BM25 keyword ranking by default. When an embedding model is configured, it adds vector search and merges both lists with reciprocal rank fusion.
Sources are passed to the model as clearly delimited data, the model has no tools, answers are rendered without raw HTML, and requests are rate limited. Those choices follow the defences described in the prompt injection article.
Built with
- Next.js
- TypeScript
- BM25
- Optional embeddings
- Provider-agnostic LLM API