Understanding AI Engineering Disciplines
AI engineering vocabulary is moving quickly. Prompt engineering, context engineering, harness engineering, loop engineering, and graph engineering can sound like competing labels for the same thing.
They are better understood as layers of system design.
Each layer appears when the layer below it reaches a practical limit. A stronger prompt does not fix missing information. Better context does not make tool execution reliable. A reliable single-agent loop does not automatically stay focused when it must research, act, verify, and route work over a long-running task.
The useful question is not, “Which discipline is the right one?” It is, “What am I actually engineering at this stage?”
The Five Layers

1. Prompt engineering: designing the request
Prompt engineering focuses on a single model interaction. You design the system instructions, examples, output format, and wording that shape one response.
This is the right starting point for a bounded task: summarise a document, classify an item, write a structured response, or transform text into a known format.
The constraint is simple: a prompt can only work with what the model can see and what it can do in that one interaction.
2. Context engineering: designing the information window
When response quality depends on the right knowledge being present, the problem becomes context engineering.
The work shifts to selecting and structuring what the model sees: retrieved documents, current state, conversation history, working memory, schemas, and instructions. Good context is not merely more context. It is the smallest relevant set of information that helps the model make a sound decision.
This is where information architecture becomes central. If the model receives stale, irrelevant, or conflicting material, an elegant prompt will not rescue the result.
3. Harness engineering: designing the operational environment
Good prompts and context are still not enough when a model needs to take action.
Harness engineering creates the runtime around the model call: tool access, state persistence, retries, error handling, permissions, sandboxing, and observability. It keeps a single run on the rails.
For example, an agent that updates a repository needs more than instructions. It needs a controlled way to inspect files, make a change, run validation, recover from a failed command, and record what happened. The harness defines those operating boundaries.
4. Loop engineering: designing verified iteration
Loop engineering makes work repeatable: discover, plan, act, verify, then retry or stop. The verifier may be a test suite, schema check, human review gate, or deterministic business rule.
A loop should have a clear boundary. When one agent must research, create, execute, and judge its own work, its context and responsibilities can become overloaded. That is the signal to split the work into clearer, specialised steps.
5. Graph engineering: designing the network
Graph engineering decomposes a monolithic workflow into specialised nodes connected by explicit edges.
- Nodes are scoped agents or deterministic functions. Each can have its own instructions, tools, and focused context.
- Edges define the permitted paths between nodes. Some are fixed rules; others are conditional routing decisions.
- Structured state passes the useful output forward without forcing every node to inherit a noisy conversation history.
The key skill is decomposition. Rather than asking how to make one agent handle everything, ask:
- Which responsibilities need their own bounded context?
- What information should cross each boundary?
- Which transitions should be enforced by code rather than left to model judgement?
- Where does a human decision need to sit in the graph?
Graphs are not an alternative to loops. A graph is often a network of smaller loops and deterministic steps, arranged so that responsibility and control are visible.
Closing Thought
The model is only one part of an AI system. Reliability comes from deliberately designing the information, runtime, iteration, and coordination around it. Start with the layer that fits the problem, then add structure only when the current layer reaches its real limit.
Further Reading
- The 5 Layers of AI Engineering — AI Builder Club
- Loop Engineering vs Graph Engineering: What Changed in AI — DevCompass
- 3 Years of Graph Engineering with LangGraph — LangChain
- Graph Engineering: Loops Inside a Graph, Explained — AY Automate