Chapter · AI

Prompting & Context

Everything you do at inference time to get more out of a model. The structure of a good prompt, the surprises of in-context learning, and the failure modes that emerge when context gets long.

Topics
Topic 1

Prompting Fundamentals

The repeatable structure of a prompt that works — system, instruction, examples, constraint.

Planned
Topic 2

In-Context Learning

Teaching a model a task using only examples in the prompt — and why it works at all.

Planned
Topic 3

Chain-of-Thought & Reasoning

Asking the model to think out loud, and why it improves accuracy on hard problems.

Planned
Topic 4

Prompt Caching

Reusing the KV state for prefixes you send repeatedly — the latency and cost win.

Planned
Topic 5

Context Engineering

Designing the whole input — system prompt, history, tools, retrieved docs — as one coherent system.

Planned
Topic 6

Context Pathologies

Rot, drift, lost-in-the-middle — and the limits of long-context windows in practice.

Planned
Topic 7

Prompt Injection & Jailbreaks

The security surface where untrusted text meets a trusting model.

Planned