AI Agent Architecture: Thin Harness, Fat Skills, and Memory Layer Design
The “Thin Harness, Fat Skills” principle separates an AI agent’s execution controls from its domain-specific knowledge. This article explains what belongs in the harness, what makes a skill reusable, and how a governed memory layer supports long-term collaboration without confusing persistence with determinism or stored history with learning. It also covers validation, controlled skill updates, and practical architecture evaluation.
1. The Core Principle: Reduce Coupling, Not Essential Controls
AI agents typically need to understand a task, choose an execution path, invoke tools, check results, and continue based on feedback. When all of this logic lives inside a single runtime framework, adding a business scenario often requires changing orchestration code, introducing special cases, and adjusting prompts. As the system matures, its main execution flow can become harder to understand and test.
“Thin Harness, Fat Skills” addresses this mixing of responsibilities:
- The harness owns general execution mechanisms, including the execution loop, state management, tool-call boundaries, and runtime constraints.
- Skills own domain-specific task knowledge, including procedures, input requirements, validation rules, and exception handling.
- Task-specific differences should be expressed through skills wherever possible, rather than through an expanding set of business branches in the harness.
“Thin” does not mean minimizing code at all costs. It means keeping substantial business knowledge out of the harness. Likewise, “fat” does not simply mean having more skills. Each skill should contain sufficiently complete task semantics and execution constraints.
A harness with only a few lines of orchestration code but no authorization controls or failure handling does not meet this principle. It merely transfers complexity and risk into an uncontrolled execution process.
2. Where the Harness Should Be Thin—and Where It Must Not Be
Remove Business-Specific Details
Consider a document-processing agent that both organizes meeting notes and reviews contract clauses. If its harness directly contains rules such as “meeting notes must identify responsible owners” or “contract reviews must identify validity periods,” the harness has begun to own domain knowledge.
A better approach is to place those rules in the corresponding skills. The harness only needs to know how to load a skill, prepare its inputs, execute its steps, and receive its results. It does not need to understand the full business meaning of every document type.
This separation offers three immediate benefits:
- Skills can be modified and validated independently, reducing the impact of changes.
- The same harness can support more tasks without frequent restructuring.
- Domain experts can maintain skill rules without understanding every runtime mechanism.
Retain Essential Execution Controls
Moving business knowledge out of the harness does not mean allowing skills to decide whether basic safeguards apply. The following mechanisms must remain centrally enforced:
- Identity and authorization checks;
- Limits on tool access and invocation;
- Time, resource, and cost budgets;
- Cancellation, timeouts, and failure recovery;
- State recording and auditing;
- Confirmation workflows for high-risk operations;
- Basic input and output validation.
External write operations—such as modifying records, sending notifications, or deleting files—must not bypass authorization simply because a skill describes them as necessary steps.
A thin harness is therefore best defined as domain-neutral but strong enough to control execution.
3. Fat Skills Are More Than Long Prompts
A skill may consist of documentation, task templates, examples, validation rules, executable code, or some combination of these. Its completeness depends on how well it encapsulates the task’s essential knowledge, not on file length or the number of skills in the system.
A maintainable skill should specify at least the following:
| Component | Questions It Should Answer |
|---|---|
| Scope | Which tasks should use this skill, and which should not? |
| Input constraints | What data is required, and what happens if it is missing? |
| Execution steps | Which steps are mandatory, and which can be adapted? |
| Tool boundaries | Which resources may be read or modified? |
| Output contract | Which fields or supporting evidence must the result contain? |
| Validation criteria | How can the system determine that the task is actually complete? |
| Failure handling | When should execution retry, stop, or request human intervention? |
| Version information | What rules changed, and how can the changes be rolled back? |
For example, “generate a report” is a capability label, not a complete skill. A reusable reporting skill must also explain how to handle insufficient source material, distinguish facts from inferences, retain supporting references, and validate the final result.
More complete skills generally leave less room for runtime guesswork. However, more detail is not always better. Irrelevant instructions increase context overhead, while excessively rigid procedures can prevent the agent from handling legitimate task variations.
Skill design therefore requires a balance between completeness and adaptability.
4. Skill Persistence Does Not Guarantee Deterministic Execution
A common misconception is that because a skill can be stored permanently, every invocation will produce the same result.
These are separate properties.
Persistence means that a definition survives the end of a session. Determinism means that execution produces consistent results under the same specified conditions. A persistent skill may still involve model reasoning, dynamic retrieval, or external service calls, all of which can introduce variation.
Even when the input text is identical, other conditions may differ:
- The underlying data may have changed.
- Model generation may involve randomness.
- External systems may be in a different state.
- Retrieved context may differ.
- Tool versions or configurations may have changed.
Skills improve process reuse, make constraints explicit, and increase behavioral predictability. They do not inherently guarantee that identical inputs will always produce identical outputs.
Where strong consistency is required, prefer verifiable rules or deterministic computation. Where judgment, summarization, or generation is necessary, reduce uncertainty through structured outputs, evidence checks, and result validation.
5. Why Agents Need Memory in Addition to Skills
Skills describe “how this task should usually be done.” Memory supplies “which historical information matters for this user, project, and environment.”
Without state that persists across tasks, an agent may repeatedly ask for the same preferences, rediscover the same execution paths, or encounter problems it has already identified—even after handling several similar tasks.
This does not mean every task needs long-term memory. For one-off, low-risk tasks with complete context, stateless execution may be simpler and easier to manage from a privacy perspective.
Memory becomes more valuable when the system supports ongoing collaboration. It can:
- Preserve explicitly stated output preferences;
- Maintain project terminology, constraints, and confirmed decisions;
- Record conditions under which tool calls fail;
- Store validated approaches to solving tasks;
- Carry forward unfinished work.
This information can influence skill selection, input preparation, and validation, helping the same skills fit the current situation more closely.
Importantly, memory usually changes the context of later executions. It does not imply that the model’s parameters have learned automatically or that a skill definition has been updated.
6. Memory Must Be More Than an Ever-Growing History
Saving every conversation, tool output, and execution log demonstrates recordkeeping, not necessarily effective use of experience.
Raw history often contains noise: temporary requests, outdated facts, incorrect inferences, repeated information, and sensitive data that should not be retained long term. Continually adding this material to the context can increase cost, distract the model, and compound errors.
An effective memory layer must address four questions.
What Is Worth Saving?
Prioritize information that has future value, a clear source, and a basis for verification.
For example, an explicit request to “put conclusions before analysis in future reports” is a reasonable candidate for a stored preference. A task-specific remark such as “keep this one simple” should not necessarily become a long-term preference.
How Should Information Be Organized?
Memory can be divided into several categories:
- Task state: Current progress, incomplete steps, and items awaiting confirmation.
- Facts: Project constraints, relationships between entities, and confirmed decisions.
- Preferences: Habits explicitly stated or confirmed by the user.
- Experience: Validated failure conditions and ways to improve execution.
These categories need different lifecycles. Task state may expire when the task ends. Project constraints may need updating when the project changes. Users must be able to revise their preferences at any time.
What Should Be Forgotten?
Forgetting is a governance mechanism, not merely data deletion.
Expiration, reduced retrieval priority, consolidation, and archiving can help manage low-value information. Experience that no longer applies should stop influencing decisions. Conflicting memories should not be resolved solely by letting the newest entry overwrite everything else.
Updates should account for source authority, scope, explicitness, and time validity.
How Can Memory Contamination Be Prevented?
Instructions found in external documents, unconfirmed conclusions, and the agent’s own guesses should not enter high-trust long-term memory directly.
Before writing memory, check the source, authorization, sensitivity, and supporting evidence. In particular, do not store commands from untrusted material as “user preferences” or “system rules.” Otherwise, a single contaminated input could influence many subsequent tasks.
7. A Complete Collaboration Loop
From an engineering perspective, the system can be divided into three logical components: harness, skills, and memory. They do not have to be deployed as three separate services.
Their interaction can be represented as follows:
Receive task↓Validate identity, authorization, and execution budget↓Retrieve memory relevant to the current task↓Select a skill and prepare inputs↓Execute under harness constraints↓Validate results and actual state↓Extract candidate experience↓Review and update memory
The most important boundary is: memory provides context, skills provide methods, and the harness enforces constraints.
A memory stating that an action was previously allowed does not authorize that action now. Skill instructions also cannot override the current user’s explicit requirements or higher-priority safety rules.
The following pseudocode illustrates these responsibilities; it does not represent a specific product interface:
process_task(task, user):constraints = check_authorization_and_budget(task, user)context = retrieve_valid_memory(user, task)skill = select_applicable_skill(task, context)inputs = prepare_and_validate_inputs(task, skill, context)result = execute_under_constraints(skill, inputs, constraints)validation = check_result_and_external_state(task, result)candidate_memory = extract_reusable_information(task, result, validation)review_and_save(candidate_memory, user, constraints)return_result_and_validation_status(result, validation)
“Execution has ended” and “the task is complete” must remain distinct concepts. A successful tool response does not necessarily mean the business objective has been achieved. Producing a summary does not establish that its facts are correct.
Reliable validation is the foundation for extracting trustworthy experience.
8. Promote Experience into Skills Through a Controlled Process
Memory can capture an approach that worked in one task, but a single success does not establish that it is suitable for every situation.
If an agent modifies its skills after every execution, it may quickly accumulate overfitted rules. For example, skipping a check once because source material was missing does not justify making “skip the check” part of the general procedure.
A more reliable process is to:
- Save the discovery as candidate experience with a defined scope.
- Validate it in subsequent tasks or a test set.
- Check whether it was a coincidence or specific to one environment.
- Turn stable experience into a proposed skill update.
- Publish a new version after review.
- Retain rollback capability and monitor its actual effects.
Memory supports fast, local adaptation. Skills provide validated, reusable procedures. They complement one another rather than replacing one another.
9. How to Evaluate Whether the Architecture Works
A shorter harness, more skills, or a larger memory store is not sufficient evidence of success. Evaluation should focus on task outcomes and system risk.
Harness Evaluation
Assess whether new business scenarios require frequent changes to the main execution flow, whether authorization rules are enforced consistently, whether failures can be diagnosed, and whether execution can resume safely after interruption.
For operations with side effects, also check whether retries can cause duplicate writes.
Skill Evaluation
Assess whether each skill has a clear scope, stops appropriately when required inputs are missing, produces verifiable outputs, and can be updated without degrading other tasks.
Memory Evaluation
Assess whether retrieved information is genuinely relevant, stored preferences are accurate, outdated records continue to distort decisions, incorrect experience can be revoked, and information leaks across users or projects.
End-to-End Evaluation
Under equivalent task conditions, compare executions with and without memory. Examine task success rates, correction counts, repeated questions, execution overhead, and error types.
Memory’s benefits must be demonstrated through evaluation, not inferred from design intent. Dynamic environments also require ongoing reassessment, because previously useful experience can become invalid.
10. Conclusion: Stable Responsibilities, Bounded Experience
The real value of “Thin Harness, Fat Skills” is the separation of general execution mechanisms from domain knowledge. This allows an agent to expand its capabilities without turning the main execution flow into a collection of business rules.
However, reusing skills does not automatically accumulate experience, and saving history does not automatically produce effective learning. Better long-term collaboration also requires memory selection, trustworthy validation, lifecycle management, and controlled updates.
A robust design meets three conditions: the harness enforces execution boundaries, skills capture verifiable methods, and memory supplies context with clear sources that can be corrected or allowed to expire.
The goal is not a system that never forgets. It is a system that uses the right information when needed and stops relying on experience that no longer applies.
