My site's chatbot was stuffing 273k tokens into every message. I gave it tools instead.
2026-07-20The assistant on this site used to paste the entire content corpus — every article, every log — into the system prompt on every request: ~273k tokens, past the model's own context window. I rebuilt it as a small tool-using agent that retrieves on demand: three tools (BM25 search, fetch-a-page, and a think scratchpad), a ~5k-token catalog, and the bodies pulled only when needed. Notes on the Kimi / pi / Anthropic ideas I borrowed.
5 min · agents · llm · tools · retrieval · systems
Giving my own search the Contextual BM25 treatment
2026-07-20This site's search was a substring indexOf — first match wins, no ranking, and any multi-word query that isn't a verbatim phrase returns nothing. I replaced it with the two things I'd just written up: BM25 for ranking, and Contextual Retrieval for chunks — except the context is deterministic frontmatter instead of a Claude call, so it runs at request time with no model. Here's the rebuild, with the real before/after.
6 min · search · retrieval · bm25 · rag · information-retrieval
Contextual Retrieval, with a runnable repro and a browser playground
2026-07-17Anthropic's Contextual Retrieval fixes the oldest RAG bug — chunks that lose their context — by having Claude write a one-line context for each chunk before you index it. I built a dependency-free repro that reproduces the ranking lift, plus an in-browser playground so you can watch the right chunk climb.
7 min · rag · retrieval · claude · embeddings · playground
A 14B model that matches a 671B one — by knowing its domain
2026-06-09Paper notes on Qwen-BIM: fine-tuning a small open model on a reasoning-supervised, domain-specific dataset beats a 50×-larger general model on BIM design tasks. The interesting part isn't the result — it's why.
7 min · llm · fine-tuning · domain-models · bim · paper-notes
This site is managed by Claude
2026-06-03Why my homepage is an AI-native, agent-operated artifact — and how the content layer works.
1 min · meta · ai · nextjs