Skip to content
LLM application engineering Foundation 9 min read

LLM engineering at 2,000 ft

LLM application engineering is the craft of building dependable products on top of an undependable component. The model is a brilliant, probabilistic function you cannot inspect; everything in this track is about controlling what goes into it, constraining what comes out, giving it tools instead of trust, and measuring the result.

10,000 ft

The rest of this site explains how models are made: transformers learn to predict tokens, post-training turns them into assistants, and systems serve them. This track starts where the model becomes an API call. Since 2022, much of the AI that people actually use lives in this layer: support assistants, coding tools, search, analysts and agents are all ordinary software wrapped around a few model calls. The engineering problems are new in kind. The core component is stochastic, its failures are fluent and plausible, its behaviour shifts when the provider updates it, its inputs can be weaponised, and its cost is billed per token. Six ideas answer those problems: prompting (specify the task), structure (turn text into data), retrieval (supply the facts), tools and agents (let code act and compute), evals (know whether it works) and guardrails (keep it safe). They are the subject of this track, and Finny's own assistant, Jarvis, is the worked example that ties them together.

The whole track in one picture

Strip away the frameworks and every LLM application is the same program:

Every LLM application is the same program: assemble context, call the model, constrain, act, check
Every LLM application is the same program: assemble context, call the model, constrain, act, check. user, context assembly prompt, retrieval, memory, state, model call probabilistic, structured output schema, routing, tools and code compute, act, guardrails input and output checks, data and docs indexes, APIs, evals and traces every change measured, results, answer, measureEvery LLM application is the same program: assemble context, call the model, constrain, act, check. user, context assembly prompt, retrieval, memory, state, model call probabilistic, structured output schema, routing, tools and code compute, act, guardrails input and output checks, data and docs indexes, APIs, evals and traces every change measured, results, answer, measure

Read it as a list of the decisions you will make in every product:

Decision The question Where it is taught
What does the model see? Which instructions, examples, documents and state go into the context, in what order, within what budget? Prompt engineering, RAG, context engineering
What shape comes out? How do you turn free text into data a program can trust? Structured outputs
Where do the facts come from? Which knowledge is retrieved per question, and how do you find it? Embeddings, RAG, advanced RAG
Who computes and who acts? What should code do (calculate, fetch, write) rather than the model, and how does the model ask? Tools, agents, MCP, multi-agent
Does it work? How do you know a change made it better, before users find out? Evals in practice
Is it safe? What happens when inputs are hostile or outputs are wrong? Guardrails and security
Can you afford to run it? Latency, cost, model routing, caching, and a UX that survives errors Shipping AI products

The mental model to keep

Treat the model as a talented, fast, occasionally confabulating colleague who has never seen your company, cannot do arithmetic reliably, follows instructions literally, and will believe anything written in a document you hand them. You would brief them carefully (prompts), give them the right files (retrieval), ask for answers on a form (structure), let them use a calculator and the internal systems through approved channels (tools), check their work (evals and gates), and never let them wire money on a stranger's say-so (guardrails). Every page in this track is one of those habits made precise.

Principles that hold across the track

These recur on almost every page; learning them early saves rediscovering them in production.

  1. Code computes, the model explains. Numbers, dates, permissions and state changes belong in deterministic code; the model chooses what to compute and phrases the result. A large share of production failures come from asking a model to do arithmetic or bookkeeping it should have delegated.
  2. Evaluate before you optimise. A prompt or pipeline change without a fixed eval set is an anecdote. Build 50 real cases on day one; grow them from every failure.
  3. Context is a budget. Every token costs money and latency and competes for attention. More context is not better context.
  4. Structure at every boundary. Wherever model output feeds a program, constrain it to a schema and validate it in code.
  5. Untrusted in, untrusted out. User text, retrieved documents and tool results can all carry instructions; model output can be wrong. Authority lives in code, never in a prompt.
  6. Start with the simplest thing that could work. A single well-prompted call beats a chain; a fixed workflow beats an agent; one agent beats many, until an eval proves otherwise. Anthropic's Building effective agents makes the same argument from many customer deployments.
  7. Make failure graceful. A system that can say "I don't know", ask a clarifying question or refuse is safer and more trusted than one that always answers.

The worked example running through this track

Jarvis is the assistant in Finny's app: it answers questions about a member's own FIRE (financial independence) plan. It routes each question with one structured model call, has code fetch and compute the figures, lets a model phrase the answer from a labelled fact table, and runs a deterministic gate that checks every number before the reply leaves. Short "Finny" notes on several pages show one idea in that system; the case study puts them together, including what the team measured and what it learned the hard way.

