When to Build Your Own Agent Harness | Harrison Chase, LangChain
In a Nutshell
The decision to build a custom agent harness depends on how far your use case sits from models' training distributions: in-distribution tasks work fine with off-the-shelf harnesses like Claude Code or Codex, while out-of-distribution tasks require custom harnesses that keep in-distribution sub-tasks (e.g., file editing) close to the model layer through model profiles and middleware. Core harnesses share the same loop—LLM calling tools with observations fed back—but differ in their middleware hooks for context management, summarization, sub-agents, and external system integration. Success hinges on a data flywheel powered by evals and observability: track traces, collect feedback via environment or synthetic judges, then iterate on harness code, model fine-tuning, or context updates to compound intelligence over time.
These notes were generated by AI and may contain inaccuracies.
Harnesses are an important topic as many organizations are currently building their own. Harrison Chase, co-founder and CEO of LangChain, was one of the first people thinking about building harnesses around models in the 2022 GPT-3 era. The goal was to move models beyond simple auto-complete tasks to function as virtual collaborators or agents.
When discussing intelligence in the context of agents, LangChain identifies three main parts: the model, context, and harness. Owning your intelligence means controlling all three components.
Model ownership involves the ability to switch between different models to avoid lock-in and use the best available model. Context ownership includes all information the agent uses, such as memory, semantic knowledge, and previous conversations, which help personalize and guide the agent.
The harness is the primary focus, as it orchestrates the model and context together.
The main job of a harness is to bring context to the model at the right point in time. It orchestrates fixed context and dynamic context, bringing them into the model's context window, receiving responses, and processing the output.
Agents need to interact with external systems, which emit more context that feeds back into the agent loop. The harness orchestrates all these interactions together.
The simplest agent architecture is an LLM running in a loop calling tools. A request comes in, the LLM makes a generation that may include a tool call, the tool is invoked, and the observation is passed back to the LLM. This core loop forms the architecture behind virtually every agent today.
Sign in to read the full notes
Get access to AI-generated notes, topic timestamps, and more.