Wink Pings

Demos Only Use the First Two Layers: The Production Divide Across 9 AI Engineering Concepts

Yarchi breaks AI engineering into three layers—knowledge, action, and reliability—and nine concepts. Context, Embedding, and RAG determine what the model knows; tool calling, MCP, and Agents determine what it can do; Guardrails, Evals, and Observability determine whether you dare to ship. Data from the article: when documents pile up to 20 to 30, accuracy on documents in the middle drops to 50% to 57%; Agent tokens are about 4x a single call; LangChain only changed the harness and raised the benchmark by 13.7 points. The original is sponsored by Viktor; the product section is not covered here.

Whether an AI application can ship does not depend on how beautiful the prompts are. Yarchi breaks AI engineering into 9 concepts across three layers: knowledge, action, and reliability. He offers a sharp distinction: demos usually stop at the first two layers, while production systems live in the third. This distinction is more honest than many full-stack AI courses.

Original link: AI Engineering in 9 concepts

Knowledge Layer: What the Model Can Use

  1. Context engineering. Everything the model sees before each answer, including instructions, chat history, retrieved documents, and tool outputs. More context is not always better. Stanford ran a test: when given 20 to 30 documents, the model's accuracy on documents in the middle dropped to 50% to 57%. Without documents, the same model still scored 56%. When the answer is in the window, the model actually performs worse. There are two reasons: the model is more sensitive to the beginning and end, and the middle is easy to ignore; every token also costs money and time. Prompt caching is one of the few mechanisms worth remembering here. After a cache hit, token cost is about one tenth. The prerequisite is that the beginning remains byte-for-byte unchanged. Change one character, and everything after it is billed at full price. So put stable content first and changing content later. Put large files on disk and leave paths in the window. Restate the goal at the end every few steps. If there are more than 20 tools, consider letting the model search tools rather than loading all of them. Anthropic tested 58 tool definitions consuming about 55,000 tokens; after switching to search, Opus 4 went from 49% to 74%.

  2. Embeddings. Turning text into numbers so that similar meanings are close together in vector space. They do not answer questions themselves; they only provide coordinates for retrieval, clustering, and deduplication.

  3. RAG. Finding snippets from your own data and inserting them before the model answers. RAG solves the problem of the model not knowing private data; it does not solve the problem of the model not knowing how to use tools.

These three concepts are often conflated with prompt tricks. The actual division of labor is clear: Context decides what to put in, Embedding handles representation, and RAG retrieves private data.

Action Layer: What the Model Can Do

  1. Tool calling. The model proposes a function call, and code checks the parameters before executing. Permissions and validation live on the code side, not in the model's mouth.

  2. MCP. A unified slot. Build a tool once, and multiple MCP-enabled applications can reuse it. It lowers integration cost; it does not guarantee tool safety.

  3. Agents. A loop: think, act, look at the result, decide the next step. The hard part is not making it move; it is knowing when to stop. If you can write down the steps clearly, use a workflow; only use a loop when you cannot. Loops are expensive. One agent call consumes about 4x the tokens of a single call, and multi-agent systems about 15x. A loop that can run needs four things: clear completion conditions, an external checker, stop rules, and a budget. Without a checker, a loop is just open-ended money burning. Atlan publicly shared a production case: deterministic filtering first, with only about 14% of alerts entering the agent; the loop runs at most three rounds; if confidence is below 50%, it hands off to a fixed Python workflow. Filter first, keep the loop short, and have a fallback afterward. This structure is worth copying.

Reliability Layer: Can You Trust It?

  1. Guardrails. Check inputs and outputs. Do not rely only on a prompt saying not to do bad things.

  2. Evals. Run the test set on every change to see what actually broke. End-to-end checks look at the final answer; behavioral checks look at the trace. Airbnb's golden set is 50 to 100 examples; failures must be added to the set; 5% of production traffic is sampled daily. Using a model as a judge also needs validation. Airbnb found that about three quarters of model-generated reference answers differ across repeated runs. An eval may be measuring its own noise.

  3. Observability. Record every step so you know why it failed and how much it cost. Without logs, troubleshooting is guesswork.

Among these 9 concepts, the first 6 make a demo look good, and the last 3 make a system shippable. Many teams spend time on prompts and model selection, while production incidents come from permissions, stop conditions, and regression tests. Yarchi's conclusion is that the model is no longer the hard part; the five layers of engineering around it are. This judgment has a product-promotion context, but the direction is not empty.

One counterintuitive detail: the harness expires. Every guardrail is a bet on the model's capabilities, and some bets become invalid after the model is upgraded. Anthropic deleted an entire scaffolding component. Every few months, reread your harness and delete the parts the model has outgrown.

If you do only one thing: turn the last five failures into test cases, add round and dollar limits to loops, and give connectors read-only permissions. The original is sponsored by Viktor; the product section is not covered here.

发布时间: 2026-12-04 08:34