AI工程层次:从提示工程到图工程
From prompt → context → harness → loop → graph engineering:
From prompt → context → harness → loop → graph engineering:
The list keeps growing, and every new term gets treated as a replacement for the last one.
In reality, however, each layer wraps the one before it, and the cleanest way to tell them apart is to ask what a single unit of work looks like.
> Prompt engineering is the message:
The model remembers nothing before this call, so the prompt has to carry the full universe of what it needs. a role, the background, the instructions, a few examples, and a format.
When the output falls short, the skill is working out which ingredient lets you down, not rewriting the instructions every time.
The unit of work is one input.
> Context engineering is the memory:
Across many steps, the window is finite, and the available information is not, which forces a curation step. A curator keeps what matters, compresses what is useful but bulky, and drops the rest.
Good curation is mostly about knowing what to throw away, not packing more in.
The unit of work is what stays in the window.
> Harness engineering is the machine:
On its own, a model just generates text. The harness gathers what it needs, runs it, calls tools or sub-agents, and verifies the result with tests or a judge.
That verify step is the entire difference between calling an api and running an agent.
The unit of work is one pass through the machine.
> Loop engineering is the run:
One pass rarely finishes the job, so something has to decide whether to run the machine again. That decision needs a goal defined upfront, brakes like max iterations and budget caps, and a completion check that is automated rather than felt.
An agent that stops asking for tools has ended its turn, which is not the same as finishing the task.
The unit of work is the whole run.
> Graph engineering is the coordination:
Once several loops have to work together, you need to say what runs when, what runs in parallel, and who checks whom. Nodes do the work, edges decide what runs next, and shared state flows between them.
A single loop is just a one-node graph with an edge pointing back at itself, which is why graphs govern loops instead of replacing them.
The unit of work is the whole job.
Here is the part that ties it together.
Prompt and context both live inside the harness gather step. The harness is one pass, the loop decides whether to run that pass again, and the graph decides which loops run at all.
Zoom out, and the unit of work gets bigger. Zoom in, and you are back at the prompt.
That also tells you where to debug. Find the layer whose unit of work broke, then fix that layer.
The prompt is the easiest layer to edit, which is why it keeps taking the blame for failures that live three layers up.
My co-founder published a deep dive on graph engineering, covering the core idea, how to get started, shared state, routing you can trust, and when a graph is genuinely overkill.
Read it below.
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力