AI Agent Architecture: Slimming Down the Harness and Strengthening Knowledge Management

    This article explains how to keep AI agent systems maintainable by separating a thin execution harness from rich, structured skills, and applies the same layering principle to knowledge management. You will see the four core responsibilities of a slim harness, how domain logic moves into versionable skill files, a real scaling lesson from founder matching, a four-layer AI-enhanced knowledge system, context engineering and security practices, and common anti-patterns to avoid.

    1. The Problem: Why Agent Systems Get Harder to Maintain

    Agent projects over the past two years tend to follow a similar trajectory. A prototype runs with a few dozen lines of code, then balloons into a multi-thousand-line “big ball of mud” once it hits real business use. Logic branches, prompt fragments, tool adapters, and fallback handling all pile up in a single execution entry point, so any requirement change can trigger a chain of regressions.

    Enterprise knowledge management is stuck in a parallel trap with three symptoms: capture is costly, notes lack connections, and there is no reason to revisit them. Information is scattered across chat logs, meeting notes, and personal files. Writing it down takes effort, entries stay isolated from one another, and nothing pulls users back to open them again.

    These two problems look unrelated but share the same root cause: stable mechanisms are mixed with volatile experience. The answer proposed here is layering — keep the mechanism thin and let experience grow thick.

    2. Core Architecture: Splitting Responsibilities Between a Slim Harness and Rich Skills

    A “slim harness” is an execution kernel that keeps only four responsibilities that cannot be reduced further:

    1. Loop execution: a single observe–decide–act–observe loop drives the system, with no predefined business steps.
    2. File read/write: the file system is the single source of truth, so every intermediate artifact can be persisted, diffed, and rolled back.
    3. Context management: context is assembled on demand, window usage is controlled, and compression, summarization, and retrieval are handled here.
    4. Safety boundaries: least privilege, action allowlists, explicit confirmation for dangerous operations, and full-chain logging.

    Everything else — domain workflows, judgment criteria, writing standards, troubleshooting experience — is pushed down into Skills. Skills are carried as structured text and have four properties: versionable, reviewable, reusable, and composable.

    This split yields three direct benefits. The kernel stays stable, so upgrading a skill never touches the framework. Experience becomes portable, letting the same set of skills be reused across projects. Changes become auditable, so every shift in output quality can be traced to a specific skill entry.

    A quick responsibility comparison:

    1. Harness (thin) Skills (thick)
    2. ---------------------- -----------------------
    3. Main loop scheduling Domain workflow orchestration
    4. File read/write and versioning Judgment criteria and thresholds
    5. Context assembly/compression Output format and phrasing standards
    6. Permissions and action allowlist Exception-handling playbooks
    7. Logging and tracing Evaluation cases and regression baselines

    “Thin” does not mean crude. Every line in the kernel should sit on a testable, observable critical path. “Thick” does not mean piled up either: skill files need clear boundaries and invalidation conditions so they do not conflict with each other.

    3. Scaling Lessons: From Manual Pairing to Codified Rules

    An early-stage startup accelerator scenario faced a typical scaling problem: producing high-quality matches for thousands of founders. The early approach relied on humans reading profiles and applying subjective judgment. As the sample grew, consistency and traceability collapsed quickly.

    The fix was the same thin/thick layering. The kernel only reads profile files, assembles candidate context, invokes skills to produce conclusions, and writes results back to files. “How to assess complementarity,” “which dimensions are negotiable,” and “how to rank conflicts” were all codified as skill entries. Once the criteria existed as explicit text, match results became explainable and reproducible for the first time, and humans only reviewed exceptions.

    The general takeaway: any judgment that must be repeated at scale should be moved from tacit human experience to explicit skill text first.

    4. An AI-Enhanced Knowledge Management System: A Four-Layer Design

    A four-layer structure addresses the capture, connection, and revisit pain points:

    • Capture layer: the lowest-friction possible entry, with a unified intake and minimal fields — store first, organize later.
    • Pipeline layer: cleaning, tag extraction, summary generation, bidirectional linking, and deduplication/merge.
    • Local storage layer: plain text files as the single source of truth — local-first, offline-capable, version-controllable.
    • Intelligence layer: the large language model handles semantic search, related-item recommendations, periodic review, and Q&A.

    A sample skill entry looks like this (fields can be adjusted to team conventions):

    1. skill: meeting_note_refine
    2. trigger: input is a draft of meeting notes
    3. steps:
    4. - extract decisions and action items, tagging owner and due date
    5. - generate a verifiable completion criterion for each action item
    6. - link similar past topics and output no more than three link suggestions
    7. guardrails:
    8. - do not invent numbers or conclusions that are not present
    9. - mark uncertain points as pending confirmation
    10. output: a single plain text file + change summary

    The review mechanism is the most overlooked and most critical part of this system. Replace “infinite accumulation” with “spaced review”: the pipeline writes creation time, last-access time, and review interval fields for each note, and the intelligence layer pushes a small number of entries on a cycle. This creates a positive loop of capture → connection → review, turning the knowledge base from a warehouse into a productivity tool.

    5. Context Engineering and Security Governance

    Context management decides success or failure. In practice: put stable standards in long-term context, retrieve and inject task-relevant information on demand, and produce layered summaries for long histories. Also set an upper bound on the context budget — when it is exceeded, trigger compression instead of endless concatenation.

    Security governance must be designed up front. File and network access follow least privilege; write operations are limited to specific directories; irreversible actions such as deletion, publishing, and external sending require mandatory human confirmation; and every tool call records an input summary, output summary, and elapsed time for traceability. If cloud capabilities are involved, generic categories such as object storage, message queues, container platforms, logging services, and monitoring/alerting can carry the load, avoiding tight coupling to a specific implementation.

    6. Evaluation, Evolution, and Common Anti-Patterns

    An architecture without evaluation cannot evolve. Build a small regression set for each type of skill, covering typical inputs, boundary inputs, and adversarial inputs. Run the baseline on every skill change, and gate on both pass rate and human spot checks.

    Common anti-patterns include: writing business branches back into the kernel; letting skill files grow indefinitely with no invalidation cleanup; running context without a budget until costs spiral; and capturing without reviewing, which quickly rots the knowledge base. The remedy is to return to the layering principle — keep the mechanism restrained and the experience structured.

    7. Conclusion

    “Slim harness, rich skills” offers a sustainable engineering order: the kernel owns stability and control, skills own expression and evolution, and the four-layer knowledge architecture closes the loop on information flow. Together, they let teams keep systems explainable, reproducible, and auditable while requirements change fast. To put this into practice, start with a minimal kernel and three core skills, get the loop working end to end, then gradually thicken the experience layer.