Prompting & Context Engineering
Prompting is one layer; context engineering is the larger discipline. Prompt engineering asks how do I phrase the request? Context engineering asks what should the model know when it processes that request? — system prompt, examples, retrieved docs, tool outputs, history, and output shape, all assembled into a finite context window.
As systems moved from single chats to RAG and agents, leverage shifted from clever wording to what goes into the window and in what order. This branch covers both.
Mental model
Context engineering constructs the model's temporary information environment. Instructions, examples, retrieved evidence, tool schemas, history, constraints, and output format compete within a finite window; their provenance and ordering shape behavior without changing weights.
Roadmap: reframe and basics
Core techniques
- Zero-shot & few-shot
- Chain-of-thought & when not to use it
- Structured outputs (JSON & schemas)
- Task decomposition & prompt chaining
- Self-consistency & sampling
Engineering the context
Discipline
Connects to: Retrieval and Knowledge · Agents and Tools · Prompt Regression Testing
Core sources
- Anthropic prompt engineering overview — current instruction, examples, XML, and chaining guidance.
- Anthropic context engineering for agents — context selection and compaction for long-running systems.
- OpenAI Cookbook — executable structured-output, tool, and evaluation patterns.
- Chain-of-Thought Prompting — the primary paper for reasoning demonstrations in prompts.