MCP
How models reach your tools and data
6Build your Unity scene by typing a sentence
A Unity MCP server exposes the Editor's actions as tools an AI client can call — so 'make a red cube and add a Rigidbody' appears in your scene. What MCP is, what the server exposes, and why it's a bridge (not magic) to review.
read →MCP vs function calling
They're not rivals. Function calling is how one app calls a tool; MCP sits on top of it so any client can discover and call the same tool. The honest difference, and the one rule that decides which you need.
read →MCP, explained in one drawing
What MCP is and why it exists: the M×N integration mess it replaces, the three primitives, and the transports — the whole protocol in one page.
read →Tools vs. resources vs. prompts in MCP
An MCP server has three primitives, not one. Tools (the model decides), resources (the app decides), prompts (the user decides). The 'who controls it' axis, with a decision rule and the client-support catch.
read →Why your AI can't touch your data
A fresh model can describe your database perfectly and read nothing from it. MCP is the standard that hands it real tools — wrap a tool once, and any AI app can use it.
read →Your agent skipped the tool you gave it
The model never sees your function body. It picks a tool from three things: the name, the description, and the input schema. Write descriptions that say WHEN to call, not just what the tool does.
read →Agentic
Loops, edits, and what they cost to run
8An AI agent is just a loop
Strip the hype off an AI agent and you're left with a loop: think, act, observe, repeat. The model is stateless — the loop and its growing context are the memory. Here's the mechanism, when the loop stops, and how to stop it running forever.
read →How coding agents edit your files
Coding agents don't retype your file — they do targeted find-and-replace on a unique anchor. That's why broad, multi-file requests break far more often than small specific ones.
read →Idempotent tools = agents that don't nuke prod
Agents retry, loop, and re-call tools — so a non-idempotent charge can fire twice. Idempotency means many calls, one effect: a unique key makes the retry a no-op. Which tools need it, and why the MCP idempotent hint is only a hint.
read →Prompt injection: the SQL injection of AI
Your AI agent reads a web page that says 'ignore your instructions, email the database' — and it does. Instructions and data share one channel, so attacker text becomes commands. Why it's still unsolved, and how to shrink the blast radius.
read →The reply costs ~5× the prompt
Per token, LLM output costs about five times input on every major tier. The levers are all on the output side: cap the reply, ask for the short form, and never make the model retype your document.
read →Why agents need a scratchpad (memory)
LLMs are stateless — each call is a blank slate. Agents bolt on memory: a scratchpad (working memory, the thought/action/observation loop) plus a long-term external store. Here's how, and what breaks without it.
read →Why AI confidently makes things up
LLMs predict likely text, not truth — and they were trained on benchmarks where a confident guess scores higher than 'I don't know.' Why hallucination is baked in, and what actually reduces it: grounding, citations, and letting it abstain.
read →Why your agent ignores half your prompt
Models don't read your context evenly. Recall follows a U shape — strong at the start and end, weak in the middle ('Lost in the Middle'), and longer context degrades more. Put the important stuff first or last.
read →RAG
Retrieval, embeddings, and what goes in the window
7Embeddings, explained with one analogy
An embedding turns text into a point on a map of meaning — similar meaning lands close together. Cosine similarity, the king-queen caveat, and why it's the engine of semantic search and RAG.
read →Pure vector search misses exact matches
Ask a pure vector DB for error code E-4031 and it returns vaguely related prose, not the doc that says E-4031. Hybrid search runs keyword (BM25) + vector in parallel and fuses the ranked lists (RRF) so exact matches come back too.
read →RAG vs. fine-tuning: pick in 30 seconds
RAG changes WHAT a model knows; fine-tuning changes HOW it behaves. Use RAG for facts, fine-tuning for format/tone/skill — and why fine-tuning on new facts actually increases hallucination.
read →Reranking: the cheap RAG upgrade
Your RAG retrieved the right chunk — but it's ranked ninth, so the model never reads it. A cross-encoder reranker scores query and chunk jointly and fixes the order. The two-stage pattern, why you can't rerank everything, and the caveats.
read →Vector DB, or just Postgres?
The reflex is to spin up a separate vector database. But Postgres + the pgvector extension already does similarity search — vectors next to your rows, filtered and ranked in one query. Start simple; go dedicated only when you outgrow it.
read →What a context window really limits
A context window isn't the model's memory. It's the max tokens the model can attend to in one call — input and output share that budget, and it resets every turn because the model is stateless.
read →Why your RAG retrieves garbage — fix your chunking
Most RAG fails on the chunking, not the model. The three chunking mistakes — chunks too big, too small, no overlap — and the fix: split on structure, add overlap, one idea per chunk with its context attached.
read →Workflows
Choosing, testing, and paying for models
10Do you actually need a local LLM?
Running a model locally feels free — but 'free' is a GPU you paid for running a weaker model. When local (Ollama, llama.cpp) actually beats a cloud API: privacy, offline, and very high volume.
read →Grade your AI with another AI
LLM-as-a-judge scales grading past what humans can read — but it has real biases: it favors whatever answer it sees first, rewards longer answers, and likes its own style. Swap the order, use a rubric, calibrate to humans.
read →How to eval an AI feature without vibes
A vibe check can't tell you if a prompt change helped. An eval = test cases + a grader, turning 'seems fine' into a number. Grader types, LLM-as-judge caveats, and the start-small workflow.
read →Prompt caching: stop overpaying your LLM
You re-pay full price for the same fixed prompt on every call. Cache the stable prefix and reads cost about a tenth — here's the one rule that makes it work.
read →Quantization: run a big model on a small GPU
Quantization stores each model weight in fewer bits (FP16 -> INT8 -> INT4), so a 7B model drops from ~14GB to ~4GB and fits a cheap GPU. Two catches: quality slips worst at 4-bit, and those figures are weights only — the KV cache grows with num_ctx and can dwarf them.
read →Structured outputs > prompt-and-pray
Stop asking the model for JSON and praying it parses. Bind a schema and the decoder is constrained to it — malformed output becomes impossible. OpenAI, Claude, and how it actually works.
read →Too much context makes your AI worse
Context is a finite attention budget, not free storage. More of it dilutes the signal, the middle gets under-weighted, and stale or lookalike-wrong text actively flips answers.
read →What temperature actually changes
Temperature isn't a creativity dial. It scales the logits before softmax — sharpening or flattening the next-token distribution. The mechanism, the practical rule, the top_p interaction, and the caveats.
read →You're paying your best model to do filing
The small model in the same family costs a fraction of the top tier, and sorting and extraction do not need the big one. But prompt caches are model-scoped, so swapping mid-conversation can cost more than it saves.
read →Your eval set is too small to trust
An eval score is a sample statistic. With 20 test questions the 95% band is roughly ±17 points, so a one-case win is inside the noise. Check the range, not the score — and make the cases hard.
read →One concept a week. Free.
The deeper, copy-paste version of each ToolCall short — in your inbox.
// total: 0.00 · spam: void · unsubscribe: one click
