Lesson 2 of 4 · ⭐ Gap priority

Agentic Engineering in Production

An agent works perfectly in the demo, then hallucinates a tool call the first week it's live. The gap between those two moments is what this lesson is about.

Core building blocks

Four concepts turn a single LLM call into something that can actually take action.

Tool / function calling

The model doesn't take actions itself — it emits a structured request to call a tool, your code executes it, and the result goes back into context.

MCP

A standard protocol for exposing tools and resources to a model consistently, instead of every integration inventing its own function-calling schema.

RAG

Retrieval-Augmented Generation — searching your own data at request time and injecting the relevant chunks into context, instead of relying on what the model memorized in training.

Evals

A test suite for a prompt or agent — a fixed set of inputs with expected properties of the output, run automatically whenever the prompt or model changes.

Why the demo works and production doesn't

Three gaps account for most of the difference.

Tool-call hallucination

The model calls a tool with a plausible-looking but invalid argument — a wrong ID, a made-up parameter — and no error surfaces until something downstream breaks.

Missing guardrails

A demo has one happy path; production has retries, partial failures, and adversarial input the demo never exercised.

No eval coverage

Without evals, a prompt or model change that silently breaks one case takes days to notice instead of failing a test in CI.

Exercises

Look at the sanitized agent trace below, then work through both exercises.

Agent trace:
  User: "Refund the customer's last order."
  Tool call: refund_order(order_id="ord_9f8e7d")
  Tool result: Error — order_id not found

  (order_id was hallucinated; no real "last order" lookup
   was ever called first)

Concept check

Answer in your head first, then click a question to reveal the answer.

Scenario checklist

Work through the sample agent trace and check each item off. Progress is saved in your browser.

Go deeper

These primers are a starting point. Read the primary sources to build real fluency.

Training Notes

What building this project taught me.

This is a flagged gap-priority module

Agentic engineering in production — evals, RAG, MCP — was the #2 self-identified gap across Tom's job-hunting skills scan, right behind Cloud Native Essentials' top gap.

The trace below is a common pattern, not a hypothetical

A model inventing a plausible-looking ID instead of calling a lookup tool first is one of the most frequently reported agentic failures in production systems — it is worth treating as a default risk, not an edge case.