What do loop engineering and graph engineering actually mean? A plain-language glossary

6 min read

What do loop engineering and graph engineering actually mean? A plain-language glossary

In 2026 the vocabulary around AI agents changed fast. "Prompt engineering" gave way to context engineering, then harness engineering, then loop engineering in June, then graph engineering in July. If you missed a few months, the conversation can sound like a different language.

This glossary is the first part of a short series. It defines every term the later posts use, from zero, in the order you will need them. If you are new to agents in general, the AI agents glossary covers the basics, such as what a tool call is.

Animation: the ladder of 2026 terms, from prompt to context to harness to loop to graph engineering, each wrapping the one before.

The layers

Prompt engineering. Choosing the words of a single request to a model.

Context engineering. Choosing everything the model sees for a request: which files, documents, history and tool results go into its context window.

Agent. A model that can call tools and decides its own next step until a task is done.

Agent loop. The cycle inside one agent run: the model picks an action, a tool runs, the model reads the result, and it repeats until a stop condition. This blog's agent loop explainer walks through one.

Harness. The software wrapped around a model to make it an agent: the tools, permissions, prompts and the agent loop itself. Jediah Katz, who worked on Cursor's harness, described it at AI Engineer as the eyes and hands of the model, and splits it into a runtime layer and a context and orchestration layer.

Loop engineering. Designing a system that runs agents repeatedly, instead of a person prompting them by hand: what starts each run, how to tell when the work is done, what is remembered between runs and when a human steps in. Full explanation: What is loop engineering?

Graph engineering. Designing agent work as an explicit graph, where nodes do work and edges route state between them. The definition is Zachary Blumenfeld's, from his AI Engineer talk. Full explanation: What is graph engineering?

Loop terms

Trigger. What starts a run: a schedule, a new issue, a failing build, a comment.

Stop condition. A rule, ideally checkable by code, that says the loop is finished. "All tests pass" is one. "Make it better" is not.

Verifier. A separate check that judges the agent's output. It can be plain code (tests, a linter) or a second agent. Writers on loops often call the pair the maker and the checker.

State file. A file where the loop records its progress, because each new run starts with an empty conversation.

Budget. A hard limit on tries, time or tokens, after which the loop stops and asks a human.

Ralph loop. A bash loop, popularized by Geoffrey Huntley in 2025, that feeds the same prompt to a coding agent over and over. It is the simplest possible loop and the ancestor of the idea.

Control loop. A loop borrowed from control theory, as in a thermostat: a sensor measures the current state, a controller picks a small change, an actuator applies it, then you measure again. Kyle Mistele of HumanLayer argues agent loops should be built this way.

Set point. In a control loop, the state you want to reach, such as "no files use the old API".

Graph terms

Node. A step in a graph. It can be plain code, one model call, one tool call or a whole agent.

Edge. The rule for what runs after a node. A fixed edge always goes to the same next node. A conditional edge chooses based on the state.

State. The shared data passed along the edges, such as the request, intermediate results and a retry count.

State machine. A system that is always in one of a set of named states and moves between them by rules. LangChain says to think of an agent graph as one.

DAG. A directed acyclic graph: work only flows forward, never back. Agent graphs are usually not DAGs, because a failed check often has to send work back to an earlier step.

Cycle. A path in a graph that returns to an earlier node, such as draft, check, draft again. A loop is the simplest graph with a cycle.

Map-reduce. A pattern where a graph fans one task out to many parallel nodes, then combines the results.

Terms from the inner and outer loop debate

Inner loop. One agent working on one change: edit, run the checks, fix, repeat.

Outer loop. The system that decides which work happens: finding bugs, starting agents, merging and releasing. Lauren Tan's AI Engineer CODE talk argues you should fix the inner loop first. See how one team merges 11,000 agent pull requests a month.

Slop. Low-quality code or text produced in bulk by models. Automating a loop that produces slop produces more of it.

Deterministic check. A check that always gives the same answer for the same input, such as a type checker or lint rule, as opposed to asking a model.

Verification artifact. Evidence that a change works, such as a screenshot, a video of the app running or a test report, which a reviewer looks at instead of reading every line.

Software factory. A popular name for a setup where agents produce most of the code with little human review. Tan says she prefers to think of it as trust.

Read the series in order

  1. This glossary
  2. What is loop engineering, and why did developers stop prompting their agents?
  3. What is graph engineering, and is it just loops with a new name?
  4. Loop or graph: which should you build your AI agent on?
  5. How does one team merge 11,000 agent pull requests a month without drowning in slop?

To build these pieces in code, the Build an AI Agent in Python course starts from a single API call.

Sources