Back to Devoured - July 20, 2026
DEVOURED
Domain-specific harnesses

Domain-specific harnesses

Tech Alan Yahya
The future of domain-specific AI lies in modular harnesses and memory management rather than fine-tuning individual model weights.
What: Alan Yahya argues that instead of building custom domain-specific models, developers should use 'harnesses'—modular systems that handle tool selection, memory, and task planning—while using general frontier models for the underlying inference.
Why it matters: This shifts the focus from model training to systems engineering, where the intelligence is derived from the environment, context, and tooling provided to a stateless model.
Takeaway: If you are developing a domain-specific agent, evaluate modular harnesses like 'pi' rather than attempting to fine-tune a model from scratch.
Deep dive
  • Transition from model-centric to harness-centric: Specialization is moving into the environment surrounding the model.
  • The role of the harness: Manages memory, instructions, permissions, and tool execution.
  • Memory as a domain-specific asset: Codifying information into graphs or ontologies allows the agent to navigate domain-specific hierarchies effectively.
  • Tooling as interface: Using search, file access, and APIs to enforce domain-specific workflows and validation.
  • The trade-off: While post-training model weights can provide slight performance gains, the diminishing returns favor general models with robust agentic workflows.
Decoder
  • Harness: A software layer or wrapper that provides a model with instructions, tools, and memory, effectively turning it into an agent.
  • Stateless model: A model that does not retain knowledge of previous interactions unless the state is explicitly provided in the current prompt or context.
  • Compaction: The process of maintaining a model's working context by selecting which information to persist and which to discard.
Original article

Domain specific harnesses

The idea used to be a domain specific language model. It was theoretically sound: build a tokenizer that could represent in-domain tokens effectively, pre-train or fine-tune model weights on in-domain language, and build a specialised model.

But domain specific large language models never really took off. There was always the trade-off, loss of generality, which would hurt the system. Small language models built for a specific task, like classification fared better, but most demand is for a single model

Now, we see that different workloads perform better with certain combinations of model and harness. There are a number of modular less opinionated harnesses that can be forked (like pi), and numerous enterprise harnesses are already open source (codex, qwen code, opencode, gemini cli, grok build, and so on), so the building blocks are there.

The harness manages memory, controls how the model retrieves information, and how it plans work and uses tools. A model is stateless and the harness supplies the instructions, permissions, context, and tools it needs. We no longer rely on specialisation centred around model weights, and move it further into the environment around the model.

Memory handles how an agent codifies and persists information. Memory is a clear target for domain-specific applications as the hierarchy of information per-domains can be specified as a graph or ontology.

Compaction has to handle the model’s working context by maintaining a durable state. This includes retrieval, instructions, task state, checkpoints, and links to the memory system. Specifically for us, what it preserves, how it represents it, and what it is allowed to discard. If i’m working in IE a legal domain, I will not discard raw file references- I will persist an artifact that allows the model to explicitly look up the original text. Whereas if i’m working in another domain where a conceptual summary is more important i’ll allow the agent to do so.

Tools provide the model with ways to observe or change the outside world: search, file access, code execution, APIs, databases, and so on. They can encode domain-specific inputs and outputs, operations and validation loops. This allows us to enforce the correct use of domain-specific data, or force the agent to cross-reference a database before making a change, and so on.

The counter-argument to the domain-specific harness is that each frontier model provider post-trains their model on their harness. That is, which tools to call, when to call them, what arguments they expect, how validators respond, how to recover from errors, when to use memory, and so on. And there will always be some juice to be gained from adjusting model weights to its environment. But given the current general capability of models, the importance of this is diminishing, just as with domain-specific fine tuning, and a retry loop with a comprehensive error message will mean that most models never get a tool call wrong a second time.

Explore all 65 articles in today's digest

Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi