LangChain's 'Loop Engineering': agents as four stacked loops, from tool calls to hill climbing
bibryam · x · 2026-09-25
LangChain's Sydney Runkle argues in a new post that agent engineering is "a stack of loops," building on swyx's loopcraft idea. The four levels:
- Loop 1 — Agent: the core loop of an LLM calling tools until done (LangChain's createagent), illustrated with an internal docs agent that drafts changes and opens PRs.
- Loop 2 — Verification: wrap a grader around the agent that checks output against a rubric and retries failures for consistency.
- Loop 3 — Event: trigger the whole pipeline to run at scale via events.
- Loop 4 — Hill climbing: improve the harness itself from production traces.
Key claim: reliable agents need a task-fitted harness, not just a good model, and value compounds in the outer loops. The post shows how to instrument each level with LangChain/LangSmith primitives.
More from coding & agent
- AMD's software VP on ROCm's open toolchain and AI agents writing GPU code — AnushElangovan · 2026-09-25
- Building agents for cloud infra: why one bad terraform destroy beats a bad email — Helpful-Man64 · 2026-09-25
- Everyone solved AI code review, nobody solved what happens after merge — trvklhn666 · 2026-09-25
- When AI agents check out off-store, what proof do merchants need to trust it? — ConvertMyStore · 2026-09-25
- Stop Fixing AI Mistakes: Feed Models Your Context, Says Dev Strategy Thread — chaseleantj · 2026-09-25
- fable-advisor ships setup command to max out Claude and ChatGPT subs at once — daniel_mac8 · 2026-09-25