Loop Engineering: The Discipline After Prompt Engineering
Prompt engineering was the first stage of maturity for AI tools.
We learned how to talk to the model. How to give it context. How to constrain the output. How to ask for a format, a role, a style, a plan.
That was useful. But it was never the final discipline.
A prompt is an input. An answer is a hypothesis. Engineering begins after that: when the result must be checked, when the ac must leave evidence, when the system must understand what changed, and when the next step must become better than the previous one.
This is where a new discipline appears: loop engineering.
Not better promp. Not another chat wrapper. Not the fantasy of a fully autonomous agent that magically finishes work.
Loop engineering is the design of closed execu cycles where AI does not merely respond, but participates in a controlled engineering process:
intent → plan → ac → observa → verification → memory → next ac
This is the shift from conversa to runtime.
Prompt engineering optimized the input
Prompt engineering existed because early AI productionts were mostly conversaal.
The model had a text box. The human had a task. The prompt was the bridge between them.
A weak prompt productioned a weak answer. A precise prompt productioned a better answer. So we optimized prompts: instrucs, examples, roles, schemas, constraints.
But prompt engineering has a ceiling.
It improves the moment of 生成, but it does not solve execu.
A model can write a plan and never test it. It can generate code and never run it. It can explain a bug without reproductioning it. It can say “done” without productioning a single artifact that proves the work.
Prompt engineering teaches the model how to answer.
Loop engineering teaches the system how to work.
The loop is the real unit of AI work
In real engineering, value is not created by one answer.
Value appears through a cycle:
- understand the task;
- inspect the current state;
- make a bounded change;
- observe what happened;
- verify the result;
- preserve the useful state;
- decide the next step.
That loop is what turns intelligence into progress.
This is why modern agent systems are moving toward stateful execu: persistent context, checkpoints, interrupts, traces, tool observas, evals, and human control points.
The important shape is no longer:
user → model → answer
It is:
goal → state → tool call → observa → decision → checkpoint → next step
The model is not the productiont. The loop around the model is the productiont.
Observa is what chat was missing
A chat model lives mostly in language.
An engineering agent must live in observas.
A file changed. A test failed. A server returned 500. A build passed. A linter found a regression. A user interrupted the run. A metric moved in the wrong direc.
These are not “messages”. They are system reality.
Without observa, an agent can only narrate work. With observa, it can participate in work.
act → observe → adjust
That small loop is more important than a larger context window. A longer context can hold more text, but it does not automatically know what is true. Observa anchors the model to reality.
Verifica is more important than confidence
The most dangerous thing about AI is not that it is sometimes wrong.
The dangerous part is that it can be wrong with perfect confidence.
In loop engineering, confidence is not enough. The loop must demand evidence.
Code is not finished until it runs. A fix is not real until the failure disappears. A deployment is not safe until the system responds. A generated document is not complete until it satisfies the requirements it was created for.
The mature agent does not merely report comple. It returns artifacts:
- logs;
- diffs;
- tests;
- screenshots;
- HTTP responses;
- metrics;
- traces;
- checkpoints.
Artifacts are how AI systems earn trust.
Human-人在回路中的loop is not a weakness
There is a naive version of autonomy that tries to remove the human completely.
I do not think that is the right direc.
A serious AI system does not remove the human. It places the human at the correct points in the loop.
The human should not approve every tiny step. That turns automa back into manual labor.
But the human must appear where risk changes: before data dele, public deployment, financial ac, API migra, security-sensitive modifica, or any irreversible opera.
Human-人在回路中的loop is not a limita of autonomy. It is an architecture of responsibility.
A weak system asks too often. A dangerous system never asks. A mature system knows where control belongs.
Memory is not a transcript
Many AI productionts call a long chat history “memory”.
That is not enough.
A transcript is just accumulated text. Engineering memory must be filtered, durable, and useful for the next loop.
It should not store every detail. It should store what reduces future fric:
- stable project constraints;
- verified workflows;
- recurring failure modes;
- quality gates;
- environment facts;
- user preferences that change how work should be done.
Memory is valuable only if the next loop becomes shorter, safer, or more accurate because of it.
Otherwise it is just noise with a longer reten period.
Evals make loops improve
Without evalua, a loop can move forever without get better.
For code, evals may be tests, type checks, linters, benchmark numbers, review rules, or runtime checks.
For content, they may be editorial criteria, SEO constraints, factual checks, tone consistency, or localiza quality.
For agents, evals become traces: which tools were called, which observas were received, where the plan changed, what succeeded, what failed, and what required human interven.
The ques is not only “did the model answer?”
The better ques is:
did this loop reduce uncertainty?
That is the metric that matters.
The future is runtime, not chat
Chat was the right first interface. It made AI approachable.
But serious AI engineering needs a runtime.
A runtime gives the task state. It gives acs boundaries. It gives observas structure. It gives verification a place in the process. It gives memory rules. It gives humans control points. It gives failure a recovery path.
The next 生成 of AI tools will be judged less by how impressive a single response looks and more by how reliable their loops are.
Can the system continue after interrup? Can it show its trace? Can it roll back? Can it prove that work was done? Can it learn without pollu itself with noise? Can it let the human control risk without slowing down every safe step?
These are not UI details. They are the architecture of usable AI.
After promp comes loop design
Prompt engineering asked:
how do we get a better answer?
Loop engineering asks:
how do we design a process where every step makes the system more reliable?
That is a more important ques.
Because AI can generate answers endlessly. Answers are cheap. Trust is not.
The future will not belong only to people who write clever prompts. It will belong to people who can design execu loops: observable, interruptible, verifiable, recoverable, and aligned with human responsibility.
We are no longer just promp models.
We are engineering the cycles in which models act.