The map of the track

Arrows mean "builds on". The first map is the capability path; the second is the discipline that applies to everything on the first.

The track, part 1: from a prompt to an agent
The track, part 1: from a prompt to an agent. Prompt engineering, Structured outputs and function calling, Embeddings and vector search, Retrieval-augmented generation, Advanced RAG hybrid, re-rank, graphs, Agents and tool use, MCP and tool protocols, Multi-agent orchestration, Context engineering and memoryThe track, part 1: from a prompt to an agent. Prompt engineering, Structured outputs and function calling, Embeddings and vector search, Retrieval-augmented generation, Advanced RAG hybrid, re-rank, graphs, Agents and tool use, MCP and tool protocols, Multi-agent orchestration, Context engineering and memory
The track, part 2: what makes any of it shippable
The track, part 2: what makes any of it shippable. any system from part 1 prompt, RAG, agent, Evals in practice golden sets, judges, Guardrails, injection and security, Shipping: latency, cost, routing, UX, Case study: how Jarvis is built, is it right?, is it safe?, is it usable?The track, part 2: what makes any of it shippable. any system from part 1 prompt, RAG, agent, Evals in practice golden sets, judges, Guardrails, injection and security, Shipping: latency, cost, routing, UX, Case study: how Jarvis is built, is it right?, is it safe?, is it usable?

How to work through this track

The track has three units. Each topic page takes about an hour to study properly (reading, running the code, answering the questions); plan on roughly 14–16 hours for the whole track, spread over a few weeks with something built between units.

  1. Unit 1: the building blocks (about 5 hours). Prompt engineering → structured outputs and function calling → embeddings and vector search → retrieval-augmented generation. After this unit you can build a grounded Q&A assistant that returns structured, cited answers.
  2. Unit 2: systems that act (about 5–6 hours). Advanced RAG → agents and tool use → MCP and tool protocols → multi-agent orchestration → context engineering and memory. After this unit you can build an agent that plans, calls tools and manages its own context.
  3. Unit 3: shipping (about 4–5 hours). Evals in practice → guardrails, prompt injection and security → shipping AI products → case study: Jarvis. After this unit you can measure, secure and run what you built.

If you are building something now, a faster route: prompt engineering, structured outputs, evals in practice, then whichever of RAG or agents your product needs, then guardrails. Evals early is the single habit that most separates teams that ship from teams that demo. Build alongside the reading with the RAG assistant and agent project.

Every page in the track

LLM engineering in eight dates

When Event Read
May 2020 GPT-3 shows in-context learning: tasks specified by a prompt, no training prompt engineering
May 2020 Lewis et al. name retrieval-augmented generation RAG
Oct 2022 ReAct interleaves reasoning with tool calls, the template for agents agents
Nov 2022 ChatGPT makes the chat assistant a mass-market product the assistant era
Jun 2023 Function calling arrives in a major model API structured outputs and tools
Aug 2024 Schema-constrained structured outputs in a major API structured outputs and tools
Sep 2024 Reasoning models trained to think before answering reach developers reasoning models
Nov 2024 The Model Context Protocol is published as an open standard for tools MCP

Prerequisites from other tracks

You can start this track with little maths; it rewards more. Before or alongside unit 1:

Helpful later: KV cache and efficient attention (prompt caching), serving LLMs (latency and cost), reasoning models and red-teaming.

The five best resources for this track

  • AI Engineering — Chip Huyen, O'Reilly 2025. The most complete book on building applications on foundation models: evaluation, prompting, RAG, agents, fine-tuning, inference. The linked repository holds its supporting materials.
  • What We've Learned From A Year of Building with LLMs — Eugene Yan, Bryan Bischof, Charles Frye, Hamel Husain, Jason Liu and Shreya Shankar, 2024. Tactical, operational and strategic lessons from six practitioners; read it twice, once now and once after unit 3.
  • Building effective agents — Anthropic, December 2024. Workflows versus agents, the five common patterns, and why simplicity wins.
  • Your AI Product Needs Evals — Hamel Husain. The case for, and a practical method of, evaluation-driven LLM development.
  • Patterns for Building LLM-based Systems & Products — Eugene Yan, 2023. Evals, RAG, fine-tuning, caching, guardrails, defensive UX and feedback, each with its literature.

Where this leads