Why I Stopped Choosing Between Semantic and Keyword Search
Neither pure semantic search nor pure keyword search is enough. You need both, fused — and I had to build each one twice to figure that out.
Models, agents, memory and the systems around them.
Neither pure semantic search nor pure keyword search is enough. You need both, fused — and I had to build each one twice to figure that out.
maxtokens=4096 silently truncates complex structured outputs. The model calls the tool, you get an HTTP 200, and the field is just… empty. Log
In any processing loop, 'transient' and 'terminal' are completely different states. Only terminal states should block re-processing — and they definitel
When you ask an LLM to produce a schema mapping, prompt clarity isn't enough. Validate at the boundary and halt loudly — or you'll get silent, empty row
A HARDRULES block I wrote to protect financial data was killing aggregate financial questions too. The fix wasn't removing the rule — it was sco
Two layers of failure hid a display name from my calendar agent. The fix wasn't patching either layer — it was checking a completely different system th
launchctl bootstrap from a repo path doesn't survive a reboot. Copy the plist to ~/Library/LaunchAgents/. But the actual lesson is deeper — if you
Two Claude Code hooks aren't enough — there are four ways a session can end, and only one of them is obvious. Wire all four or you'll keep losing se
When you shell out to claude -p (headless Claude) in a subprocess, MCP tools don't just appear — you have to wire them in explicitly. And the flag you
The model that won my general text bake-off quietly dropped 4 real commitments when I aimed it at meeting transcripts. Recall matters more than prec
Every iMessage turn spawns a fresh claude -p process. 'Session memory' doesn't exist. If your agent doesn't write to disk before it exits, the lea
LLMs drift. Prompting them to stay inside a trust boundary is advisory. Code-level firewalls are mandatory.
Don't build a long-lived AI agent process. Spawn one subprocess per message, return text, die. Decouple everything else.
I used a Zero-Width Joiner to mark every outbound Apollo message. The decoder ate the marker. A fallback path fed Apollo its own NSArchiver garbage inst
Don't save every turn. Don't wait to be asked. Separate the cheap decision ('is this worth keeping?') from the expensive write ('format it, dedup it
Blind retry is almost always wrong. Classify the error first, fix what you can, then retry — and narrate loudly so you know what's happening.
Telling an LLM not to use a tool is not the same as preventing it from using the tool. Enforce scope at two layers — prompt AND harness — or the fir
Put your TTS behind a proxy URL endpoint. Use <Play> not <Say>. Swap providers without touching telephony.
When an AI agent has side effects — creating tasks, sending messages, triggering anything — a prompt saying 'don't do X' is not a hard stop. You nee
I built a lead gate for a cancer clinic finder that turned the AI into a bouncer. 71% of users hit one sentence and left. The fix was three words: lead
A blunt AI gate doesn't protect the product — it wrecks the funnel. The fix is a short block list and a generous allow list, not a wall.
When you batch LLM calls to generate dense structured output, four things will break on you — and they'll break in sequence, one crash at a time. He
Don't put secrets in the prompt. Stripping sensitive fields from your system prompt JSON is the real lock — 'do not share this' instructions are def
At batch LLM scale, a 1–3% flake rate isn't rare — it's guaranteed. Wrap every client.messages.create() call in a retry loop, and strip empty defaul
Never build a dedup key out of fields your model generates. It'll regenerate them differently every run. Hash the raw content — the one thing that
For text RAG, default to OpenAI text-embedding-3-small. Competitive quality, you probably already have the key, one fewer billing surface. Voyage
When your RAG corpus has multiple source kinds, make sourcekind a first-class column from day one. The unit of rebuild should match the unit of c
I spent two archive sweeps chasing a token cap that was never actually costing me anything. 9% reduction. The cap was aspirational. My session budge
Strip sensitive content before it hits your vector DB — not at query time. One LLM pass at ingest beats a thousand prompt instructions at retrieval.
Running autonomous agent cycles in the same session means every new cycle has read the prior ones. By Cycle 5 they stop catching bugs and start agre