1. Courses
  2. AI Engineering

AI Engineering line, station 2 of 6

LLM Apps: Prompts, RAG and Evals

Build reliable features on large language models: prompts, structured output, tool calling, retrieval (RAG) and evaluation.

  • 6lessons
  • 4 hto read and do
  • Intermediatelevel
  • 6podcast episodes
  • 8checked exercises
Start the courseCheck what you know

About this course

Calling a language model is easy. Building a feature that is right most of the time, fast enough, cheap enough and safe is the real job. This course teaches the core techniques of LLM engineering, and above all how to measure whether a change made things better.

You build the product-question assistant in the Mangrove app, the fictional grocery chain used across Kolom. It answers customers' questions about products, allergens, substitutes and delivery from Mangrove's own catalogue and help pages, returns structured data the app can render, calls tools to check live stock and delivery slots with the customer's own permissions, and is measured on a golden set of real customer questions before every release. Along the way you work out what each call costs, why allergen questions must never be answered from guesswork, and how a product description can carry a prompt injection.

Every lesson ends with code you can run: a provider-neutral API wrapper with retries, a validator for structured output, a tool dispatcher with permissions, hybrid retrieval with reciprocal rank fusion, an eval runner that fails CI when quality drops, and a cost model. Auto-checked JavaScript exercises run in your browser, and each lesson has a podcast episode for the bus ride.

What you will be able to do

  • Explain tokens, context windows, sampling and streaming, and estimate what a feature costs per 1,000 questions
  • Write system instructions and JSON schemas that give consistent, structured output, and validate every reply before the app uses it
  • Connect a model to real data with tool calling and the Model Context Protocol, with the user's permissions and no risky write tools
  • Build retrieval over your own documents with structure-aware chunking, hybrid search, rank fusion and reranking, and measure it with recall@k
  • Measure quality with a golden set, code checks and model grading, and block releases in CI when a category gets worse
  • Control cost and latency with caching and model routing, and defend against prompt injection and the OWASP risks for LLM apps

Syllabus

6 stops, about 4 h in total. Each stop fills in when you complete the lesson.

  1. How LLM APIs work

    Every feature in this course starts with one HTTP call to a language model. This lesson opens that call up: what goes in, what comes back, why the bill grows with every message, and how to keep the call fast and reliable when thousands of customers ask at once. By the end you will have a small, provider-neutral wrapper that the rest of the course builds on.

    35 minIntermediateEpisode1 exercise

    LLM APIsToken budgetsStreamingCost estimation

  2. Prompts and structured output

    The product-question assistant in the Mangrove app has to return something the app can render and a customer can rely on, including on allergens, where a guess can hurt someone. This lesson shows how to write system instructions that change behaviour, how to use examples, how to get JSON that follows a schema, and how to check every reply in your own code before a customer sees it.

    35 minIntermediateEpisode1 exercise

    Prompt engineeringStructured outputLLM APIs

  3. Tools and the Model Context Protocol

    With tools, the Mangrove app's product assistant can check live stock at the customer's store and list real delivery slots. This lesson shows how the tool-calling loop works, how to keep every call inside the customer's own permissions, and how the Model Context Protocol lets you write a stock tool once and use it from many AI apps.

    40 minIntermediateEpisode1 exercise

    Tool callingMCPLLM APIsStructured output

  4. Retrieval-augmented generation

    The product-question assistant now has a schema (llm-02) and tools for live stock and slots (llm-03). It still cannot answer "Can I pay cash for a Later slot in festival week?", because that answer lives in Mangrove's help pages. This lesson builds the retrieval that finds the right help section among about 600, quickly and fresh, and makes the model cite it or say it does not know.

    40 minIntermediateEpisode2 exercises

    RAGEmbeddingsHybrid searchReranking

  5. Evals: knowing if it got better

    You changed the prompt and three answers you tried look better. That tells you almost nothing. This lesson builds the engineering side of evals for the product-question assistant: eval cases stored as data, checks written in code, a model judge with a written rubric, retrieval scored on its own, honest numbers despite randomness, and a gate in CI that blocks a pull request when a category gets worse.

    40 minIntermediateEpisode1 exercise

    EvalsStructured outputRAG

  6. Cost, latency and safety

    The product-question assistant in the Mangrove app works and passes its evals. Before launch you need three more answers: what 1,000 questions cost, how long a customer waits, and what happens when someone, or some text, tries to make the model misbehave. This lesson gives you the levers for each and a plan you can defend.

    40 minIntermediateEpisode2 exercises

    LLM APIsEvalsLLM cost controlLLM security

  7. Capstone: Ship the product-question assistant

    A realistic project with a rubric and a model answer.

  8. Final exam and certificate

    10 questions drawn at random, 70% to pass.

Capstone project

Ship the product-question assistant

Customers ask the Mangrove app about ingredients, allergens, substitutes, delivery slots and returns, and today they wait for the call centre. Build an assistant that answers from Mangrove's catalogue and help pages (use the sample data you create, or your own small catalogue of at least 50 products and 20 help-page sections), returns a structured reply the app can render with cited sources, checks live stock or delivery slots with at least one read-only tool that takes the store and zone from the session, and hands over to a person when it cannot answer safely. Build a golden set of at least 40 questions across question types, including allergen questions with missing data and prompt injections hidden in product text, run it before launch, and estimate cost and latency per 1,000 questions from measured token counts.

You will hand in

  • A repository with the working assistant: retrieval, the prompt and output schema, one or more tools, and a README that explains how to run it
  • A golden set of at least 40 questions with results per question type, retrieval recall@k, and the release gates you chose
  • A cost and latency estimate per 1,000 questions from measured tokens and timings, with one cost lever applied
  • A one-page safety note: the injection and allergen cases you tested, what failed and what you changed
Open the project brief

Check what you know

Already know some of this? Answer 6 quick questions, one from each lesson, and we will mark the lessons you can skim. It takes about 3 minutes and nothing is graded.

Questions

Which model does it use?

It stays vendor-neutral. The code wraps any modern chat model API in a small function, and the lessons show how to compare models on your own golden set instead of trusting a leaderboard.

Do I need a paid API key?

No for the lessons: every exercise runs in your browser with fake model replies, so you can learn the mechanics for free. For the capstone you need some model to call; many providers have free or cheap tiers, and a small open model on your own computer works too.

What should I know first?

Comfortable JavaScript (async functions and JSON) and how a web request works. JavaScript Deep Dive and How the Web Works cover both. Designing AI features in AI Systems for Builders is a good short warm-up.

How is this different from Building AI Agents?

This course covers features built on a model: one question, one answer, maybe a tool call. Building AI Agents goes further: multi-step agents that plan, keep state, act through tools and ask for approval, and how to evaluate and ship them.

Is there an exam and a certificate?

Yes, and both are free. Each attempt mixes scenario questions with two hands-on tasks, such as writing the monthly cost estimate in JavaScript or putting the steps of a safe prompt fix in order. You pass with 70% on the questions and an average of 70% on the tasks.

Is it really free?

Yes. Every lesson, podcast episode, exercise, quiz, final exam and certificate is free. The labs and their templates for real work are free too. Plus and Premium add every lab challenge, weekly extras and a mentor on top, and they never lock the tools or the courses.

How long does it take?

Each lesson shows an honest time for reading and doing. Most people finish a course in two to four weeks at three or four hours a week.