# 2. Prompt and Context Engineering

```{raw} html
<p class="wk-lede">The chapter 1 agent writes a good memo for the question you scripted. This chapter makes it work for real clients, in two parts taught in the same session.</p>
```

```{raw} html
:file: widgets/goal-map.html
```

- **[2.1 Prompt Engineering](ch02-prompt-engineering.md).** Write the standing instructions the model reads first: role, rules, format and examples. Then find where a prompt stops working.
- **[2.2 Context Engineering](ch02-context-engineering.md).** Decide what the model reads on each call, including earlier turns, have code put it there, and hand independent jobs to sub-agents with a clean desk.

Each part has its own Colab notebook.

(ch02-lecture)=
## Watch the lecture

The session 2 recording, covering both parts. Watch it before or alongside 2.1 and 2.2; the slides are linked below the video.

```{raw} html
<figure class="wk-intro-video">
  <iframe src="https://www.youtube.com/embed/6wJaIfLtamU" title="Session 2 · Prompt and Context Engineering" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
  <figcaption>Session 2 · Prompt and Context Engineering · 1 h 41 min · <a href="https://youtu.be/6wJaIfLtamU">Open on YouTube</a> · <a href="https://github.com/ashcastelinocs124/Workshop-Slides/blob/main/AI/education/workshop-lecture/workshop-2-prompt-context-engineering.pdf">Slides (PDF)</a></figcaption>
</figure>
```

