Generative AI Engineering
Generative AI engineering covers more than the words used to request a task. It also designs the evidence available to the model, its tools and permissions, result verification, recovery from failure, and the conditions that stop repeated work. This section follows those expanding concerns in four stages.
Start with the instruction
Prompt Engineering combines the objective, audience, source material, constraints, and output format into one request. Begin here to make the expected result and its completion criteria explicit.
Manage evidence and context size
Context Engineering designs the documents, history, constraints, and priorities surrounding the instruction. Use the following pages to separate different context-size problems:
- The Context Window and Its Limits: identify the information a model can process at once
- Why Quality Degrades in Long Conversations: detect stale information, buried instructions, and contradictions
- What Is Context Compaction?: reduce history to the state needed for the next stage of work
- What Is Prompt Caching?: reuse computation for an unchanged input prefix
Compaction reduces the amount of context. Caching reuses work for repeated input. They solve different problems and do not replace each other.
Connect the model to an execution environment
Harness Engineering connects a model to tools, permissions, checks, logs, and recovery steps. The AI Agent Stack provides a layer-by-layer map of models, retrieval, memory, tools, protocols, and evaluation.
Make repeated execution stop safely
Loop Engineering defines the size of each attempt, completion criteria, carried state, retry pace, and stop conditions. A harness controls how one attempt runs; a loop controls how many attempts run and when control returns to a person.
For focused treatment of individual components, continue to Memory, Tool Use, Skills, and Hooks.