Skip to content

Learning harness engineering with LangChain Deep Agents (1/10)

Published:
• 5 min read

A friend asked how I would evaluate a long-running agent that burns thousands of turns and tool calls. I did not have a good answer. The agents I have shipped are mostly vertical B2B agents, not coding agents that run for a long time. This series is me learning that in public, on LangChain’s Deep Agents harness.

What I want out of the ten weeks

Deep Agents is an open source harness. I am working from my own fork. By harness I mean the agent loop plus the primitives a modern coding agent needs: sub-agents, a filesystem, context management, a shell, skills.

The plan for the series:

  1. Read the Deep Agents harness until the pieces fit together.
  2. Get comfortable evaluating long-running agents, using LangSmith to read traces.
  3. Run it on a public benchmark. τ-bench is the one I have in mind. I have not picked yet.
  4. Change the harness and see if the score moves, ideally on a weaker model where the failure is easier to see.

Coding-agent harnesses (Claude Code, Codex, and the rest) are ahead of most other agents. They are a good place to study. I wrote a shorter version of the design principles, from a different talk, in harness design for software development. This series is the code.

Three layers

The core loop is still model, tools, and repeat. The scaffolding around that loop is what lets a stronger model finish a long task reliably. When a lab ships a more capable model, they also have to ship the primitives that show the model off: instructions, memory, skills, a filesystem, compaction.

Deep Agents sits on three layers. From the bottom:

  1. LangGraph runtime. This is the engine. It stores each step of the loop so a run can resume if something fails.
  2. LangChain framework. The interfaces: a chat model (I can pass GPT-4.1 mini or something stronger), tools as functions, and external tools such as Tavily for web search.
  3. Deep Agents harness. Middleware and a backend on top of those two. It injects memory, skills, the filesystem, and sub-agents, and it handles summarization.

A deep-research agent, as the example

Week one uses the deep-research example in the Deep Agents repo. It is the same shape as a ChatGPT-style deep research run, simpler than the production version.

The orchestrator is built from a model, tools, a system prompt, sub-agents, backends, and skills. The instructions tell it to plan, save that plan as a todo list, spawn dedicated research sub-agents, synthesize, and verify. A research sub-agent does not spawn further agents. It can search and it can think, and it can loop for a while. The parent can spawn as many as the task needs.

Give it “quantum computing breakthroughs in 2024” and the model, not me, decides the split: history, current results, outlook. Each sub-agent searches and thinks until it is done. The parent writes the report. In agent.py that is a small constructor. The research workflow lives in the system instructions the agent actually follows.

What the LangSmith trace showed

I ran that prompt in LangSmith with GPT-4.1 mini. The waterfall was about 60 seconds.

The report itself was not the lesson. The lesson is that a short prompt becomes a long trajectory the model invents. Traces get huge, and the agent picks its own path. Evaluating that, with an LLM judge and with a human reading the trace, is the actual harness-engineering skill. You cannot babysit every step. You change the instructions and the tools so the next run is more reliable.

What week two is for

Next I want a verifier skill on this same research agent: an independent check of the report, then a look at the traces. I want to compare when GPT-4.1 mini invokes that skill with when a stronger model (I am planning to use GPT-5.5) does. As models get better they eat parts of the harness. The harness for a task you already understand should get thinner. The tasks you point the agent at should get more ambitious, because the model can finally hold them.

Subscribe for new posts to land in your inbox. No spam, ever.



Related