<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chandi Bhandari on Medium]]></title>
        <description><![CDATA[Stories by Chandi Bhandari on Medium]]></description>
        <link>https://medium.com/@chandi.academic?source=rss-1902837a895e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QZPTR8TXKlwNbNhrTh0ivg.jpeg</url>
            <title>Stories by Chandi Bhandari on Medium</title>
            <link>https://medium.com/@chandi.academic?source=rss-1902837a895e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 10:24:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chandi.academic/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Context Tax: Why AI Agents Get Slower as They Get Smarter]]></title>
            <link>https://medium.com/@chandi.academic/the-context-tax-why-ai-agents-get-slower-as-they-get-smarter-37b41683a3eb?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/37b41683a3eb</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[context-engineering]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 07:13:36 GMT</pubDate>
            <atom:updated>2026-11-10T07:13:36.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPRVUVZygVWFcoT7itHVFw.png" /></figure><p>A practical guide to giving an AI agent exactly the information it needs, at exactly the moment it needs it, without paying for repeated searches, forgotten decisions, and irrelevant tool output.</p><h3>Table of contents</h3><ul><li><a href="#section-01">The invisible bill in every agent loop</a></li><li><a href="#section-02">A long window is capacity, not comprehension</a></li><li><a href="#section-03">A story about a missing requirement</a></li><li><a href="#section-04">Stop confusing context with memory</a></li><li><a href="#section-05">The five accounts inside a context budget</a></li><li><a href="#section-06">Give the agent an admission controller</a></li><li><a href="#section-07">Every tool should arrive with a spending limit</a></li><li><a href="#section-08">Make relevance a decision, not a keyword score</a></li><li><a href="#section-09">Preserve decisions, not every sentence that led to them</a></li><li><a href="#section-10">Compaction is an editorial act with consequences</a></li><li><a href="#section-11">Protect the difference between a fact and an inference</a></li><li><a href="#section-12">Retrieve by question, then stop</a></li><li><a href="#section-13">Keep important facts where they can be noticed</a></li><li><a href="#section-14">Caching is not the same as budgeting</a></li><li><a href="#section-15">A governor for the full reasoning loop</a></li><li><a href="#section-16">When to summarise, when to retrieve, and when to reset</a></li><li><a href="#section-17">The arithmetic of a 32,000 token run</a></li><li><a href="#section-18">Five ways a context budget can fail</a></li><li><a href="#section-19">Measure the decision, not the size of the prompt</a></li><li><a href="#section-20">A field experiment worth running</a></li><li><a href="#section-21">Build the architecture in three passes</a></li><li><a href="#section-22">What changes when there are several agents?</a></li><li><a href="#section-23">The hidden security boundary in memory</a></li><li><a href="#section-24">The future is selective intelligence</a></li></ul><p>An AI agent opens a repository to fix a small defect. It reads the issue, scans the affected files, searches commit history, runs tests, inspects logs, reads documentation, and asks another agent to review its plan. Every step looks reasonable. Every tool call produces information that might be useful. Twenty minutes later, the agent has a beautiful transcript and an increasingly fragile understanding of the original problem.</p><p>The first error is rarely spectacular. A constraint disappears from the next plan. An old log line is treated as current. A failed hypothesis returns as though it were a fresh idea. The agent asks the repository the same question twice. It rereads a file it already understood. Eventually, the system spends more effort reconstructing its own history than solving the task.</p><p>This is the <strong>context tax</strong>: the growing cost of carrying information through a sequence of decisions, even when most of that information no longer contributes to the next decision.</p><p>The obvious reaction is to buy a larger context window. That can help, but it does not answer the central engineering question. <strong>What deserves a place in the model’s attention right now?</strong></p><p>The best agent architecture is not the one that remembers the largest amount of text. It is the one that can reliably reconstruct the smallest sufficient explanation of the current situation. Achieving that requires budgeting, evidence selection, explicit memory, and a policy for what gets left outside the window.</p><h3>The idea in one minute</h3><p>A useful context budget is more than a token limit. It is a decision about what the agent should see, what it should retrieve, what it should remember as durable state, and what should remain in storage until needed. These are four different jobs and they should not be assigned to a single ever growing conversation transcript.</p><p>A disciplined system keeps a short task contract and verified decisions in active context. It gives new tool results a strict allowance. It stores full evidence outside the prompt with stable identifiers. It compresses history into facts, open questions, and next actions rather than a chronological story. It reserves room for the model to reason and respond. And it evaluates whether those choices improve task quality, not merely whether they reduce token counts.</p><p>The governing principle is simple: <strong>promote information into context because the next decision requires it, not because the information happens to exist.</strong></p><h3>The invisible bill in every agent loop</h3><p>A single model call has a visible cost. An agent loop has an accumulating one. Suppose an assistant starts with 3,000 tokens of instructions and task context. It then receives a 5,000 token search result, a 9,000 token log, a 4,000 token tool response, and several thousand tokens of conversation history. If the orchestration layer resends the entire history on every step, material that helped once becomes a recurring charge.</p><p>Three costs travel together, though they should not be confused. <strong>Token expense</strong> is the bill for processed input and generated output. <strong>Latency</strong> includes preprocessing, model computation, queueing, tool execution, and any additional calls introduced by summarisation. <strong>Reasoning interference</strong> is the risk that irrelevant or stale material competes with evidence that actually matters.</p><p>The first two can be measured in money and milliseconds. The third appears as broken constraints, missed facts, repeated actions, and unjustified conclusions. It is often the most expensive because it can turn a seemingly successful workflow into the wrong result.</p><p>It is useful to think of prompt assembly as a repeated allocation problem rather than a one time preparation step. At every decision point, the orchestrator is choosing how much past information to carry, what new information to inspect, and what capacity to leave available for the next action.</p><p>If that choice is automatic and unbounded, the transcript becomes a landfill with excellent search capabilities and poor discipline.</p><h3>A long window is capacity, not comprehension</h3><p>Long context research has supplied an important warning. In <em>Lost in the Middle</em>, Liu and colleagues found that performance on information retrieval tasks could depend strongly on where relevant material appeared inside a long input. Information at the beginning or end was often used more successfully than information buried in the middle <a href="#source-1">1</a>.</p><p>The RULER benchmark asked a related question: does a model that handles a long sequence also perform reliably when the task requires tracing, aggregation, or more than locating one isolated item? Its results exposed substantial differences between advertised context capacity and effective performance on more demanding tasks <a href="#source-2">2</a>. Chroma’s later <em>Context Rot</em> report likewise examined how performance can become less dependable as additional input arrives <a href="#source-3">3</a>.</p><p>These studies do not prove that every model fails on every long input. Model architectures, tasks, and evaluations differ. They establish something more useful for engineering: <strong>the existence of a context window does not guarantee uniform access to everything placed inside it.</strong></p><p>For an agent, that distinction matters enormously. A user constraint hidden between two megabytes of diagnostic output is technically present. Operationally, it may be almost absent. A model can accept the tokens while still making the wrong decision about which tokens matter.</p><p>This leads to a better success criterion. Do not ask whether the agent can fit the evidence. Ask whether the agent can reliably identify and use the evidence when the moment of decision arrives.</p><h3>A story about a missing requirement</h3><p>Imagine an agent asked to repair duplicate invoice creation after a network retry. The user includes a critical requirement: existing invoice identifiers must remain stable. The agent discovers the retry path, reads a database migration, runs tests, examines a lengthy event log, and requests a second opinion. The work looks productive.</p><p>Later, the agent compacts its history into the sentence, “Fix duplicate invoices caused by retries.” The identifier requirement disappears. The final patch prevents duplicate inserts by changing how identifiers are generated. The tests pass, but the user contract is broken.</p><p>What failed was not retrieval. The agent had seen the requirement. It was not primarily generation either. The code could be internally consistent. The failure was <strong>memory governance</strong>: the system treated a hard constraint as a detail that could be paraphrased away.</p><p>This example suggests three classes of information. Some information must survive unchanged, such as user constraints and permission boundaries. Some information can be compressed, such as reasoning that established a chosen approach. Some information should be archived, such as individual log lines already examined and ruled out.</p><p>The classes matter because a compression method that works well for a narrative explanation can be dangerous when applied to a rule, identifier, command, or exact acceptance criterion.</p><h3>Stop confusing context with memory</h3><p>Context is what the model sees during a particular call. Memory is information that a system can recover across calls. They overlap, but they are not interchangeable.</p><p>A sensible agent has at least four places where information can live. <strong>Active context</strong> holds the current objective, binding constraints, relevant evidence, and the immediate plan. <strong>Working memory</strong> stores structured facts and decisions that might be needed during the current task. <strong>Evidence storage</strong> retains full documents, logs, source snippets, and tool outputs under references the agent can retrieve later. <strong>Longer term memory</strong> preserves reusable preferences or verified knowledge across tasks, subject to appropriate privacy and retention controls.</p><p>An agent should not carry its entire evidence archive into every model call merely because that archive exists. We do not load an entire filesystem into a CPU cache before performing one calculation. The analogy is not exact, but it is productive: the prompt is scarce fast memory, while external storage is spacious and selectively accessed.</p><p>The MemGPT research explored an operating system inspired view of managing information across memory tiers <a href="#source-4">4</a>. The important architectural lesson extends beyond any particular framework. Retrieval and promotion should be explicit operations. The model need not see everything to be able to find it.</p><p>One practical consequence follows: a memory entry should contain enough metadata to be retrieved intelligently. A claim without a source, timestamp, scope, or verification status is not durable knowledge. It is a sentence waiting to be mistaken for a fact.</p><h3>The five accounts inside a context budget</h3><p>The phrase “32,000 token window” sounds like one pool of space. In practice, the orchestrator should assign that space to five competing accounts.</p><p><strong>Instructions</strong> hold stable operating rules, tool contracts, and permission boundaries. <strong>Task state</strong> records the objective, constraints, completed work, and current plan. <strong>Evidence</strong> contains the smallest relevant passages from tools and sources. <strong>Output reserve</strong> protects enough capacity for the agent to explain its answer or propose its next action. <strong>Safety margin</strong> absorbs uncertainty in token estimation, tool formatting, and response length.</p><p>Thinking in accounts prevents a common failure: spending nearly all available capacity on tool evidence and then discovering that no room remains for a coherent next response. It also gives the system an interpretable answer when someone asks why a particular source was excluded.</p><p>For illustration, consider a 32,000 token operating ceiling. A starting allocation might be 3,000 for instructions, 3,500 for task state, 15,000 for evidence, 5,500 for output, and 5,000 for reserve. <strong>These are example design values, not empirically optimal universal proportions.</strong> A repository repair agent and a clinical literature review agent may need very different distributions.</p><p>The more general equation is straightforward:</p><p><strong>Available evidence = operating ceiling − instructions − task state − output reserve − safety margin.</strong></p><p>It is tempting to maximise the evidence term. Resist that temptation. The goal is not to fill the window. The goal is to satisfy the next reasoning step with sufficient, trustworthy information.</p><p>PART TWOFROM THEORY TO IMPLEMENTATION</p><p>Consider an illustrative operating ceiling of 32,000 tokens: 3,000 for instructions, 3,500 for current task state, 15,000 for selected evidence, 5,500 for the answer, and 5,000 held in reserve. The numbers are not universal limits. Their purpose is to force a conscious decision about what deserves attention.</p><h3>Give the agent an admission controller</h3><p>The first useful piece of code is not a clever summariser. It is a small object that makes the budget explicit and fails when the proposed allocation exceeds the limit.</p><pre>from dataclasses import dataclass</pre><pre>@dataclass(frozen=True)<br>class ContextBudget:<br>    ceiling: int<br>    instructions: int<br>    task_state: int<br>    output_reserve: int<br>    safety_margin: int</pre><pre>    @property<br>    def evidence_capacity(self) -&gt; int:<br>        remaining = self.ceiling - sum((<br>            self.instructions,<br>            self.task_state,<br>            self.output_reserve,<br>            self.safety_margin,<br>        ))<br>        if remaining &lt; 0:<br>            raise ValueError(&quot;Reserved tokens exceed the ceiling&quot;)<br>        return remaining</pre><pre>budget = ContextBudget(<br>    ceiling=32_000,<br>    instructions=3_000,<br>    task_state=3_500,<br>    output_reserve=5_500,<br>    safety_margin=5_000,<br>)<br>print(budget.evidence_capacity)  # 15000</pre><p>This is deliberately plain Python. A production implementation should use the tokenizer associated with the selected model and should account for message wrappers, tool schemas, images, and other model specific overhead. Counting characters and dividing by four can be a useful rough warning, but it is not an authoritative admission test.</p><p>The value of this class is not the arithmetic. It is that capacity becomes a policy the orchestrator enforces before sending a request. When a tool returns a huge payload, the system must decide what to select, compress, or leave in evidence storage instead of silently expanding the prompt.</p><h3>Every tool should arrive with a spending limit</h3><p>Tool output is frequently the largest source of avoidable context growth. A search endpoint returns 30 pages. A test runner returns thousands of lines. A browser fetch includes navigation, comments, legal boilerplate, and content unrelated to the question. All of it looks like evidence because all of it came from a tool.</p><p>Before a tool runs, the orchestrator should know what question it is asking and what form of answer would satisfy that question. Consider an agent investigating a failing unit test. It usually needs the failing test name, the exact error, a small stack trace, relevant environment facts, and an evidence reference. It rarely needs every successful test printed alongside the failure.</p><p>A useful tool contract might say: return at most 1,200 tokens of diagnostic summary, preserve exact error messages, show the first relevant stack frames, and store the complete raw log under a retrievable identifier. That reduces prompt noise without destroying the source.</p><pre>from dataclasses import dataclass</pre><pre>@dataclass(frozen=True)<br>class ToolEvidence:<br>    source_id: str<br>    question: str<br>    findings: tuple[str, ...]<br>    exact_errors: tuple[str, ...]<br>    raw_location: str<br></pre><pre>def render_evidence(item: ToolEvidence) -&gt; str:<br>    lines = [<br>        f&quot;Question: {item.question}&quot;,<br>        f&quot;Source: {item.source_id}&quot;,<br>        *[f&quot;Finding: {fact}&quot; for fact in item.findings],<br>        *[f&quot;Exact error: {error}&quot; for error in item.exact_errors],<br>        f&quot;Full evidence: {item.raw_location}&quot;,<br>    ]<br>    return &quot;\n&quot;.join(lines)</pre><p>Notice what the code does not do. It does not claim that a summarised error is the raw log. It keeps the pointer. It separates the question from the answer. And it preserves the exact strings most likely to be needed for debugging.</p><p>An important security caveat belongs here. Retrieved pages, logs, and repository files can contain instructions written by someone other than the user. They are evidence, not authority. A compacting layer must not silently promote instructions embedded inside tool output into system policy.</p><h3>Make relevance a decision, not a keyword score</h3><p>Ordinary retrieval systems often rank chunks by semantic similarity. That is a useful first stage, but a context budget requires another question: <em>How much does this item improve the next decision, given what the agent already knows?</em></p><p>A duplicate explanation may score highly for relevance yet add almost no information. A short note about a legal constraint may score modestly but be essential. A stale version of a specification may be topically perfect and operationally wrong.</p><p>The right selection policy should consider relevance, evidence quality, novelty, task importance, and token cost. Hard constraints should not compete in the same pool as optional background reading. They belong in protected task state.</p><p>For optional evidence, a simple approximation is to prioritise <strong>expected information gain per token</strong>. This is a heuristic, not a claim that semantic value can be measured perfectly.</p><pre>from dataclasses import dataclass</pre><pre>@dataclass(frozen=True)<br>class Candidate:<br>    key: str<br>    relevance: float      # 0 to 1<br>    reliability: float    # 0 to 1<br>    novelty: float        # 0 to 1<br>    tokens: int<br></pre><pre>def choose_evidence(items: list[Candidate], limit: int):<br>    def utility(item: Candidate) -&gt; float:<br>        value = (<br>            0.50 * item.relevance<br>            + 0.30 * item.reliability<br>            + 0.20 * item.novelty<br>        )<br>        return value / max(item.tokens, 1)</pre><pre>    selected = []<br>    used = 0<br>    for item in sorted(items, key=utility, reverse=True):<br>        if item.tokens + used &lt;= limit:<br>            selected.append(item)<br>            used += item.tokens<br>    return selected, used</pre><p>A greedy ranker is not a complete solution. Evidence may depend on other evidence, so the best set of passages is not necessarily the set with the highest independent scores. For high stakes work, add coverage constraints: at least one primary source for every critical claim, explicit coverage of each user requirement, and a separate contradiction check. The goal is not merely compression. It is a sufficiently complete evidence set.</p><h3>Preserve decisions, not every sentence that led to them</h3><p>Multi step tasks naturally produce a stream of abandoned hypotheses and intermediate plans. Some of those steps explain why the agent chose its current approach. Most do not need to be reproduced in full once the decision is established.</p><p>The right unit of working memory is often a <strong>decision record</strong>. It has a question, a chosen action, a concise rationale, references to supporting evidence, and an explicit status. An abandoned hypothesis remains visible as rejected rather than being erased and accidentally rediscovered.</p><pre>from dataclasses import dataclass<br>from typing import Literal</pre><pre>Status = Literal[&quot;accepted&quot;, &quot;rejected&quot;, &quot;open&quot;]</pre><pre>@dataclass(frozen=True)<br>class Decision:<br>    question: str<br>    outcome: str<br>    status: Status<br>    source_ids: tuple[str, ...]<br>    reason: str</pre><pre>history = [<br>    Decision(<br>        question=&quot;Can we change invoice identifiers?&quot;,<br>        outcome=&quot;No; preserve existing identifiers&quot;,<br>        status=&quot;accepted&quot;,<br>        source_ids=(&quot;user_requirement_02&quot;,),<br>        reason=&quot;The task contract explicitly forbids changes&quot;,<br>    )<br>]</pre><p>A record like this is more robust than “We considered several approaches and decided to keep IDs.” It preserves the question, the answer, and the reason. It also tells a future agent where to verify the statement if the task evolves.</p><p>Decision records should be immutable once accepted. If a decision changes, add a superseding record with a reason and a source, rather than overwriting history without trace. That makes it possible to distinguish updated knowledge from memory corruption.</p><h3>Compaction is an editorial act with consequences</h3><p>Summarisation sounds harmless until one considers what is lost. A model compressing 50 pages must decide which details are important. If it does not know the task’s protected invariants, it may discard the one sentence that determines whether the final answer is correct.</p><p>OpenAI’s guidance on session memory discusses both trimming and summarisation, including the risks of forgetting relevant earlier requirements and of introducing errors into summaries <a href="#source-5">5</a>. Anthropic’s context engineering guidance likewise treats context selection as a question of utility, not simply capacity <a href="#source-6">6</a>.</p><p>A safer strategy is <strong>structured compaction</strong>. Instead of asking for “a concise summary of the conversation,” ask for an updated state containing an objective, non negotiable constraints, verified facts, accepted decisions, rejected hypotheses, unresolved questions, current plan, and links to stored evidence.</p><pre>from dataclasses import dataclass, field</pre><pre>@dataclass<br>class AgentState:<br>    objective: str<br>    constraints: list[str] = field(default_factory=list)<br>    verified_facts: list[str] = field(default_factory=list)<br>    decisions: list[str] = field(default_factory=list)<br>    rejected_paths: list[str] = field(default_factory=list)<br>    open_questions: list[str] = field(default_factory=list)<br>    next_action: str = &quot;&quot;<br>    evidence_ids: list[str] = field(default_factory=list)<br></pre><pre>def validate_compaction(before: AgentState,<br>                        after: AgentState) -&gt; None:<br>    missing = set(before.constraints) - set(after.constraints)<br>    if missing:<br>        raise ValueError(f&quot;Protected constraints lost: {missing}&quot;)</pre><p>This validator only checks literal retention of protected strings. A real system should also test meaning preservation, evidence validity, and conflicts between updated records. Nevertheless, even a simple explicit check is an improvement over allowing every summary to silently redefine the job.</p><p>Compaction also has a timing cost. A model call to summarise history may cost more than retaining a few additional tokens. Trigger compaction because the expected benefit exceeds its cost, not merely because a fixed number of messages has passed.</p><h3>Protect the difference between a fact and an inference</h3><p>Agents frequently treat a tool result, an interpretation of that result, and a plan based on that interpretation as though they were the same kind of information. They are not.</p><p>A database query returning three duplicate rows is an observation. “Retries are causing duplicates” is a hypothesis. “Add idempotency checks before insertion” is a proposed intervention. If a memory system compresses all three into “Duplicate issue caused by retries; add idempotency,” the hypothesis has quietly become an established fact.</p><p>This is why evidence records should carry provenance and epistemic status. A claim should specify whether it was directly observed, inferred, assumed, or verified by a test. Ideally it should also identify the source version and time at which the observation was made. A current repository scan and an archived bug report may speak about different states of the same code.</p><p>One design rule pays enormous dividends: <strong>never upgrade uncertainty during compression</strong>. An unresolved question must stay unresolved. A plausible explanation must remain a hypothesis until evidence changes its status. A source excerpt must not turn into a policy instruction simply because it appears in an agent summary.</p><p>This is especially important when multiple agents share memory. A reviewer reading a compressed note should be able to tell what the original agent actually checked, what it merely believed, and which sources are still worth reopening.</p><h3>Retrieve by question, then stop</h3><p>Many agents search for a broad topic because broad search is easy. That produces a pile of related material rather than a targeted answer. The more useful workflow begins with a decision that is blocked by missing evidence.</p><p>Suppose the next decision is whether changing a retry interval would violate an existing reliability requirement. The retrieval question is not “Tell me about retries.” It is “Which repository contracts or operational documents constrain the retry interval for this service?”</p><p>Once the agent has found the relevant configuration, the documented requirement, and a current test or implementation reference, more search may have diminishing value. Continuing to collect documents simply because a search tool is available introduces delay and distraction.</p><p>A good retrieval loop therefore needs a <strong>stop condition</strong>. Stop when required claims have adequate evidence, important contradictions have been considered, and additional retrieval is unlikely to change the decision. Reopen retrieval when new evidence or a failed test changes the question.</p><p>This shifts the system away from the habit of “collect everything, reason later” toward “identify the missing fact, retrieve deliberately, reason now.” It also makes the run easier to audit: every retrieval action can be associated with a specific uncertainty it was intended to reduce.</p><h3>Keep important facts where they can be noticed</h3><p>Evidence ordering is not a cosmetic decision. A short hard constraint can become hard to use when surrounded by thousands of low value tokens. Long context research suggests that information placement can affect access to relevant facts, although the exact effects depend on the model and task <a href="#source-1">1</a>.</p><p>A practical prompt can have a stable beginning and a deliberately useful ending. The beginning defines role, tool rules, scope, and protected requirements. The middle contains tightly selected evidence. The ending restates the current decision, the exact question to answer, and any critical fact that the reasoning step must consider.</p><p>But do not solve a placement problem by duplicating everything. Repeating the full policy at the bottom of every call wastes tokens and can interfere with caching. The objective is thoughtful salience: a brief, accurate decision reminder, not a second document archive.</p><p>This suggests a useful prompt layout: first the stable rules; next protected state; then current evidence with source labels; last the question and output contract. The exact order should be tested on the tasks and models in use. What matters is that the layout is deliberate and repeatable rather than a side effect of appending tool messages forever.</p><h3>Caching is not the same as budgeting</h3><p>Prompt caching can reduce the cost and processing time associated with reused context. It does not eliminate the logical problems of irrelevant material. A cached 40,000 token history may be cheaper to process than an uncached one, but it still exposes the model to the same clutter.</p><p>Current OpenAI documentation describes caching around shared prompt prefixes and explains how changing earlier material can invalidate reuse <a href="#source-7">7</a>. The general operational lesson is stable across providers: place relatively stable instructions and reusable reference material before rapidly changing content when that ordering suits the task and the provider’s cache model.</p><p>A compacting system should therefore balance two objectives that sometimes conflict. Reducing context can improve clarity and make later requests shorter. Rewriting earlier parts of the prompt can also reduce cache reuse. A mature orchestrator measures both effects instead of treating compression as an unconditional win.</p><p>There is a deeper distinction here. <strong>Caching optimises repeated computation. Context budgeting optimises the information presented for a decision.</strong> A system may need both, but neither replaces the other. The correct choice depends on evidence reuse, context growth, model behaviour, and the economics of the actual provider configuration.</p><p>Avoid assuming that a persistent session guarantees a cache hit. Inspect usage metrics. Also remember that cached tokens still occupy logical context, even when their processing receives different billing or latency treatment.</p><p>PART THREETHE WORKING SYSTEM</p><h3>A governor for the full reasoning loop</h3><p>We can now connect the pieces. An agent should assemble context at each decision boundary rather than treating the entire conversation as its only memory. The assembler receives the current state, the unresolved question, and candidate evidence. It checks the budget, selects useful evidence, and produces a focused request.</p><p>The following is a technology neutral sketch. It deliberately leaves model calls and storage interfaces abstract so the control flow is easier to inspect.</p><pre>from dataclasses import dataclass</pre><pre>@dataclass<br>class StepRequest:<br>    question: str<br>    evidence: list[Candidate]<br>    state: AgentState<br></pre><pre>def build_step(request: StepRequest, budget: ContextBudget):<br>    # In production, count rendered messages with the<br>    # tokenizer for the exact model being called.<br>    selected, used = choose_evidence(<br>        request.evidence,<br>        budget.evidence_capacity,<br>    )</pre><pre>    protected_state = {<br>        &quot;objective&quot;: request.state.objective,<br>        &quot;constraints&quot;: request.state.constraints,<br>        &quot;decisions&quot;: request.state.decisions,<br>        &quot;open_questions&quot;: request.state.open_questions,<br>    }</pre><pre>    return {<br>        &quot;state&quot;: protected_state,<br>        &quot;evidence_ids&quot;: [item.key for item in selected],<br>        &quot;decision_question&quot;: request.question,<br>        &quot;evidence_tokens_estimated&quot;: used,<br>        &quot;evidence_tokens_allowed&quot;: budget.evidence_capacity,<br>    }</pre><p>For a real deployment, this assembly step needs stronger controls. It must count the rendered payload, not just the source estimates. It must verify that evidence identifiers actually resolve to saved material. It should reject untrusted instructions found in sources. It should prevent protected constraints from being dropped. And it should record every selection so the run can be reconstructed.</p><p>The orchestrator then repeats a small cycle: identify the next decision, determine missing evidence, retrieve only what is needed, assemble a bounded context, execute the model call, validate the result, and update structured state. Repetition is not the problem. Uncontrolled accumulation is.</p><h3>When to summarise, when to retrieve, and when to reset</h3><p>Not every situation calls for compaction. Sometimes the best intervention is to retrieve a missing passage. Sometimes it is to discard a noisy tool result. Sometimes it is to start a fresh reasoning call with a precise task state and evidence pointers.</p><p>Summarise when the current task requires continuity across many meaningful decisions and those decisions can be represented reliably in structured form. Retrieve when a specific missing fact can be recovered from stable storage. Reset the active working context when the conversation has become dominated by obsolete plans or irrelevant tool chatter, provided the protected state has been captured first.</p><p>An effective policy considers the nature of the information, not just its age. A user constraint from the first turn may be more important than a tool result from one minute ago. A decisive test from yesterday may be more relevant than ten fresh but redundant documentation pages. Freshness matters when the source is mutable, but it is not a substitute for relevance or authority.</p><p>There is also a failure mode in aggressive summarisation. Repeatedly compressing already compressed summaries can strip away domain detail and make weak inferences appear stable. Research on Agentic Context Engineering examines the problem of contexts losing useful content through iterative rewriting and explores incremental ways to preserve strategies <a href="#source-8">8</a>. One operational response is to update structured records from original evidence rather than endlessly rewriting a single prose summary.</p><h3>The arithmetic of a 32,000 token run</h3><p>Consider an illustrative eight step investigation where the naive agent sends its accumulated conversation history again on every call. Assume the first call carries 4,000 input tokens and each subsequent step adds 3,000 tokens of new history. Ignoring output tokens, the eight input sizes are 4,000, 7,000, 10,000, 13,000, 16,000, 19,000, 22,000, and 25,000 tokens.</p><p>Their sum is <strong>116,000 input tokens processed across eight calls</strong>. This is an illustrative accounting exercise, not an observed benchmark or a claim about a specific API’s caching behaviour.</p><p>Now suppose the bounded agent spends 4,000 tokens on stable instructions, 2,000 on structured task state, and an average of 4,000 on selected evidence at each call. Eight calls would process approximately <strong>80,000 input tokens</strong> before any caching effects. That is about 31 percent fewer input tokens for this constructed example. Whether the bounded agent is actually faster or more accurate is a separate empirical question.</p><p>The interesting gain is not just the difference between 116,000 and 80,000. The bounded agent has a predictable input shape. It is easier to estimate cost, protect capacity, diagnose failures, and compare two runs. The unbounded agent accumulates history according to whichever tool happened to be the noisiest.</p><p>Do not mistake a neat calculation for a performance study. Token usage, output length, summarisation overhead, tool latency, cache reuse, and task success must all be measured in a real experiment.</p><h3>Five ways a context budget can fail</h3><p><strong>First, it can become a censorship engine.</strong> A crude limit may drop the very evidence that makes a task solvable. The fix is protected constraints, coverage checks, and the ability to retrieve original sources again.</p><p><strong>Second, it can preserve the wrong summary.</strong> An early mistaken inference may survive through many calls because it is compact and convenient. The fix is explicit uncertainty, provenance, and routine verification of claims against their sources.</p><p><strong>Third, it can optimise the wrong metric.</strong> A team celebrates a 40 percent reduction in input tokens while agent success falls. A budget is successful only when cost and latency improve without unacceptable losses in correctness, safety, or user trust.</p><p><strong>Fourth, it can make every step bureaucratic.</strong> If a simple question triggers three model calls for summarisation, reranking, and auditing, the context controller has become the expensive component. Use lightweight deterministic rules where they work and invoke additional reasoning only when it changes a consequential decision.</p><p><strong>Fifth, it can erase accountability.</strong> A system that presents a clean summary while discarding the raw evidence cannot show how its conclusions were formed. Summaries are convenient working notes. Durable evidence must remain accessible, with retention and access controls appropriate to the task.</p><p>These failures show why context budgeting is not merely summarisation with a nicer name. It is an information management policy constrained by correctness, transparency, and the needs of the next action.</p><h3>Measure the decision, not the size of the prompt</h3><p>A useful evaluation should combine operational metrics with task outcomes. Track input tokens per completed task, total model calls, tool calls, elapsed time, cache reuse, summarisation overhead, and actual cost. Then pair those numbers with accuracy, constraint retention, evidence grounding, repeated work, and human intervention.</p><p>One especially revealing measure is <strong>constraint survival</strong>: the fraction of protected requirements that remain represented and respected at each stage of a run. Another is <strong>evidence precision</strong>: the share of included evidence that materially supports the current decision. A third is <strong>retrieval recurrence</strong>: how often an agent looks up information it already verified and stored.</p><p>The measurement itself can be simple. In the following example, success rates and costs are passed in as observed values from two cohorts. The code reports differences without pretending that small samples establish statistical certainty.</p><pre>from dataclasses import dataclass</pre><pre>@dataclass(frozen=True)<br>class RunMetrics:<br>    tasks: int<br>    successful: int<br>    input_tokens: int<br>    model_cost_usd: float<br>    elapsed_seconds: float</pre><pre>    def report(self) -&gt; dict:<br>        if self.tasks &lt;= 0:<br>            raise ValueError(&quot;tasks must be positive&quot;)<br>        return {<br>            &quot;success_rate&quot;: self.successful / self.tasks,<br>            &quot;tokens_per_task&quot;: self.input_tokens / self.tasks,<br>            &quot;cost_per_task_usd&quot;: self.model_cost_usd / self.tasks,<br>            &quot;seconds_per_task&quot;: self.elapsed_seconds / self.tasks,<br>        }</pre><pre>baseline = RunMetrics(100, 83, 1_800_000, 24.0, 9_000)<br>budgeted = RunMetrics(100, 85, 1_200_000, 18.5, 8_100)</pre><pre>print(&quot;Baseline:&quot;, baseline.report())<br>print(&quot;Budgeted:&quot;, budgeted.report())</pre><p>The numbers above are invented to demonstrate reporting, not findings from a study. A 2 point apparent success difference over 100 cases may easily reflect noise or a different mix of tasks. Before drawing conclusions, use paired tasks, repeat trials where appropriate, inspect failure types, and report uncertainty.</p><p>An excellent context governor might reduce token use substantially while leaving task success unchanged. Another might slightly increase token use but prevent severe mistakes. The correct objective is <strong>quality adjusted efficiency</strong>, not the smallest possible prompt.</p><p>PART FOURFROM DESIGN TO PRACTICE</p><h3>A field experiment worth running</h3><p>If I were testing a context budgeting system, I would begin with a fixed collection of real tasks: repository repairs, document synthesis, multi source research, and long tool driven investigations. Each task would have an explicit objective, known constraints, a rubric, and retained evidence. The test set would include short, medium, and long workflows because budgeting is likely to matter differently across them.</p><p>I would run three configurations. The first carries the entire available conversation until the provider limit forces truncation. The second uses a recent message window with a simple summary. The third uses protected state, question driven retrieval, bounded tool evidence, and source linked decision records. All three would use the same underlying model and tool permissions.</p><p>For each task I would inspect not only the final response but the trajectory: which tools were called, which sources were loaded, which requirements were preserved, when the agent repeated a question, and whether a human had to correct it. I would measure elapsed time and cost from instrumentation, not estimate them from transcript length alone.</p><p>Most importantly, I would analyse <em>where</em> the context budget helped and where it hurt. If it works for research synthesis but drops crucial stack traces in debugging, that is not a failed theory. It is evidence that the selection policy needs to be specialised. Good evaluation produces a more precise architecture, not merely a victory chart.</p><h3>Build the architecture in three passes</h3><p>The first pass should make the current system observable. Record input and output tokens, tool payload sizes, repeated retrievals, prompt composition, compaction events, and the evidence used for each decision. Without these traces, teams optimise anecdotes. Instrumentation also reveals which sources of bloat are worth addressing first. Often a single verbose tool accounts for more waste than the entire conversation history.</p><p>The second pass should introduce basic discipline without changing the model. Add a task contract, a reserved output allowance, a maximum tool response size, structured decision records, and a way to fetch full evidence by identifier. This stage tends to expose engineering defects in the surrounding software, such as logs that cannot be retrieved after a summary is generated.</p><p>The third pass should make context selection adaptive. Give the orchestrator a question driven retrieval policy, measured evidence ranking, compaction validation, and stop rules. Test that the agent knows when to ask for more information instead of improvising from an incomplete prompt. Only then consider dynamic model routing or more sophisticated learned selectors.</p><p>Progressively increasing complexity makes attribution possible. If an elaborate reranker damages accuracy, you want to know that the simpler protected state design worked before you introduced it. An agent is already a complex system. Its memory layer should not become another opaque agent that nobody can evaluate.</p><h3>What changes when there are several agents?</h3><p>Multi agent systems multiply the opportunity for information duplication. A researcher gathers evidence, a planner paraphrases it, an implementer paraphrases the plan, and a reviewer paraphrases the implementation. Every handoff creates a chance to lose constraints, launder uncertainty into certainty, or make a source harder to verify.</p><p>A better handoff passes a concise task contract, a clear deliverable, protected constraints, relevant decision records, and stable evidence identifiers. It should state what the receiving agent is authorised to decide and what remains unresolved. The receiving agent can retrieve additional evidence rather than inheriting an enormous transcript from its predecessor.</p><p>Shared memory needs rules for conflict. Two agents may reach different conclusions because they inspected different source versions or operated at different times. Do not resolve that disagreement by accepting the most recent summary. Preserve both claims with provenance and require reconciliation against primary evidence.</p><p>The emerging design pattern is a small <strong>common factual ledger</strong> paired with selective private working context for each specialist. The ledger prevents drift on binding facts. Private context avoids making every agent pay for every other agent’s explorations. This is particularly valuable when different agents use different tools, models, or access permissions.</p><h3>The hidden security boundary in memory</h3><p>A context system also decides what information crosses boundaries. Tool results may contain private records, customer data, secrets, or untrusted text. Compression does not remove the obligation to enforce access control. A short summary of restricted material is still restricted material.</p><p>Stored evidence should carry sensitivity labels and access rules. Retrieval must check the requesting agent’s authority before returning a source. Compaction should avoid copying credentials into working memory. Logs used for evaluation should be redacted appropriately. Retention policies should govern both raw evidence and any derived summaries.</p><p>One particularly subtle risk is prompt injection through saved memory. An attacker does not need to control the next user request if they can persuade the agent to store an instruction from an untrusted page as a permanent preference or system rule. The next stage may then execute the instruction as though it were part of the task contract.</p><p>A clean separation between <strong>data</strong>, <strong>inferences</strong>, and <strong>instructions</strong> is therefore a security feature as well as a reasoning feature. The authority of a statement should come from its origin and permissions, not from how confidently it appears in a summarised prompt.</p><h3>The future is selective intelligence</h3><p>Longer windows will continue to be useful. Better retrieval, stronger models, new memory methods, and efficient caching can all improve what an agent is capable of. The mistake would be to treat progress on one dimension as a substitute for system design.</p><p>The next generation of agent infrastructure should think carefully about information promotion. What was learned? How certain is it? Which decision will need it? When will it become stale? Where does the original evidence live? What is the cost of keeping it in attention? These are questions familiar to database design, operating systems, and scientific method. Agent development brings them together in a new setting.</p><p>A good budget is not a hard cap imposed on intelligence. It is a mechanism for protecting intelligence from irrelevant work. It gives the model an uncluttered decision surface and makes important facts easy to find without pretending that every fact must be visible at all times.</p><p>The most valuable agent may not be the one that has read the most. It may be the one that knows <strong>what can safely be forgotten, what must never be lost, and how to recover the rest.</strong></p><h3>Final thought: the discipline of leaving things out</h3><p>There is a quiet but profound change in how we should design persistent agents. Instead of endlessly extending a conversation, we can begin to treat each model call as a carefully prepared working session. The session has a purpose, a bounded set of evidence, a known state, and an explicit next decision. What does not belong in that session remains available, but outside the model’s immediate attention.</p><p>This is not minimalism for its own sake. It is a way to preserve correctness as autonomy increases. Every extra tool, source, memory record, and specialist agent creates potential value and potential noise. The orchestration layer must distinguish between them.</p><p><strong>A great agent does not carry the whole journey into every step. It carries the map, the constraints, the next question, and the evidence needed to move.</strong></p><h3>References and further reading</h3><ol><li>Liu, N. F., and colleagues. (2024). <em>Lost in the Middle: How Language Models Use Long Contexts</em>. Transactions of the Association for Computational Linguistics. <a href="https://aclanthology.org/2024.tacl-1.9/">Read original source</a></li><li>Hsieh, C. P., and colleagues. (2024). <em>RULER: What’s the Real Context Size of Your Long Context Language Models?</em> <a href="https://arxiv.org/abs/2404.06654">Read original source</a></li><li>Hong, K., Troynikov, A., and Huber, J. (2025). <em>Context Rot: How Increasing Input Tokens Impacts LLM Performance</em>. Chroma. <a href="https://www.trychroma.com/research/context-rot">Read original source</a></li><li>Packer, C., and colleagues. (2023). <em>MemGPT: Towards LLMs as Operating Systems</em>. <a href="https://arxiv.org/abs/2310.08560">Read original source</a></li><li>Okcular, E. (2025). <em>Context Engineering: Short Term Memory Management with Sessions</em>. OpenAI Cookbook. <a href="https://developers.openai.com/cookbook/examples/agents_sdk/session_memory">Read original source</a></li><li>Anthropic Engineering. (2025). <em>Effective Context Engineering for AI Agents</em>. <a href="https://www.anthropic.com/research/effective-context-engineering-for-ai-agents">Read original source</a></li><li>OpenAI. <em>Prompt Caching</em>. OpenAI API documentation, accessed November 2026. <a href="https://developers.openai.com/api/docs/guides/prompt-caching">Read original source</a></li><li>Zhang, Q., and colleagues. (2025). <em>Agentic Context Engineering: Evolving Contexts for Self Improving Language Models</em>. <a href="https://arxiv.org/abs/2510.04618">Read original source</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37b41683a3eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Coding Agents Are Getting Powerful. They Need a Control Plane.]]></title>
            <link>https://medium.com/@chandi.academic/ai-coding-agents-are-getting-powerful-they-need-a-control-plane-b9fe9643878d?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9fe9643878d</guid>
            <category><![CDATA[ai-coding-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Thu, 15 Oct 2026 20:19:30 GMT</pubDate>
            <atom:updated>2026-10-15T20:19:30.319Z</atom:updated>
            <content:encoded><![CDATA[<p>How routing, repository history, scope controls, sandboxing, evaluation, and gradual autonomy can make agentic software development more useful without making it ungovernable.</p><p>Something important changes when an AI stops merely suggesting code and starts acting on a repository. The moment it can inspect files, run commands, edit multiple components, execute tests, and keep iterating, it is no longer just a code generator. It has become an engineering actor.</p><p>SWE-agent made one part of this shift concrete by showing that the design of the agent-computer interface materially affects repository-level performance [1]. OpenHands pushes the same direction into an open platform built around terminals, browsers, file editing, sandboxed execution, and agent coordination [2]. SWE-bench, meanwhile, grounds the problem in real GitHub issues where success may require coordinated reasoning across a large codebase rather than generating one isolated function [3].</p><p>Once that level of action is possible, a bigger question appears: who decides which agent gets the task, what it may touch, which historical decisions matter, how much time and money it may spend, when it must ask for approval, and what evidence it must leave behind?</p><p>The most useful way I have found to think about that problem is as a control plane around the coding agents. The agents still do the work, but the surrounding system defines the task contract, routes the job, constrains authority, brings in repository history when it matters, watches for scope drift, evaluates both the result and the trajectory, and records enough evidence to reconstruct what happened.</p><blockquote>The more capable the coding agent becomes, the less acceptable it is to govern the run with a prompt alone.</blockquote><h3>The idea in one minute</h3><p>A control plane separates capability from authority. It lets specialist agents work quickly while keeping routing, scope, cost, evidence, evaluation, and approval visible and enforceable.</p><ul><li><strong>Route deliberately.</strong> Select models and specialist capabilities using task complexity, risk, policy, cost, and measured performance.</li><li><strong>Use history as evidence.</strong> Reconstruct rationale from commits, tests, issues, and linked artifacts while preserving uncertainty.</li><li><strong>Control scope continuously.</strong> Compare the evolving patch and agent trajectory with the approved objective and constraints.</li><li><strong>Evaluate outcomes and behavior.</strong> Passing tests are necessary but do not excuse unsafe tools, unjustified expansion, excessive cost, or weak provenance.</li><li><strong>Increase autonomy by task class.</strong> Expand authority only when stable evaluation and operational evidence support it.</li></ul><p>The code and configuration examples below are deliberately technology-neutral. They show the shape of the controls; a production implementation still needs organization-specific identity, persistence, telemetry, policy enforcement, and security engineering.</p><h3>Coding agents have crossed an important line</h3><p>For a long time, the most visible use of language models in software development was code completion, explanation, and isolated generation. Agentic systems push well beyond that.</p><p>A software-engineering agent can now operate through an environment: inspect a repository, search symbols, edit files, run commands, install dependencies, execute tests, inspect failures, and rework its own patch. SWE-agent showed that the design of the agent-computer interface materially affects an agent’s ability to navigate repositories and solve software-engineering tasks [1]. OpenHands similarly demonstrates an open platform in which software agents can write code, interact with command-line environments, browse the web, execute code in sandboxes, coordinate with other agents, and participate in benchmark evaluation [2].</p><p>Repository-level benchmarks also illustrate why software engineering is qualitatively different from isolated code generation. SWE-bench contains real GitHub issues that can require coordinated changes across functions, classes, and files, along with reasoning over large codebases and executable environments [3].</p><p>Once agents can act at this level, conventional prompt-level supervision is insufficient.</p><p>The organization needs a layer that answers:</p><ul><li>Which agent or model should receive the task?</li><li>What repository state may it access?</li><li>What is the approved scope?</li><li>Which historical decisions should influence the change?</li><li>What tools may it use?</li><li>How much cost and time may it consume?</li><li>What constitutes success?</li><li>When must it stop or escalate?</li><li>What evidence must accompany a proposed change?</li><li>How will improvements to the agent itself be validated?</li></ul><p>These are control-plane questions.</p><h3>Capability is not the same thing as permission</h3><p>A coding agent can be highly capable while still being poorly governed.</p><p>For example, an agent may produce a patch that passes the visible tests while modifying unrelated modules. It may solve a local failure by removing a defensive mechanism whose rationale is buried in repository history. It may use an expensive reasoning model for routine work. It may revive an abandoned code path without recognizing why the project was previously discontinued. It may improve one task-specific procedure while degrading another.</p><p>A control plane addresses these risks by separating <strong>what can execute</strong> from <strong>what may execute under current conditions</strong>.</p><p>Control-plane architecture at a glanceLayerWhat it controlsTypical componentsRequestDefines the engineering intent entering the systemIssue, user request, event, incidentControl planeSets the conditions under which work may proceedTask contract, identity, routing, permissions, history, scope, budget, evaluation, auditExecutionPerforms analysis, implementation, and reviewSpecialist analysis, coding agent, reviewer / evaluatorEngineering systemsProvide the working environment and evidenceRepository, CI, test environment, approved tools</p><p>The control plane does not need to perform every task itself. It coordinates the conditions under which specialist capabilities act.</p><h3>Five specialist capabilities are more useful than one giant agent</h3><p>Instead of asking one giant agent to reason about everything, I find it more useful to separate five specialist capabilities around distinct engineering questions.</p><p>Specialist capabilities and their governed outputs.CapabilityPrimary questionTypical outputAdvisor-OrchestratorHow should this task be routed and governed?Execution plan, model route, cost/risk budget, escalation policyCommit ArchaeologistWhy does the repository look this way?Historical-intent dossier with commit, issue, and test evidenceProject Graveyard IntelligenceWhy did this initiative stall, and what remains reusable?Recovery assessment, failure taxonomy, salvage mapScope Creep DetectorIs implementation still aligned with approved intent?Scope-delta report, severity score, approval requirementSelf-Improving AgentWhat procedural change improves performance without losing control?Candidate skill or policy update with evaluation evidence</p><p>The capabilities are deliberately narrow. Narrowness improves evaluation, permissions, reuse, and accountability.</p><h3>Start with a task contract, not a vague instruction</h3><p>Before an agent acts, the vague human request should become an explicit task contract.</p><p>The contract defines intent, scope, constraints, authority, success criteria, and evidence requirements.</p><pre>task:<br>  id: ENG-4821<br>  repository: payments-api<br>  objective: &gt;<br>    Fix duplicate webhook processing observed after transient<br>    network failures.</pre><pre>scope:<br>  expected_components:<br>    - src/webhooks/<br>    - tests/webhooks/<br>  allowed_new_dependencies: false<br>  public_api_change: false<br>  database_schema_change: false</pre><pre>risk:<br>  level: high<br>  reasons:<br>    - payment_processing<br>    - idempotency</pre><pre>validation:<br>  required:<br>    - targeted_tests<br>    - regression_tests<br>    - scope_check<br>    - historical_rationale_check</pre><pre>authority:<br>  merge: human_required<br>  production_deploy: human_required</pre><pre>budget:<br>  max_agent_minutes: 30<br>  max_model_cost_usd: 8.00</pre><p><strong>Example. </strong>A machine-readable task contract that defines intent, scope, validation, authority, and budget.</p><p>The task contract becomes the common reference used by routing, scope detection, evaluation, and audit.</p><p>Without an explicit contract, later claims that the agent “followed the task” are difficult to assess because the intended boundary was never represented formally.</p><h3>Route work by cost, risk, and evidence</h3><p>Not every engineering task should be routed to the strongest available model.</p><p>Model-routing research demonstrates that cost and capability can be traded dynamically. RouteLLM, for example, learns routers that decide between stronger and weaker models and reports material cost reductions on its evaluation settings without corresponding quality loss [4]. Hybrid LLM similarly studies routing based on predicted difficulty and desired quality [5].</p><p>For software engineering, routing needs to go beyond model price alone.</p><p>Routing may consider:</p><ul><li>task complexity;</li><li>repository size;</li><li>risk classification;</li><li>required tools;</li><li>historical success by task class;</li><li>need for repository archaeology;</li><li>scope sensitivity;</li><li>latency requirement;</li><li>model and tool cost;</li><li>data-handling constraints; and</li><li>human-review availability.</li></ul><pre>from dataclasses import dataclass<br></pre><pre>class NoEligibleModelError(RuntimeError):<br>    &quot;&quot;&quot;Raised when policy leaves no model eligible for a task.&quot;&quot;&quot;<br></pre><pre>@dataclass(frozen=True, slots=True)<br>class Route:<br>    model: str<br>    use_archaeologist: bool<br>    use_scope_guard: bool<br>    human_review: bool<br>    max_cost_usd: float<br></pre><pre>def advise(task, history, policy, models) -&gt; Route:<br>    candidates = [<br>        model for model in models<br>        if policy.model_allowed(model, task.repository)<br>    ]</pre><pre>    if not candidates:<br>        raise NoEligibleModelError(<br>            f&quot;No policy-approved model for {task.repository}&quot;<br>        )</pre><pre>    def score(model):<br>        success = history.success_rate(<br>            task_class=task.task_class,<br>            model=model.name,<br>        )<br>        quality = model.capability(task.task_class)<br>        cost = model.normalized_cost<br>        risk = policy.route_risk(task, model)</pre><pre>        return (<br>            0.40 * success<br>            + 0.30 * quality<br>            - 0.15 * cost<br>            - 0.15 * risk<br>        )</pre><pre>    model = max(candidates, key=score)</pre><pre>    return Route(<br>        model=model.name,<br>        use_archaeologist=task.requires_history,<br>        use_scope_guard=True,<br>        human_review=policy.requires_human_review(task),<br>        max_cost_usd=policy.cost_budget(task),<br>    )</pre><p><strong>Example. </strong>Illustrative routing logic with an explicit fail-closed path when policy permits no candidate model.</p><p>The scoring formula is illustrative. The durable principle is that routing should be explicit and measurable rather than hidden inside a generic “use the best model” instruction.</p><h3>Not every task needs the whole machinery</h3><p>Multi-agent systems can become inefficient when every request is passed through every specialist.</p><p>The orchestrator should invoke additional capability only when it changes the decision quality.</p><p>A one-line documentation correction may need no historical analysis. A change to a security-sensitive retry mechanism may require commit archaeology, scope analysis, a stronger model, deterministic tests, and human approval.</p><p>This creates a principle of <strong>conditional specialization</strong>:</p><p>Conditional specialization by task riskRisk classTypical routeAdditional controlsLowDirect agentBasic testsMediumAgent + scope guardRegression tests and scope checksHighHistory analysis + stronger modelScope guard, security checks, stronger validation, human review</p><p>Specialization has value when it reduces uncertainty or risk. Otherwise it becomes orchestration overhead.</p><h3>Git history is more than a timeline</h3><p>Source code records what exists. Version history can help explain why it exists.</p><p>Developers frequently need the rationale behind code commits during maintenance tasks. A mixed-methods study in the <em>Journal of Systems and Software</em> found that commit rationale is both important and difficult to recover, and identified 15 categories of rationale information developers may seek, including goals, constraints, alternatives, dependencies, modifications, validation, and side effects [6].</p><p>The broader mining-software-repositories literature has long demonstrated that change history contains actionable structure. Zimmermann and colleagues showed that co-change patterns in version histories can help predict locations likely to require related changes [7].</p><p>An AI Commit Archaeologist can combine these ideas with language-model synthesis.</p><p>For a target symbol or behavior, it can inspect:</p><ul><li>git log history;</li><li>git blame lineage;</li><li>commits that introduced or reverted behavior;</li><li>linked issues or pull requests;</li><li>tests introduced around the same time;</li><li>co-changing files;</li><li>commit-message rationale;</li><li>release notes;</li><li>architecture-decision records; and</li><li>later changes that may supersede the earlier rationale.</li></ul><h3>Historical claims need receipts</h3><p>A historical summary is useful, but a structured evidence report is more reliable.</p><pre>{<br>  &quot;target&quot;: &quot;src/webhooks/retry.py:MAX_ATTEMPTS&quot;,<br>  &quot;question&quot;: &quot;Why is the retry limit fixed at three?&quot;,<br>  &quot;finding&quot;: &quot;The limit was introduced after duplicate delivery incidents during prolonged upstream timeouts.&quot;,<br>  &quot;confidence&quot;: 0.92,<br>  &quot;evidence&quot;: [<br>    {<br>      &quot;type&quot;: &quot;commit&quot;,<br>      &quot;id&quot;: &quot;4e92a1c&quot;,<br>      &quot;role&quot;: &quot;introduced_limit&quot;<br>    },<br>    {<br>      &quot;type&quot;: &quot;test&quot;,<br>      &quot;id&quot;: &quot;test_duplicate_delivery_after_timeout&quot;,<br>      &quot;role&quot;: &quot;behavioral_evidence&quot;<br>    },<br>    {<br>      &quot;type&quot;: &quot;issue&quot;,<br>      &quot;id&quot;: &quot;OPS-184&quot;,<br>      &quot;role&quot;: &quot;incident_context&quot;<br>    }<br>  ],<br>  &quot;superseded&quot;: false,<br>  &quot;uncertainty&quot;: &quot;No explicit architecture record was found.&quot;<br>}</pre><p><strong>Example. </strong>A valid JSON evidence report that separates the synthesized finding from its supporting artifacts.</p><p>The claim should remain distinguishable from the evidence. If the synthesis is wrong, a reviewer can inspect the commit and tests directly.</p><h3>Collect first. Synthesize second.</h3><p>A useful pattern here is simple: collect deterministic evidence first, then let the model synthesize it.</p><pre>import subprocess<br>from pathlib import Path<br></pre><pre>def git(*args: str, cwd: Path) -&gt; str:<br>    result = subprocess.run(<br>        [&quot;git&quot;, *args],<br>        cwd=cwd,<br>        check=True,<br>        capture_output=True,<br>        encoding=&quot;utf-8&quot;,<br>        errors=&quot;replace&quot;,<br>        timeout=30,<br>    )<br>    return result.stdout<br></pre><pre>def history_for_file(repo: Path, path: str) -&gt; dict:<br>    return {<br>        &quot;log&quot;: git(<br>            &quot;log&quot;,<br>            &quot;--follow&quot;,<br>            &quot;--format=%H%x09%ad%x09%an%x09%s&quot;,<br>            &quot;--date=iso&quot;,<br>            &quot;--&quot;,<br>            path,<br>            cwd=repo,<br>        ),<br>        &quot;recent_patch&quot;: git(<br>            &quot;log&quot;,<br>            &quot;-p&quot;,<br>            &quot;-n&quot;,<br>            &quot;8&quot;,<br>            &quot;--&quot;,<br>            path,<br>            cwd=repo,<br>        ),<br>        &quot;blame&quot;: git(<br>            &quot;blame&quot;,<br>            &quot;--line-porcelain&quot;,<br>            &quot;--&quot;,<br>            path,<br>            cwd=repo,<br>        ),<br>    }</pre><p><strong>Example. </strong>Deterministic Git collection with bounded execution, explicit decoding, and safe path separation.</p><p>The collected evidence can then be narrowed around the relevant lines, commits, and linked artifacts before model analysis. This reduces the risk that an LLM invents historical rationale from the current code alone.</p><h3>Repository history is useful — and incomplete</h3><p>History is evidence, but it is incomplete evidence.</p><p>Commit messages may be sparse, inaccurate, or written after the decision was made. External links can decay. Decisions may occur in meetings or communication channels never linked to Git. Squashed commits can compress multiple rationales into one record. A revert may remove code without explaining whether the underlying requirement changed.</p><p>A large-scale study of links in commit messages found that externally referenced knowledge is common but subject to decay and traceability problems [8]. A 2026 systematic mapping study further documents the breadth of research using commit messages for corrective maintenance [9].</p><p>The Commit Archaeologist should therefore represent uncertainty explicitly and avoid treating the repository as a complete historical record.</p><h3>Abandoned projects still contain intelligence</h3><p>Organizations accumulate unfinished migrations, abandoned prototypes, dormant branches, discontinued internal tools, and projects that stopped after partial implementation.</p><p>These repositories contain both assets and liabilities.</p><p>A project may contain a valuable domain model but unusable infrastructure. A migration script may remain useful while the target architecture is obsolete. Tests may encode important requirements even when the application itself should never be revived.</p><p>Project Graveyard Intelligence analyzes this state before the organization decides to restart, rewrite, archive, or mine the project for reusable components.</p><p>The system should answer four separate questions:</p><ol><li><strong>What happened?</strong> Reconstruct the observable project trajectory.</li><li><strong>Why did progress stop?</strong> Identify evidence-supported blockers or failure patterns.</li><li><strong>What remains valuable?</strong> Classify reusable code, tests, data models, documents, or design knowledge.</li><li><strong>What would recovery cost?</strong> Estimate modernization and uncertainty rather than assuming revival is cheaper than replacement.</li></ol><h3>What a recovery dossier should actually inspect</h3><p>A recovery analysis can combine repository, issue, dependency, CI, and ownership signals.</p><p>Evidence families for assessing stalled or abandoned software.Signal familyExamplesActivityLast meaningful commit, unresolved PRs, abandoned branches, release cadenceBuild healthDependency resolution, test status, unsupported runtime, CI breakageArchitectureIncomplete migration, missing service dependency, retired interfaceScopeIssue growth, unresolved milestones, repeated requirement changesOwnershipMaintainer departure, unclear reviewer, unowned production componentSecurityUnsupported libraries, leaked credentials, unresolved high-severity findingsKnowledgeMissing rationale, incomplete documentation, inaccessible linked artifactsReuseStable domain model, test fixtures, parsers, migration scripts, documentation</p><p>The output should distinguish evidence from inference and indicate where missing historical context makes a recovery recommendation uncertain.</p><h3>Use recovery scores to triage, not to decide</h3><p>A recovery score can help triage a portfolio, but it should never hide the evidence underneath it.</p><p>RecoveryScore = 0.25A + 0.25B + 0.20R + 0.15K + 0.15O − RiskPenalty</p><p>where:</p><ul><li><strong>A</strong> = architectural viability;</li><li><strong>B</strong> = build and dependency health;</li><li><strong>R</strong> = reusable asset value;</li><li><strong>K</strong> = recoverable knowledge quality;</li><li><strong>O</strong> = ownership and operational readiness.</li></ul><p>The formula is illustrative. A security-sensitive project with unknown provenance may deserve rejection regardless of an otherwise attractive aggregate score.</p><h3>Scope creep becomes a runtime problem</h3><p>Agentic development increases implementation velocity. That can make unintended expansion more difficult to detect before it reaches review.</p><p>Scope creep is not synonymous with touching more files than expected. A legitimate fix may require an additional file. The important question is whether the implementation remains justified by the approved objective.</p><p>The control plane should preserve a baseline containing:</p><ul><li>objective;</li><li>acceptance criteria;</li><li>expected components;</li><li>prohibited classes of change;</li><li>approved expansions;</li><li>risk constraints;</li><li>public-interface expectations; and</li><li>human decisions made during execution.</li></ul><p>The Scope Creep Detector compares this baseline against the evolving patch and agent trajectory.</p><h3>Scope drift has more than one shape</h3><p>A useful scope detector has to look at both structural changes and semantic intent.</p><p>Dimensions and signals used to identify scope drift.DimensionExample signalFile surfaceUnexpected directories or components changedAPI surfaceNew or altered public interfaceDependency surfaceNew package, service, or external integrationData surfaceSchema, migration, persistence, or retention changeBehavioral surfaceChange affects scenarios outside acceptance criteriaOperational surfaceDeployment, observability, or infrastructure modificationSemantic intentPatch rationale no longer matches task objective</p><pre>def detect_scope_drift(task, patch):<br>    findings = []</pre><pre>    unexpected_paths = (<br>        set(patch.changed_components)<br>        - set(task.expected_components)<br>        - set(task.approved_components)<br>    )</pre><pre>    if unexpected_paths:<br>        findings.append({<br>            &quot;type&quot;: &quot;unexpected_component&quot;,<br>            &quot;severity&quot;: &quot;medium&quot;,<br>            &quot;items&quot;: sorted(unexpected_paths),<br>        })</pre><pre>    if patch.public_api_changed and not task.public_api_change:<br>        findings.append({<br>            &quot;type&quot;: &quot;public_api_expansion&quot;,<br>            &quot;severity&quot;: &quot;high&quot;,<br>        })</pre><pre>    if patch.schema_changed and not task.database_schema_change:<br>        findings.append({<br>            &quot;type&quot;: &quot;schema_expansion&quot;,<br>            &quot;severity&quot;: &quot;high&quot;,<br>        })</pre><pre>    if patch.new_dependencies and not task.allowed_new_dependencies:<br>        findings.append({<br>            &quot;type&quot;: &quot;dependency_expansion&quot;,<br>            &quot;severity&quot;: &quot;medium&quot;,<br>            &quot;items&quot;: sorted(patch.new_dependencies),<br>        })</pre><pre>    return findings</pre><p><strong>Example. </strong>A deterministic first-pass scope check for unexpected components, interfaces, schemas, and dependencies.</p><h3>Detection is not the same as rejection</h3><p>A scope-control system becomes brittle if every deviation is automatically rejected.</p><p>The control plane should distinguish four operations:</p><ol><li><strong>Detect.</strong> Identify a deviation.</li><li><strong>Explain.</strong> Ask the agent to provide evidence for why the deviation is necessary.</li><li><strong>Approve.</strong> Record an authorized expansion in the task contract.</li><li><strong>Block.</strong> Prevent continuation when the deviation violates a hard constraint.</li></ol><p>This preserves flexibility without making scope invisible.</p><blockquote>Governance should make justified change explicit, not make all change impossible.</blockquote><h3>Self-improvement needs a gate</h3><p>A software-development control plane will generate large amounts of evidence about its own behavior: successful routes, failed trajectories, repeated tool errors, unnecessary context retrieval, scope violations, reviewer corrections, and regression patterns.</p><p>This evidence can support improvement, but improvement should not mean that a production agent silently rewrites itself.</p><p>A safer loop is:</p><p>An evaluation-gated improvement pipelineStagePurposeProduction and evaluation tracesCollect real evidence about success, failures, tool use, cost, and reviewer corrections.Failure clusteringIdentify recurring failure modes rather than reacting to one isolated run.Candidate improvementPropose a bounded change to an allowed artifact such as a skill, routing threshold, or retrieval rule.Offline replayRe-run representative tasks before exposing the change to production.Capability evaluationCheck whether the candidate actually improves difficult target tasks.Regression evaluationConfirm that previously stable behavior has not degraded.ReviewApply policy checks and human approval where the risk class requires it.Canary rolloutExpose the candidate to limited production traffic.Monitored releasePromote only if live evidence remains acceptable; otherwise roll back.</p><p>Agent-evaluation practice increasingly emphasizes trajectory-level evaluation because agents use tools, modify state, and may reach an apparently correct final answer through an unacceptable path. Anthropic’s 2026 guidance distinguishes capability evaluations from regression suites and recommends inspection of transcripts, outcomes, and multiple grader types [10].</p><h3>Only explicit artifacts should be allowed to change</h3><p>If the system is going to improve itself, the editable surface needs to be explicit.</p><p>Candidate targets can include:</p><ul><li>task-specific skills;</li><li>tool descriptions;</li><li>routing thresholds;</li><li>retrieval heuristics;</li><li>context-compaction rules;</li><li>evaluation rubrics;</li><li>retry strategies; and</li><li>non-safety prompt components.</li></ul><p>Hard authorization policies, security boundaries, and human-approval requirements should not be optimization targets merely because changing them could increase benchmark success.</p><h3>A minimal improvement gate</h3><pre>def consider_improvement(<br>    baseline,<br>    candidate,<br>    capability_suite,<br>    regression_suite,<br>    evaluator,<br>    policy,<br>):<br>    if not policy.change_allowed(candidate.changed_artifact):<br>        return &quot;reject:protected_artifact&quot;</pre><pre>    capability = evaluator.run(candidate, capability_suite)<br>    regression = evaluator.run(candidate, regression_suite)</pre><pre>    if not capability.completed or not regression.completed:<br>        return &quot;reject:incomplete_evaluation&quot;</pre><pre>    if capability.policy_violations or regression.policy_violations:<br>        return &quot;reject:policy_violation&quot;</pre><pre>    if capability.score &lt;= baseline.capability_score:<br>        return &quot;reject:no_capability_gain&quot;</pre><pre>    if regression.pass_rate &lt; policy.min_regression_pass_rate:<br>        return &quot;reject:regression&quot;</pre><pre>    if candidate.cost_per_task &gt; policy.max_cost_per_task:<br>        return &quot;reject:cost&quot;</pre><pre>    if policy.requires_human_approval(candidate):<br>        return &quot;awaiting_human_review&quot;</pre><pre>    return &quot;eligible_for_canary&quot;</pre><p><strong>Example. </strong>A fail-closed improvement gate that rejects incomplete evaluations, policy violations, regressions, and excessive cost.</p><p>The optimizer proposes. The evaluation system measures. The release process decides whether the new behavior becomes active.</p><h3>The real leverage comes from shared evidence</h3><p>The five specialist capabilities become more valuable when their evidence is shared through the control plane.</p><p>How shared evidence connects the specialist capabilitiesCapabilityConsumesProducesWhat it informs nextAdvisor-OrchestratorTask contract, risk, cost and prior performanceRoute, budget and required controlsWhich specialists and agent configuration are invokedCommit ArchaeologistRepository history, issues, tests and linked artifactsEvidence-backed historical rationaleCoding decisions and scope severityCoding agentTask contract, route and relevant historical evidenceCandidate patch, test results and trajectoryScope analysis and evaluationProject Graveyard IntelligenceDormant project history, dependencies, CI and ownership signalsRecovery evidence and salvage assessmentAdvisory recovery decisionsScope Creep DetectorTask contract, patch and trajectoryScope-delta findings and severityApproval, rework, blocking or evaluationEvaluationOutcome, trajectory, policy and test evidenceRelease decision or failure evidenceRelease process and self-improvementSelf-Improving AgentRepeated failure evidence and evaluation historyValidated candidate changesThe control plane after evaluation and release gates</p><p>For example, the Commit Archaeologist may find that a defensive code path was created after a specific incident. That evidence can influence the coding agent’s patch and the Scope Creep Detector’s severity assessment. If the agent repeatedly ignores this kind of historical rationale, the resulting evaluation traces can motivate a change to the agent’s repository-investigation skill.</p><p>The system thereby learns from connected evidence rather than from isolated prompts.</p><h3>A common event language keeps the system modular</h3><p>These specialists still need a common language for sharing state without becoming tightly coupled.</p><pre>{<br>  &quot;event_id&quot;: &quot;evt_01J...&quot;,<br>  &quot;event_type&quot;: &quot;scope_drift_detected&quot;,<br>  &quot;task_id&quot;: &quot;ENG-4821&quot;,<br>  &quot;repository&quot;: &quot;payments-api&quot;,<br>  &quot;timestamp&quot;: &quot;2026-08-21T02:16:44Z&quot;,<br>  &quot;producer&quot;: &quot;scope-guard/1.8&quot;,<br>  &quot;severity&quot;: &quot;high&quot;,<br>  &quot;payload&quot;: {<br>    &quot;dimension&quot;: &quot;public_api&quot;,<br>    &quot;changed_symbol&quot;: &quot;WebhookRetryPolicy&quot;,<br>    &quot;baseline_allows_change&quot;: false<br>  },<br>  &quot;evidence&quot;: [<br>    &quot;patch:agent-run-948&quot;,<br>    &quot;task-contract:ENG-4821&quot;<br>  ]<br>}</pre><p><strong>Example. </strong>A valid JSON event that links a scope finding to its task and patch evidence.</p><p>The event model allows orchestration, audit, evaluation, and memory systems to subscribe to the same evidence without tightly coupling every component.</p><h3>The control plane needs traceability across artifacts</h3><p>Software-engineering decisions rarely depend on one artifact.</p><p>A task may relate to an issue, which relates to a file, which was changed by a commit, which introduced a test, which was motivated by an incident, which later produced a scope exception.</p><p>The control plane can maintain an evidence graph linking:</p><ul><li>tasks;</li><li>requirements;</li><li>commits;</li><li>files and symbols;</li><li>issues;</li><li>pull requests;</li><li>tests;</li><li>incidents;</li><li>agent runs;</li><li>evaluation results;</li><li>human approvals;</li><li>scope exceptions; and</li><li>deployed releases.</li></ul><p>This graph need not replace the source systems. It can act as a derived traceability layer whose nodes point back to canonical evidence.</p><h3>Sandbox first. Authority later.</h3><p>Coding agents need powerful tools, but powerful tools should not automatically mean production authority.</p><p>OpenHands explicitly supports sandboxed code execution, reflecting a broader architectural requirement for isolating agent actions [2]. A control plane should treat sandboxing as the default for code modification and evaluation.</p><p>Execution tiers can be separated:</p><p>Progressive execution tiers for software-engineering agents.TierTypical authorityRead-only analysisInspect repository and approved metadataSandbox modificationEdit disposable working tree, run tests, create candidate patchRepository writeCreate branch or pull request under controlled identityMergePolicy-dependent, often human approvalProduction deploymentSeparate deployment authority and environment controls</p><p>The progression prevents an agent’s ability to generate a valid patch from being confused with authority to deploy that patch.</p><h3>Prompt injection becomes a software supply-chain issue</h3><p>A coding agent reads content that may be attacker-controlled: issue text, repository files, comments, documentation, generated logs, dependency metadata, and web pages.</p><p>Prompt injection is therefore not only a conversational-security problem. It can enter through the software artifacts the agent is expected to inspect.</p><p>OWASP identifies prompt injection as a major risk in LLM applications, including indirect injection through external content [11].</p><p>The control plane should distinguish:</p><ul><li>trusted system instructions;</li><li>approved skill instructions;</li><li>user task intent;</li><li>repository content;</li><li>external documentation;</li><li>tool output; and</li><li>untrusted third-party content.</li></ul><p>Repository text must remain data unless an explicit policy promotes it to instruction authority.</p><h3>Every action needs an identity</h3><p>Every consequential agent action needs an attributable runtime identity.</p><p>The audit record should make it possible to reconstruct:</p><ul><li>which user or system initiated the task;</li><li>which agent configuration acted;</li><li>which model was used;</li><li>which skill versions were loaded;</li><li>which tools were invoked;</li><li>which repository state was observed;</li><li>which files were modified;</li><li>which evaluations passed;</li><li>which human approved the action; and</li><li>which deployment contained the resulting change.</li></ul><p>NIST’s Generative AI Profile emphasizes governance, measurement, transparency, provenance, and lifecycle risk management for generative AI systems [12]. In software engineering, these principles can be implemented directly in the control-plane event model.</p><h3>Grade the patch and the path</h3><p>Software engineering gives us one useful advantage: many agent outcomes can be tested mechanically.</p><p>Useful graders include:</p><ul><li>fail-to-pass tests;</li><li>pass-to-pass regression tests;</li><li>linters;</li><li>type checkers;</li><li>static security analysis;</li><li>dependency checks;</li><li>scope-delta checks;</li><li>repository-cleanliness checks;</li><li>performance tests;</li><li>model-based trajectory rubrics; and</li><li>human review.</li></ul><p>SWE-bench itself is built around executable repository-level evaluation [3]. Modern agent-evaluation guidance further distinguishes between the final state of the environment and the full transcript or trajectory used to reach it [10].</p><p>Both are necessary.</p><h3>A passing patch can still be a bad run</h3><p>Consider a patch that makes all tests pass but:</p><ul><li>modifies an unrelated public API;</li><li>adds an unnecessary dependency;</li><li>downloads an unapproved package;</li><li>disables a security check;</li><li>ignores documented historical rationale;</li><li>uses ten times the expected inference budget; or</li><li>requires substantial human cleanup.</li></ul><p>Outcome-only evaluation may classify the run as successful.</p><p>A control plane should instead maintain a multidimensional scorecard.</p><p>AgentQuality = f(Correctness, Scope, Safety, Cost, Evidence, Maintainability, ReviewBurden)</p><p>No single scalar score should be allowed to hide a hard failure. A security violation may require rejection even if the aggregate score is otherwise high.</p><h3>Capability evals and regression evals answer different questions</h3><p>Capability evaluations test whether the system can solve difficult tasks. Regression evaluations test whether known-good behavior remains intact after a change.</p><p>This distinction is especially important for self-improving agents.</p><p>A new routing strategy may improve difficult issue resolution while causing simple tasks to use unnecessarily expensive models. A new repository-history skill may improve correctness but dramatically increase latency. A new scope heuristic may prevent harmful expansion while blocking legitimate multi-file fixes.</p><p>The control plane should therefore require both hill-climbing and backsliding protection.</p><h3>How I would measure the orchestrator</h3><p>Operational metrics for model and capability routing.MetricPurposeTask success by routeDetermine whether routing choices improve completionCost per accepted taskMeasure economic efficiency rather than raw token costEscalation precisionMeasure whether high-risk cases are correctly identifiedOver-routing rateDetect unnecessary use of expensive agents or specialist analysisUnder-routing rateDetect tasks that needed stronger capability or reviewLatency by routeIdentify orchestration overhead</p><h3>How to measure repository and recovery intelligence</h3><p>Measures for repository-history, recovery, and scope-control capabilities.CapabilityExample measureCommit ArchaeologistPercentage of historical findings traceable to primary repository evidenceCommit ArchaeologistReviewer agreement with reconstructed rationaleProject GraveyardUseful recoverable assets identified per analyzed projectProject GraveyardRecovery recommendations later confirmed by engineering reviewScope Creep DetectorMaterial unapproved changes detected before mergeScope Creep DetectorFalse-positive rate on legitimate scope expansions</p><h3>How to measure self-improvement without fooling yourself</h3><p>Self-improvement should be measured by durable behavior change, not by the number of proposed updates generated.</p><p>Measures for safe, durable improvement of the control plane.MetricPurposeCapability gainImprovement on held-out difficult tasksRegression pass rateProtection of previously stable behaviorsRejected-change rateVisibility into optimizer proposal qualityRollback frequencyProduction instability after promotionCost deltaWhether better performance requires disproportionate resourcesHuman correction rateWhether the update reduces operational review burdenPolicy violation rateWhether optimization degrades governance</p><h3>What the full workflow looks like</h3><p>Consider a production issue involving duplicate webhook processing.</p><p>A controlled repository-level engineering workflowStepControl pointWhat happens1IntakeThe issue enters the control plane.2Task contractScope, risk, success criteria, authority, evidence requirements and budget are made explicit.3RoutingThe Advisor-Orchestrator selects the model, specialists and control level.4Historical contextCommit Archaeology reconstructs relevant retry-history rationale.5Sandbox executionThe coding agent creates a candidate patch in an isolated environment.6TestingTargeted tests and the regression suite run.7Scope controlThe patch is compared with the task contract; divergence is explained, approved, reworked or blocked.8Security and qualitySecurity and quality evaluation runs on the candidate and its trajectory.9Human authorityHuman review occurs where policy requires it.10ReleaseThe approved change proceeds to pull request, merge or deployment according to authority.11Outcome captureOutcome and reviewer feedback are recorded.12Improvement evidenceThe resulting evidence enters the offline improvement pipeline.</p><p>The workflow is agentic without being opaque.</p><h3>Missing authority should stop the run</h3><p>Agents frequently encounter ambiguity: an issue does not specify whether an API may change, a repository has no clear owner, or a project-recovery action requires access to a system outside the task boundary.</p><p>A reliable control plane should not convert missing authority into inferred permission.</p><p>The default response to unresolved high-impact authority should be escalation or narrowing of the action.</p><pre>class HumanApprovalRequired(RuntimeError):<br>    &quot;&quot;&quot;Raised when an action requires explicit human approval.&quot;&quot;&quot;<br></pre><pre>def authorization_gate(action, task, policy):<br>    decision = policy.check(<br>        actor=action.agent_identity,<br>        repository=task.repository,<br>        action=action.kind,<br>        scope=task.scope,<br>    )</pre><pre>    if decision == &quot;allow&quot;:<br>        return True</pre><pre>    if decision == &quot;requires_approval&quot;:<br>        raise HumanApprovalRequired(action)</pre><pre>    raise PermissionError(<br>        f&quot;Action not authorized: {action.kind}&quot;<br>    )</pre><p><strong>Example. </strong>Authorization logic with explicit allow, approval, and deny outcomes.</p><p>This boundary is especially important when the agent can write code, modify infrastructure, or trigger external systems.</p><h3>Autonomy should be earned task by task</h3><p>There is no single sensible autonomy level for every engineering task.</p><p>A system may be trusted to autonomously update generated documentation but require review for dependency changes and prohibit autonomous production deployment.</p><p>Authority can therefore be granted by task class.</p><p>A progressive authority model for engineering tasks.Autonomy levelExample engineering authorityLevel 0 — AdvisoryRead and recommend onlyLevel 1 — SandboxCreate patches and run tests in disposable environmentsLevel 2 — ProposeCreate branches or pull requestsLevel 3 — Conditional mergeMerge low-risk changes after automated gatesLevel 4 — Controlled deploymentDeploy explicitly authorized low-risk classes with rollback</p><p>Evidence from evaluation and production monitoring should determine whether a task class progresses to a higher level.</p><h3>Keep the control plane model-agnostic</h3><p>Models will keep changing. The control plane should survive those changes instead of baking business rules into one provider-specific agent.</p><p>The system should define contracts around:</p><ul><li>task input;</li><li>tool permissions;</li><li>context package;</li><li>structured output;</li><li>evidence requirements;</li><li>cost accounting;</li><li>trajectory logs; and</li><li>evaluation results.</li></ul><p>A model or agent harness can then be replaced without redesigning scope governance, historical evidence, or approval policy.</p><p>This is one reason open software-agent platforms and standard evaluation harnesses are important: they separate engineering capability from a single proprietary interaction pattern.</p><h3>A rollout sequence I would actually trust</h3><p>I would not start by unleashing a fully autonomous multi-agent system across every repository.</p><ol><li><strong>Select one repository and one task family.</strong> Choose work with strong tests and clear ownership.</li><li><strong>Define the task contract.</strong> Make scope, risk, evidence, and authority explicit.</li><li><strong>Start in sandbox mode.</strong> Let the agent create candidate patches without production authority.</li><li><strong>Build deterministic evaluation.</strong> Use tests, linting, type checks, and security scanning.</li><li><strong>Add the Scope Creep Detector.</strong> Protect task intent before adding broader autonomy.</li><li><strong>Add Commit Archaeology for historically sensitive tasks.</strong> Measure whether it improves review quality.</li><li><strong>Introduce cost-aware routing.</strong> Use historical performance to determine where stronger models are justified.</li><li><strong>Analyze dormant projects separately.</strong> Use Project Graveyard Intelligence as an advisory capability before permitting recovery actions.</li><li><strong>Capture trajectories and outcomes.</strong> Build evidence before enabling self-improvement.</li><li><strong>Introduce evaluation-gated optimization.</strong> Limit editable artifacts and require regression protection.</li><li><strong>Expand autonomy by task class.</strong> Increase authority only after stable evidence exists.</li></ol><h3>Ten design rules worth keeping</h3><p>The architecture can be summarized through ten principles.</p><ol><li><strong>Intent must be explicit.</strong> Convert requests into task contracts.</li><li><strong>Routing must be observable.</strong> Record why a model or specialist was selected.</li><li><strong>History is evidence, not truth.</strong> Preserve provenance and uncertainty.</li><li><strong>Abandoned work deserves diagnosis before revival.</strong> Separate reusable assets from obsolete architecture.</li><li><strong>Scope should be continuously checked.</strong> Do not wait until final review to detect expansion.</li><li><strong>Detection is not authorization.</strong> Separate finding a deviation from approving it.</li><li><strong>Execution should be sandboxed by default.</strong> Authority should increase in explicit tiers.</li><li><strong>Outcomes and trajectories both matter.</strong> Passing tests do not excuse unsafe behavior.</li><li><strong>Self-improvement must be gated.</strong> Candidate updates should pass capability, regression, policy, and release checks.</li><li><strong>Every important decision should be reconstructable.</strong> Auditability is a product feature, not an afterthought.</li></ol><h3>The core principle: more autonomy needs more control surface</h3><p>The deeper principle behind the control plane is that increasing agent capability should increase the organization’s ability to observe and constrain consequential action.</p><p>What must strengthen as agent capability growsControlWhy it matters as the action surface expandsExplicit task intentThe agent needs a defined boundary for what it is trying to accomplish.EvidenceImportant claims and decisions must remain inspectable.RoutingDifferent tasks require different models, specialists, cost budgets and review levels.Scope controlsFaster implementation makes unapproved expansion easier to miss.PermissionsAbility to act must remain separate from authority to act.EvaluationPassing tests alone does not establish that the trajectory was acceptable.AuditConsequential actions must be reconstructable after the run.RollbackAutonomous changes need a reliable path back to a stable state.</p><p>An agent that can modify an entire repository requires more than a better prompt. It requires an operational control surface around the action.</p><h3>What this architecture is really trying to solve</h3><p>AI-assisted software development is moving quickly from suggestion systems toward agents that can inspect, modify, test, and coordinate work across real repositories.</p><p>That is exciting precisely because it changes what needs to be engineered around the model. A repository-level agent can cross file boundaries, infer missing requirements, use expensive tools, resurrect old patterns, and produce a patch that passes tests while still violating the actual intent of the task.</p><p>The control-plane idea gives those capabilities somewhere to live. Routing makes model and specialist selection explicit. Commit archaeology brings historical evidence into the run when it matters. Project Graveyard Intelligence helps separate recoverable assets from obsolete work. Scope control keeps the implementation tied to approved intent. Evaluation-gated improvement lets the system learn from repeated failures without silently changing production behavior.</p><p>None of those pieces requires one monolithic agent or one model provider. What matters is the shared contract around identity, scope, evidence, permissions, cost, evaluation, and audit.</p><p>SWE-agent, OpenHands, SWE-bench, routing research, repository-history studies, modern agent-evaluation practice, OWASP guidance, and NIST risk-management work each illuminate different parts of this problem [1–12]. Put together, they point toward the same practical reality: benchmark capability is only one part of production-grade agentic engineering.</p><p>The goal is not to make capable agents less capable. It is to make their capability observable, bounded, reviewable, and progressively trustworthy.</p><p>For me, that is the real role of the control plane: not another layer of ceremony, but the operational surface that lets software agents become more autonomous without making engineering less accountable.</p><h3>References</h3><p><strong>[1]</strong> Yang, J., Jimenez, C. E., Wettig, A., Lieret, K., Yao, S., Narasimhan, K., &amp; Press, O. (2024). <em>SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering</em>. arXiv:2405.15793. <a href="https://arxiv.org/abs/2405.15793">https://arxiv.org/abs/2405.15793</a>.</p><p><strong>[2]</strong> Wang, X., Li, B., Song, Y., Xu, F. F., Tang, X., Zhuge, M., Pan, J., et al. (2024). <em>OpenHands: An Open Platform for AI Software Developers as Generalist Agents</em>. arXiv:2407.16741. <a href="https://arxiv.org/abs/2407.16741">https://arxiv.org/abs/2407.16741</a>.</p><p><strong>[3]</strong> Jimenez, C. E., Yang, J., Wettig, A., Yao, S., Pei, K., Press, O., &amp; Narasimhan, K. R. (2024). <em>SWE-bench: Can Language Models Resolve Real-World GitHub Issues?</em> International Conference on Learning Representations. <a href="https://proceedings.iclr.cc/paper_files/paper/2024/hash/edac78c3e300629acfe6cbe9ca88fb84-Abstract-Conference.html">ICLR proceedings</a>.</p><p><strong>[4]</strong> Ong, I., Almahairi, A., Wu, V., Chiang, W.-L., Wu, T., Gonzalez, J. E., Kadous, M. W., &amp; Stoica, I. (2024). <em>RouteLLM: Learning to Route LLMs with Preference Data</em>. arXiv:2406.18665. <a href="https://arxiv.org/abs/2406.18665">https://arxiv.org/abs/2406.18665</a>.</p><p><strong>[5]</strong> Ding, D., Mallick, A., Wang, C., Sim, R., Mukherjee, S., Ruhle, V., Lakshmanan, L. V. S., &amp; Awadallah, A. H. (2024). <em>Hybrid LLM: Cost-Efficient and Quality-Aware Query Routing</em>. International Conference on Learning Representations. <a href="https://arxiv.org/abs/2404.14618">https://arxiv.org/abs/2404.14618</a>.</p><p><strong>[6]</strong> Al-Safwan, K., &amp; Servant, F. (2022). <em>Developers’ Need for the Rationale of Code Commits: An In-Breadth and In-Depth Study</em>. Journal of Systems and Software, 189, 111320. <a href="https://doi.org/10.1016/j.jss.2022.111320">https://doi.org/10.1016/j.jss.2022.111320</a>.</p><p><strong>[7]</strong> Zimmermann, T., Zeller, A., Weissgerber, P., &amp; Diehl, S. (2005). <em>Mining Version Histories to Guide Software Changes</em>. IEEE Transactions on Software Engineering, 31(6), 429–445. <a href="https://doi.org/10.1109/TSE.2005.72">https://doi.org/10.1109/TSE.2005.72</a>.</p><p><strong>[8]</strong> Xiao, T., Baltes, S., Hata, H., Treude, C., Kula, R. G., Ishio, T., &amp; Matsumoto, K. (2023). <em>18 Million Links in Commit Messages: Purpose, Evolution, and Decay</em>. Empirical Software Engineering, 28(4). <a href="https://doi.org/10.1007/s10664-023-10325-8">https://doi.org/10.1007/s10664-023-10325-8</a>.</p><p><strong>[9]</strong> Islam, S., &amp; Zacchiroli, S. (2026). <em>On the Use of Commit Messages for Corrective Software Maintenance: A Systematic Mapping Study</em>. Proceedings of the 30th International Conference on Evaluation and Assessment in Software Engineering (EASE 2026). <a href="https://conf.researchr.org/details/ease-2026/ease-2026-research-papers/11/On-the-Use-of-Commit-Messages-for-Corrective-Software-Maintenance-A-Systematic-Mappi">EASE 2026</a>.</p><p><strong>[10]</strong> Anthropic. (2026). <em>Demystifying Evals for AI Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents">https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents</a>.</p><p><strong>[11]</strong> OWASP GenAI Security Project. (2025). <em>LLM01:2025 Prompt Injection</em>. OWASP Foundation. <a href="https://genai.owasp.org/llmrisk/llm01-prompt-injection/">OWASP GenAI Security Project</a>.</p><p><strong>[12]</strong> Autio, C., Schwartz, R., Dunietz, J., Jain, S., Stanley, M., Tabassi, E., Hall, P., &amp; Roberts, K. (2024). <em>Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile</em>. NIST AI 600–1. National Institute of Standards and Technology. <a href="https://doi.org/10.6028/NIST.AI.600-1">https://doi.org/10.6028/NIST.AI.600-1</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9fe9643878d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents Aren’t a Business Case Until You Can Measure What They Change]]></title>
            <link>https://medium.com/@chandi.academic/ai-agents-arent-a-business-case-until-you-can-measure-what-they-change-c58b48d1d112?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c58b48d1d112</guid>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 16:15:42 GMT</pubDate>
            <atom:updated>2026-10-06T16:15:42.245Z</atom:updated>
            <content:encoded><![CDATA[<p>Knowledge, memory, skills and governance matter — but enterprise AI only becomes valuable when the workflow and business outcomes move with them.</p><h3>What this article covers</h3><ul><li><a href="#abstract">Why this matters</a></li><li><a href="#executive-summary-heading">The short version</a></li><li><a href="#section-1">1. The first mistake: treating capability as value</a></li><li><a href="#section-2">2. The three persistent layers I keep coming back to</a></li><li><a href="#section-3">3. Put them together and you get an enterprise agent stack</a></li><li><a href="#section-4">4. Knowledge: give the agent something authoritative to stand on</a></li><li><a href="#section-5">5. Memory: continuity without turning history into noise</a></li><li><a href="#section-6">6. Skills: procedures that live outside the model</a></li><li><a href="#section-7">7. Capability is not authority</a></li><li><a href="#section-8">8. Measure first. Calculate ROI later.</a></li><li><a href="#section-9">9. Draw the value chain before you build the dashboard</a></li><li><a href="#section-10">10. Don’t flatten every metric into one number</a></li><li><a href="#section-11">11. “Productivity” needs a denominator</a></li><li><a href="#section-12">12. The research is useful precisely because it disagrees</a></li><li><a href="#section-13">13. Measure knowledge by what it prevents downstream</a></li><li><a href="#section-14">14. Memory should earn its place</a></li><li><a href="#section-15">15. Skills give you a clean way to measure procedure</a></li><li><a href="#section-16">16. The unit economics that matter are per accepted outcome</a></li><li><a href="#section-17">17. ROI is simple on paper — and easy to fake in practice</a></li><li><a href="#section-18">18. Use a counterfactual, not a success story</a></li><li><a href="#section-19">19. Shadow mode is underrated</a></li><li><a href="#section-20">20. Human review can be a feature, not a failure</a></li><li><a href="#section-21">21. More output is not necessarily more value</a></li><li><a href="#section-22">22. Architecture has a cost too</a></li><li><a href="#section-23">23. Build a business-impact ledger</a></li><li><a href="#section-24">24. Make counterfactual measurement part of the platform</a></li><li><a href="#section-25">25. Average gains can hide where the value really is</a></li><li><a href="#section-26">26. Risk reduction can be real value — if you estimate it honestly</a></li><li><a href="#section-27">27. The organization has to change too</a></li><li><a href="#section-28">28. Use a balanced scorecard</a></li><li><a href="#section-29">29. A deployment sequence I’d actually trust</a></li><li><a href="#section-30">30. The principle tying all of this together</a></li><li><a href="#conclusion">The question is not “How capable is the agent?”</a></li><li><a href="#references">References</a></li></ul><h3>Why this matters</h3><p>I keep seeing the same leap in enterprise AI: a model answers difficult questions, retrieves documents, calls tools, or completes a workflow — and the conversation jumps straight to <em>business value</em>. That jump is where the reasoning usually gets fuzzy.</p><p>A capable agent is not automatically a valuable system. Value only appears when the agent changes a real workflow: less rework, faster cycle time, better quality, lower cost, more capacity, lower risk, or some other outcome the organization actually captures.</p><p>Several strands of work already give us important pieces of this stack. Retrieval-augmented generation provides a way to ground models in external knowledge [2]. Generative Agents and MemGPT explored persistent memory beyond a single context window [3,4]. SkillOpt treats reusable procedures as external, trainable artifacts [5,6]. Anthropic’s agent guidance emphasizes composable workflows [1], while NIST, ISO/IEC 42001 and OWASP provide governance and risk-management foundations [7,13,14]. OpenTelemetry gives us a language for instrumentation [15].</p><p>Put those pieces together and a more interesting question emerges: <strong>can we trace what the agent knew, remembered, did, cost, changed, and ultimately improved?</strong></p><p>That is the frame for this article. The agent stack is useful only when the path from technical capability to operational outcome remains observable enough to test.</p><h3>The short version</h3><p>My working model is simple: enterprise agents create value only when technical capability improves a workflow at an acceptable level of cost and risk. That requires an architecture that keeps knowledge, memory, reusable procedures, authority, evaluation, and measurement distinct enough to inspect.</p><ul><li><strong>Architect for traceability.</strong> Every consequential output should be attributable to the knowledge, memory, skill, model, tool, policy, and human decision that shaped it.</li><li><strong>Measure accepted outcomes.</strong> Raw output, token consumption, benchmark scores, and task completion are insufficient without acceptance, quality, rework, intervention, and downstream outcome measures.</li><li><strong>Preserve the counterfactual.</strong> Baselines, control groups, shadow operation, staggered deployment, or another defensible comparison design should be established before automation expands.</li><li><strong>Calculate total incremental cost.</strong> Model charges should be evaluated alongside tool use, infrastructure, review, rework, governance, maintenance, change management, and expected loss.</li><li><strong>Expand authority through evidence.</strong> Automation should increase only after segmented results demonstrate sufficient reliability for the relevant task, user group, and risk class.</li></ul><p><strong>A practical note.</strong> The patterns and code below are reference designs, not a drop-in production stack. Real deployments still need organization-specific identity, privacy, secrets management, retention, recovery, testing, and monitoring.</p><h3>1. The first mistake: treating capability as value</h3><p>The easiest way to overstate enterprise AI is to stop measuring too early.</p><p>A benchmark score, a successful demo, a good retrieval result, or a working code patch can all be genuinely impressive. They are still only intermediate signals.</p><p>The business question begins one step later: <strong>did that capability change the workflow in a way that created a better outcome?</strong></p><p>From technical capability to business valueStageWhat it means<strong>Model capability</strong>Can the underlying model perform the required reasoning or generation?<strong>Agent capability</strong>Can the system reliably combine models, tools, knowledge, and procedures?<strong>Workflow behaviour</strong>Does the way work is performed actually change?<strong>Operational outcome</strong>Do cycle time, quality, throughput, rework, or intervention improve?<strong>Business outcome</strong>Does the organisation capture measurable economic or strategic value?</p><p>Each transition can fail.</p><p>A highly capable agent may be inserted into a poorly designed process. An accurate answer may arrive too late to matter. Automation may save execution time while increasing review time. A faster coding workflow may generate more rework. A customer-support assistant may improve throughput for novice workers while affecting expert workers differently. A low-cost agent may create downstream errors that are more expensive than the savings.</p><p>Enterprise architecture should therefore make the causal chain observable from the beginning.</p><h3>2. The three persistent layers I keep coming back to</h3><p>Once I separate the pieces, three persistent layers make the architecture much easier to reason about.</p><p>Table 1. Persistent capability layers in an enterprise agent platformLayerCore questionRepresentative contentKnowledgeWhat does the organization know?Policies, documentation, concepts, systems, decisions, procedures, evidence, relationshipsMemoryWhat should the agent retain from experience?Prior interactions, task state, decisions, failures, preferences, outcomes, unresolved issuesSkillsWhat does the agent know how to do?Reusable procedures, tool-use strategies, verification rules, domain workflows, evaluation-aware heuristics</p><p>They solve different problems, and that distinction matters more than it first appears.</p><p>Knowledge should behave like maintained organizational truth. Memory should evolve with experience. Skills should encode repeatable ways of working.</p><p>If all three are collapsed into one giant prompt, authority becomes muddy: a one-off memory can start looking like policy, and a useful heuristic can quietly masquerade as fact.</p><h3>3. Put them together and you get an enterprise agent stack</h3><p>The three persistent layers still need a runtime that decides what happens next.</p><p>Reference enterprise agent architectureLayerComponentRoleInput<strong>User / event / system</strong>Request, trigger, or external event entering the workflow.Coordination<strong>Orchestration</strong>Routes the task and determines the plan.Persistent capabilities<strong>Knowledge</strong>What is known: approved information, evidence, policies, and organizational context.<strong>Memory</strong>What was learned: prior outcomes, decisions, corrections, and useful task state.<strong>Skills</strong>How to act repeatedly: reusable procedures, validation rules, and tool-use strategies.Execution<strong>Model + tools</strong>Reasoning and execution interfaces used to perform the task.<strong>Action</strong>Recommendation, decision, change, or transaction produced by the agent.Control and assurance<strong>Evaluation</strong>Determines whether behaviour and results are acceptable.<strong>Observability</strong>Preserves the evidence needed to reconstruct what happened.<strong>Policy</strong>Checks whether data access and actions remained within authority.Outcome tracking<strong>Outcome ledger</strong>Records acceptance, quality, cost, intervention, and downstream effects.Business value<strong>Business measurement</strong>Connects agent outcomes to operational and financial value.</p><p>This is the stack I find most useful because it separates the components that create behaviour from the components that judge, constrain, and measure it.</p><p>This also fits the practical lesson in Anthropic’s work on effective agents: composable patterns tend to be easier to understand and control than unnecessary framework complexity [1]. Complexity should earn its way into the system.</p><h3>4. Knowledge: give the agent something authoritative to stand on</h3><p>A foundation model does not know your organization’s current policies, exceptions, ownership structures, or yesterday’s operational change. Enterprise agents therefore need a grounding layer that lives outside model weights.</p><p>RAG gave us a powerful starting point for bringing external evidence into inference [2]. In an enterprise setting, I’d push that idea further: relevance is not enough. Authority, provenance, ownership, lifecycle state, and access rights matter too.</p><p>The knowledge layer should answer more than <strong>‘what is relevant?’</strong></p><p>It should also help decide which source deserves to win when sources disagree.</p><p>It should also help answer:</p><ul><li>Which source is authoritative?</li><li>When was this knowledge last verified?</li><li>Has it been superseded?</li><li>Who owns it?</li><li>Which other concepts depend on it?</li><li>Can this agent access it?</li><li>Should this knowledge be trusted for an automated action?</li></ul><p>These properties make the knowledge layer suitable for enterprise action rather than merely question answering.</p><h3>5. Memory: continuity without turning history into noise</h3><p>Knowledge tells the agent what the organization knows. Memory tells it what happened before — and which parts of that history are still worth carrying forward.</p><p>Generative Agents showed how experiences could be stored, retrieved, and synthesized into reflections [3]. MemGPT framed longer-horizon context as a memory-management problem across different tiers [4]. Those ideas are useful, but enterprise memory has a stricter job.</p><p>The question is not ‘how much can we store?’ It is ‘which prior experience should be allowed to influence this decision?’</p><p>That is why consolidation, expiry, provenance, access control, and retrieval precision are not housekeeping. They are core memory quality controls.</p><ul><li>prior task outcomes;</li><li>human corrections;</li><li>failed approaches;</li><li>approved exceptions;</li><li>customer- or project-specific context;</li><li>evaluation results;</li><li>unresolved follow-up actions; and</li><li>changes that supersede older state.</li></ul><p>Memory quality therefore depends on consolidation, expiry, provenance, access control, and retrieval precision.</p><h3>6. Skills: procedures that live outside the model</h3><p>The third layer is procedural: what the agent knows how to do repeatedly.</p><p>Externalized skills are useful because they turn operating behavior into something visible. A skill can specify how to investigate an issue, use a tool, verify a calculation, handle an exception, or decide that a task is finished.</p><p>That gives the organization an adaptation layer between a general-purpose model and a domain-specific workflow.</p><p>SkillOpt is a good example of where this is heading. Its skill documents are treated as trainable external state, with scored trajectories, bounded edits, held-out validation, rejected-edit feedback, and version selection [5,6].</p><p>The broader point is bigger than SkillOpt itself: procedure can be versioned, evaluated, rolled back, and improved without pretending the model weights are the only place learning can happen.</p><h3>7. Capability is not authority</h3><p>Knowledge, memory, and skills can make an agent capable. They still do not tell it what it is <em>allowed</em> to do.</p><p>That distinction between capability and authority is where the control plane becomes essential.</p><ul><li>which model may be used;</li><li>which tools are available;</li><li>which data may enter context;</li><li>which actions require human approval;</li><li>which skill version is active;</li><li>which memory classes are retrievable;</li><li>which outputs require validation; and</li><li>what evidence must be logged.</li></ul><p>NIST’s Generative AI Profile and ISO/IEC 42001 both frame governance as a lifecycle responsibility, not a document you write after deployment [7,13]. OWASP’s LLM guidance makes the same point from an application-security angle: prompt injection, excessive agency, unsafe output handling, sensitive-data exposure, compromised dependencies, and unbounded consumption all need enforceable controls [14].</p><p>In practice, that means governance has to sit in the runtime path — not in a PDF nobody reads.</p><h3>8. Measure first. Calculate ROI later.</h3><p>One of the most expensive mistakes is trying to calculate ROI after deployment and discovering that the baseline was never captured.</p><p>Telemetry has to come first. OpenTelemetry’s vendor-neutral conventions are useful here because they make traces, metrics, logs, resources, and service behavior easier to compare across models and tools [15].</p><p>For every meaningful task, I want enough evidence to reconstruct not just what the agent produced, but what it used, what it cost, how much human effort it consumed, and what happened next.</p><ul><li>what task was attempted;</li><li>which agent configuration handled it;</li><li>which knowledge, memory, and skills were used;</li><li>what tools were called;</li><li>how long the task took;</li><li>what the system cost;</li><li>whether a human intervened;</li><li>what quality checks were applied;</li><li>what outcome occurred; and</li><li>whether downstream rework was required.</li></ul><pre>from dataclasses import dataclass, field<br>from datetime import datetime</pre><pre>@dataclass(slots=True)<br>class AgentOutcome:<br>    task_id: str<br>    workflow: str<br>    started_at: datetime<br>    completed_at: datetime</pre><pre>    agent_version: str<br>    model: str<br>    skill_versions: dict[str, str]</pre><pre>    knowledge_refs: list[str] = field(default_factory=list)<br>    memory_refs: list[str] = field(default_factory=list)<br>    tool_calls: int = 0</pre><pre>    model_cost_usd: float = 0.0<br>    tool_cost_usd: float = 0.0<br>    active_human_minutes: float = 0.0<br>    human_review_minutes: float = 0.0<br>    rework_minutes: float = 0.0</pre><pre>    success: bool = False<br>    accepted: bool = False<br>    quality_score: float | None = None<br>    escalated: bool = False<br>    policy_violations: int = 0</pre><pre>    def __post_init__(self) -&gt; None:<br>        if self.started_at.tzinfo is None or self.completed_at.tzinfo is None:<br>            raise ValueError(&quot;timestamps must be timezone-aware&quot;)</pre><pre>        if self.completed_at &lt; self.started_at:<br>            raise ValueError(&quot;completed_at must not precede started_at&quot;)</pre><pre>        if self.accepted and not self.success:<br>            raise ValueError(&quot;an accepted outcome must also be successful&quot;)</pre><pre>        non_negative = {<br>            &quot;tool_calls&quot;: self.tool_calls,<br>            &quot;model_cost_usd&quot;: self.model_cost_usd,<br>            &quot;tool_cost_usd&quot;: self.tool_cost_usd,<br>            &quot;active_human_minutes&quot;: self.active_human_minutes,<br>            &quot;human_review_minutes&quot;: self.human_review_minutes,<br>            &quot;rework_minutes&quot;: self.rework_minutes,<br>            &quot;policy_violations&quot;: self.policy_violations,<br>        }<br>        for name, value in non_negative.items():<br>            if value &lt; 0:<br>                raise ValueError(f&quot;{name} must be non-negative&quot;)</pre><pre>        if self.quality_score is not None and not 0.0 &lt;= self.quality_score &lt;= 1.0:<br>            raise ValueError(&quot;quality_score must be between 0 and 1&quot;)</pre><pre>    @property<br>    def elapsed_minutes(self) -&gt; float:<br>        &quot;&quot;&quot;End-to-end cycle time, including waiting time.&quot;&quot;&quot;<br>        return (self.completed_at - self.started_at).total_seconds() / 60</pre><pre>    @property<br>    def total_human_minutes(self) -&gt; float:<br>        &quot;&quot;&quot;Human effort used for capacity and labor-cost analysis.&quot;&quot;&quot;<br>        return (<br>            self.active_human_minutes<br>            + self.human_review_minutes<br>            + self.rework_minutes<br>        )</pre><p><strong>Code example 1.</strong> A validated outcome record that separates technical success, business acceptance, elapsed cycle time, and human effort.</p><p>Without this level of observability, technical performance and business performance become difficult to connect.</p><h3>9. Draw the value chain before you build the dashboard</h3><p>Before I look at a dashboard, I want the value story written as a causal chain.</p><p>That chain forces a useful discipline: if better retrieval is supposed to reduce rework, and lower rework is supposed to shorten cycle time, and shorter cycle time is supposed to lower cost per accepted outcome, each link should be measurable.</p><p>Example value chain: knowledge quality to unit economicsStepExpected effect1<strong>More accurate knowledge retrieval</strong>2Fewer unsupported agent decisions3Lower correction and rework burden4Shorter task cycle time5Higher workflow throughput6<strong>Lower cost per accepted outcome</strong></p><p>The same logic applies to procedural skills: more reliable procedure should show up in first-pass completion, escalation rate, specialist capacity, or some other downstream outcome.</p><p>Example value chain: procedural reliability to service valueStepExpected effect1<strong>Reusable skill + stronger verification</strong>2Higher first-pass completion3Fewer human escalations4Greater specialist capacity5Faster customer resolution6<strong>Higher service capacity / retention value</strong></p><p>If the causal chain cannot be stated clearly, the business case is probably still a collection of hopes.</p><h3>10. Don’t flatten every metric into one number</h3><p>Agent metrics become misleading when everything is collapsed into one score.</p><p>Table 2. Hierarchy connecting technical metrics to business outcomesLevelQuestionExamplesModelCan the model perform the underlying reasoning?Accuracy, tool-call correctness, structured-output validityAgentCan the agent complete the task reliably?Task success, trajectory quality, recovery rate, intervention rateWorkflowDoes the process improve?Cycle time, throughput, handoffs, rework, queue timeOperationalDoes the business operation improve?Cost per case, SLA compliance, defect rate, capacity, resolution rateBusinessDoes the organization capture value?Margin, revenue, retention, risk loss avoided, time-to-market</p><p>The better approach is a hierarchy: model metrics tell you whether the underlying capability is present; agent metrics tell you whether the task is completed reliably; workflow metrics tell you whether the process improves; operational and business metrics tell you whether the organization actually benefits.</p><p>An improvement at one layer can absolutely make the next layer worse. That is why the levels need to stay visible.</p><h3>11. “Productivity” needs a denominator</h3><p>‘Productivity’ sounds precise until you ask what is in the numerator and denominator.</p><p>For support it might mean resolved cases per hour above a quality threshold. For software engineering it might be accepted issue completion time including review and rework. For research it might be validated outputs per analyst-hour.</p><p>A generic formula helps only if the word <strong>accepted</strong> stays in it.</p><p>Productivity = Accepted Output / Total Effective Input</p><p>And the input side has to include the human and machine effort that actually made the result possible.</p><p>The phrase <strong>total effective input</strong> should include not only direct user time but meaningful review, correction, coordination, and machine cost where appropriate.</p><h3>12. The research is useful precisely because it disagrees</h3><p>This is where the empirical literature gets interesting, because it refuses to give us one clean headline.</p><p>Brynjolfsson, Li, and Raymond reported a 15% average increase in issues resolved per hour across 5,172 customer-support agents, with larger gains among less experienced and lower-skilled workers [8].</p><p>Peng and colleagues reported that participants using GitHub Copilot completed a bounded JavaScript HTTP-server task 55.8% faster than the control group [9].</p><p>Then the picture changes in harder real-world work. METR’s 2025 randomized study of 16 experienced open-source developers across 246 tasks found that then-current AI tools increased implementation time by 19% in that setting [10]. A later METR follow-up suggested newer models were materially more helpful, while also noting that the evaluation itself was becoming harder to interpret as developer behavior and parallel-agent usage changed [11].</p><p>Dell’Acqua and colleagues add another piece: across 758 consultants, AI improved speed, completion, and quality for tasks inside the technology’s capability frontier, but reduced correctness on a task deliberately placed outside it [12].</p><p>That is why I would not ask whether ‘AI improves productivity’ in the abstract. The meaningful unit is the specific task, user, workflow, architecture, and measurement boundary.</p><blockquote>Enterprise AI value is conditional on the task, worker, model, workflow, controls, and measurement boundary.</blockquote><h3>13. Measure knowledge by what it prevents downstream</h3><p>Retrieval precision is useful, but the most interesting knowledge metrics are usually downstream.</p><p>Table 3. Knowledge-layer metrics and their operational interpretationMetricWhat it revealsGrounded-answer rateWhether material claims can be traced to approved evidenceKnowledge freshnessWhether retrieved information remains currentAuthority match rateWhether the agent selected the correct source when sources conflictRetrieval sufficiencyWhether the retrieved context was enough to complete the taskCorrection due to stale knowledgeOperational cost caused by outdated informationKnowledge reuseHow often maintained knowledge avoids repeated reconstruction work</p><p>I care about whether the knowledge layer prevented a correction, escalation, unsupported action, or repeated reconstruction of something the organization already knew.</p><h3>14. Memory should earn its place</h3><p>A memory system should not be rewarded for remembering more.</p><p>It should be rewarded for making future work better without introducing stale state, duplication, privacy problems, or false confidence.</p><ul><li>retrieval precision of memory items;</li><li>percentage of tasks helped by prior memory;</li><li>stale-memory retrieval rate;</li><li>duplicate-memory rate;</li><li>human corrections caused by incorrect remembered state;</li><li>successful reuse of prior decisions;</li><li>memory-related privacy or authorization incidents; and</li><li>time saved by continuity across sessions.</li></ul><p>The right question is whether the memory item helped the next decision enough to justify being there.</p><h3>15. Skills give you a clean way to measure procedure</h3><p>Externalized skills create something enterprises rarely get from prompt-heavy systems: a way to measure procedure separately from model capability.</p><p>That means the same model can be tested with and without a skill, different skill versions can be compared, and changes in behavior can be attributed more cleanly.</p><ul><li>task success with and without a skill;</li><li>different versions of the same skill;</li><li>transfer of a skill across compatible models;</li><li>cost per successful task;</li><li>tool-use efficiency;</li><li>validation pass rate;</li><li>skill-induced regression rate; and</li><li>human-review burden after skill updates.</li></ul><p>This is also why skills become strategically interesting: they turn procedural improvement into something inspectable rather than something buried inside a model replacement.</p><h3>16. The unit economics that matter are per accepted outcome</h3><p>Token price is one of the least interesting numbers in enterprise agent economics.</p><p>The unit I care about is the <strong>accepted outcome</strong>: something the business can actually use at the required quality level.</p><p>Once you use that denominator, model cost, tool cost, human review, rework, platform cost, and expected risk all belong in the same conversation.</p><p>Cper accepted outcome = (Cmodel + Ctools + Creview + Crework + Cplatform + Crisk) / Naccepted</p><p>A cheap model can still be an expensive system if people spend their day correcting it.</p><ul><li><strong>Cmodel</strong> = inference and model-provider cost;</li><li><strong>Ctools</strong> = external APIs, sandboxes, search, compute, or other service costs;</li><li><strong>Creview</strong> = human verification and approval cost;</li><li><strong>Crework</strong> = correction and downstream remediation;</li><li><strong>Cplatform</strong> = allocated infrastructure and maintenance; and</li><li><strong>Crisk</strong> = expected loss associated with material failure, where a defensible estimate is possible.</li></ul><p>This prevents low model spend from masking an expensive human-review process or high downstream rework.</p><h3>17. ROI is simple on paper — and easy to fake in practice</h3><p>The ROI equation itself is easy. The hard part is deciding what counts as a realized benefit.</p><p>ROI = (Realized Benefit − Total Incremental Cost) / Total Incremental Cost</p><p>Time saved is not automatically money saved. Capacity has to be redeployed, more work has to be completed, cost has to be removed, revenue has to arrive earlier, risk has to fall, or some other economic effect has to be captured.</p><ul><li>labor capacity released and actually redeployed;</li><li>additional cases or transactions handled;</li><li>reduced contractor or outsourcing cost;</li><li>reduced defect or rework expense;</li><li>faster revenue recognition;</li><li>higher conversion or retention;</li><li>lower incident exposure;</li><li>shorter time-to-market; or</li><li>risk loss avoided.</li></ul><p>That is the difference between theoretical efficiency and realized value.</p><h3>18. Use a counterfactual, not a success story</h3><p>Before-and-after stories are seductive because they are simple. They are also weak evidence when deployment happens alongside process redesign, staffing changes, training, seasonality, or new management attention.</p><p>When the setting allows it, randomized trials, staggered rollout, matched controls, A/B testing, difference-in-differences, shadow mode, or repeated within-subject comparisons give a much stronger counterfactual [16].</p><ul><li>randomized controlled trials;</li><li>staggered rollout;</li><li>matched control groups;</li><li>A/B testing;</li><li>difference-in-differences;</li><li>shadow mode followed by controlled activation; or</li><li>repeated within-subject comparisons for stable task classes.</li></ul><p>The point is not to turn every deployment into an academic study. It is to preserve enough comparison to know whether the agent caused the change you are celebrating.</p><h3>19. Shadow mode is underrated</h3><p>For higher-stakes workflows, shadow mode is one of the safest ways to learn before granting authority.</p><p>The agent sees the same inputs as the live process and produces its recommendation, but the recommendation does not control production.</p><p>That gives you a clean view of agreement, error patterns, potential time savings, escalation cases, knowledge gaps, memory failures, and operating cost before the system can hurt anything.</p><ul><li>agent decision versus actual human decision;</li><li>quality and error patterns;</li><li>potential cycle-time savings;</li><li>cases requiring escalation;</li><li>knowledge gaps;</li><li>memory failures; and</li><li>estimated operating cost.</li></ul><p>Authority can then expand because evidence improved — not because the demo looked convincing.</p><h3>20. Human review can be a feature, not a failure</h3><p>Human intervention is easy to misread as failure.</p><p>Sometimes it is failure. Sometimes it is exactly the safety boundary the system was designed to have.</p><p>That is why planned review, correction, clarification, escalation, and override should be logged separately.</p><ul><li><strong>planned review</strong> — a designed control;</li><li><strong>corrective intervention</strong> — a response to an agent error;</li><li><strong>clarification</strong> — information the system could not infer safely;</li><li><strong>escalation</strong> — a case outside the agent’s authority or capability; and</li><li><strong>override</strong> — a human decision that intentionally differs from the agent recommendation.</li></ul><p>They represent different problems, and they lead to different architectural fixes.</p><h3>21. More output is not necessarily more value</h3><p>Automation can increase output while quietly making the organization worse.</p><p>Quality-adjusted throughput is a useful antidote because it forces volume to be multiplied by acceptance and quality rather than celebrated on its own.</p><p>QAT = Completed Units × Acceptance Rate × Quality Weight</p><p>For coding, accepted pull requests with low rework tell me more than lines generated. For support, durable resolutions tell me more than messages sent.</p><p>For software development, for example, accepted pull requests with low rework may be more meaningful than lines of code generated. For customer support, cases resolved at an acceptable satisfaction and reopen rate are more meaningful than messages sent.</p><h3>22. Architecture has a cost too</h3><p>The AI bill is not the architecture bill.</p><p>Knowledge maintenance, memory lifecycle, skill evaluation, sandboxes, orchestration, security, review, telemetry, audits, training, and workflow redesign all cost money too.</p><p>Table 4. Total cost categories for an enterprise agent systemCost categoryExamplesKnowledgeIngestion, indexing, source maintenance, verification, access controlsMemoryStorage, consolidation, retrieval, deletion, privacy controlsSkillsAuthorship, evaluation, optimization, regression testing, release managementRuntimeModels, tools, sandboxes, orchestration, retriesGovernancePolicy design, human review, security testing, auditsMeasurementTelemetry, experiments, dashboards, analyst timeChange managementTraining, workflow redesign, adoption support</p><p>An ROI model that counts only API spend is almost guaranteed to make the system look cheaper than it is.</p><h3>23. Build a business-impact ledger</h3><p>Once telemetry exists, I want it translated into a business-impact ledger rather than left as disconnected traces.</p><pre>from typing import Protocol, Sequence</pre><pre>class Baseline(Protocol):<br>    def human_minutes(self, workflow: str) -&gt; float:<br>        &quot;&quot;&quot;Expected human effort for a comparable unassisted task.&quot;&quot;&quot;<br>        ...</pre><pre>def business_impact(<br>    outcomes: Sequence[AgentOutcome],<br>    baseline: Baseline,<br>) -&gt; dict[str, float | int | None]:<br>    total_tasks = len(outcomes)<br>    successful = [item for item in outcomes if item.success]<br>    accepted = [item for item in outcomes if item.accepted]</pre><pre>    gross_time_saved_hours = sum(<br>        baseline.human_minutes(item.workflow)<br>        - item.active_human_minutes<br>        for item in outcomes<br>    ) / 60</pre><pre>    review_hours = sum(<br>        item.human_review_minutes for item in outcomes<br>    ) / 60</pre><pre>    rework_hours = sum(<br>        item.rework_minutes for item in outcomes<br>    ) / 60</pre><pre>    net_capacity_hours = sum(<br>        baseline.human_minutes(item.workflow)<br>        - item.total_human_minutes<br>        for item in outcomes<br>    ) / 60</pre><pre>    direct_ai_cost = sum(<br>        item.model_cost_usd + item.tool_cost_usd<br>        for item in outcomes<br>    )</pre><pre>    return {<br>        &quot;total_tasks&quot;: total_tasks,<br>        &quot;successful_tasks&quot;: len(successful),<br>        &quot;accepted_tasks&quot;: len(accepted),<br>        &quot;success_rate&quot;: len(successful) / total_tasks if total_tasks else 0.0,<br>        &quot;acceptance_rate&quot;: len(accepted) / total_tasks if total_tasks else 0.0,<br>        &quot;gross_time_saved_hours&quot;: gross_time_saved_hours,<br>        &quot;review_hours&quot;: review_hours,<br>        &quot;rework_hours&quot;: rework_hours,<br>        &quot;net_capacity_hours&quot;: net_capacity_hours,<br>        &quot;direct_ai_cost_usd&quot;: direct_ai_cost,<br>        &quot;direct_ai_cost_per_accepted_task_usd&quot;: (<br>            direct_ai_cost / len(accepted) if accepted else None<br>        ),<br>    }</pre><p>The goal is a transparent path from task events to capacity, cost, acceptance, rework, and outcome-level economics.</p><p>Notice what the example below does <em>not</em> do: it does not treat technical success as the same thing as acceptance, and it does not hide slower outcomes by clipping negative savings.</p><h3>24. Make counterfactual measurement part of the platform</h3><p>Counterfactual measurement gets much easier when it is a platform capability rather than a spreadsheet exercise added at the end.</p><p>For repeatable workflows, baseline and agent-assisted observations should live together with the deployment version, time window, and evaluation design.</p><pre>{<br>  &quot;workflow&quot;: &quot;technical_support_case&quot;,<br>  &quot;measurement_window&quot;: &quot;2026-Q3&quot;,<br>  &quot;design&quot;: &quot;staggered_rollout&quot;,<br>  &quot;agent_version&quot;: &quot;support-agent-3.2&quot;,<br>  &quot;model_version&quot;: &quot;provider-model-version&quot;,<br>  &quot;skill_versions&quot;: {<br>    &quot;triage&quot;: &quot;2.1.0&quot;,<br>    &quot;resolution_composition&quot;: &quot;1.4.2&quot;<br>  },<br>  &quot;baseline&quot;: {<br>    &quot;cases&quot;: 410,<br>    &quot;median_minutes&quot;: 41.2,<br>    &quot;acceptance_rate&quot;: 0.88,<br>    &quot;reopen_rate&quot;: 0.09<br>  },<br>  &quot;agent_assisted&quot;: {<br>    &quot;cases&quot;: 406,<br>    &quot;median_minutes&quot;: 33.4,<br>    &quot;acceptance_rate&quot;: 0.91,<br>    &quot;reopen_rate&quot;: 0.08,<br>    &quot;review_minutes&quot;: 3.1,<br>    &quot;ai_cost_per_case_usd&quot;: 0.47<br>  },<br>  &quot;cycle_time_change_percent&quot;: -18.93,<br>  &quot;evidence_status&quot;: &quot;illustrative&quot;<br>}</pre><p>The example below is illustrative, but the structure is the useful part: the comparison context travels with the result.</p><p>The numbers above are illustrative, not empirical claims. The value of the structure is that it forces the organization to record the baseline, treatment metrics, time window, and evaluation design together.</p><h3>25. Average gains can hide where the value really is</h3><p>Average effects are useful for headlines and dangerous for deployment decisions.</p><p>Worker experience, task difficulty, novelty, risk, review intensity, tool access, knowledge completeness, and model version can all change the effect dramatically.</p><ul><li>worker experience;</li><li>task complexity;</li><li>task novelty;</li><li>workflow stage;</li><li>model or agent version;</li><li>customer segment;</li><li>risk level;</li><li>degree of human review;</li><li>tool availability; and</li><li>knowledge completeness.</li></ul><p>The studies above already show this heterogeneity [8,12]. Enterprise deployment should therefore optimize <em>placement</em>, not just adoption.</p><p>Enterprise deployment should optimize placement, not merely adoption.</p><h3>26. Risk reduction can be real value — if you estimate it honestly</h3><p>Labor savings are only one path to value.</p><p>A well-governed agent can also create value by preventing policy deviations, stale-procedure use, unsupported claims, unsafe actions, repeated failures, or audit gaps.</p><ul><li>detecting policy deviations before execution;</li><li>preventing use of stale procedures;</li><li>flagging unsupported claims;</li><li>requiring approval for high-risk actions;</li><li>detecting scope expansion in engineering work;</li><li>preserving evidence for audit; and</li><li>identifying repeated failure patterns before recurrence.</li></ul><p>But risk savings are easy to inflate. Expected loss avoided is only useful when the probability, severity, and intervention effect are estimated with discipline.</p><h3>27. The organization has to change too</h3><p>Even a technically excellent agent can fail economically if the surrounding workflow refuses to change.</p><p>If the same approval chains remain, manual work is duplicated, people copy outputs into legacy systems, incentives still reward old activity metrics, or the real bottleneck sits somewhere else, the agent may save minutes without changing the business.</p><ul><li>unchanged approval chains;</li><li>duplicated manual processes;</li><li>workers re-entering AI outputs into legacy systems;</li><li>incentives that reward old activity metrics;</li><li>unclear accountability;</li><li>low trust in the system;</li><li>insufficient training; and</li><li>process bottlenecks elsewhere in the workflow.</li></ul><p>That is why the measurement boundary has to include the workflow — not just the chat window.</p><p>Business-impact analysis must therefore measure the entire workflow, not the agent interaction alone.</p><h3>28. Use a balanced scorecard</h3><p>A balanced scorecard is the easiest way I know to stop one local metric from hijacking the entire program.</p><p>Table 5. Balanced enterprise agent scorecardDomainCore measuresCapabilityTask success, tool accuracy, retrieval qualityQualityAcceptance rate, defect rate, groundedness, reworkEfficiencyCycle time, throughput, cost per accepted taskHuman impactReview burden, escalation burden, learning, adoptionKnowledgeFreshness, provenance, authority match, reuseMemoryUseful retrieval, stale retrieval, continuity benefitSkillsValidation gains, regressions, transfer, rollback readinessRiskPolicy violations, security events, high-risk overridesBusinessRealized savings, revenue impact, SLA improvement, risk loss avoided</p><h3>29. A deployment sequence I’d actually trust</h3><p>If I were deploying this in an enterprise, I would resist the temptation to start with autonomy.</p><ol><li><strong>Define the workflow.</strong> Identify the business process, users, current bottlenecks, and baseline metrics.</li><li><strong>Define the value hypothesis.</strong> State precisely how the agent is expected to improve the workflow.</li><li><strong>Build the knowledge boundary.</strong> Identify authoritative information and access controls.</li><li><strong>Add memory only where continuity has value.</strong> Avoid storing information merely because it can be stored.</li><li><strong>Externalize repeatable procedures as skills.</strong> Make operational behavior inspectable.</li><li><strong>Instrument the workflow.</strong> Capture cost, latency, quality, intervention, and outcome events.</li><li><strong>Establish offline evaluations.</strong> Test capabilities before production exposure.</li><li><strong>Run shadow mode or a controlled pilot.</strong> Compare against a baseline.</li><li><strong>Segment results.</strong> Determine where the agent helps and where it does not.</li><li><strong>Expand authority gradually.</strong> Increase automation only where evidence supports it.</li><li><strong>Track realized value.</strong> Distinguish theoretical time savings from financial or capacity outcomes actually captured.</li><li><strong>Continuously re-evaluate.</strong> Models, tools, skills, workflows, and user behavior change over time.</li></ol><h3>30. The principle tying all of this together</h3><p>The whole architecture collapses into one principle: intelligence should stay accountable to evidence and outcomes.</p><p>The accountability chainComponentWhat it contributes<strong>Knowledge</strong>Gives the agent grounded context.<strong>Memory</strong>Gives the agent continuity across tasks and time.<strong>Skills</strong>Give the agent repeatable procedure.<strong>Orchestration</strong>Coordinates execution.<strong>Governance</strong>Bounds authority and access.<strong>Evaluation</strong>Determines whether behaviour is acceptable.<strong>Measurement</strong>Determines whether the organisation actually benefits.</p><p>Knowledge gives the agent grounded context. Memory gives continuity. Skills give repeatable procedure. Orchestration coordinates execution. Governance bounds authority. Evaluation tells us whether the behavior is acceptable. Measurement tells us whether the organization benefited.</p><p>If the sequence stops before measurement, the platform may still be technically impressive. It is simply not yet a demonstrated business capability.</p><h3>The question is not “How capable is the agent?”</h3><p>The enterprise question is not simply whether an agent can reason, retrieve, call tools, or execute a multi-step task.</p><p>It is whether the entire system can explain <strong>what the agent knew, what it remembered, what procedure it followed, what authority it had, how reliably it acted, what it cost, and what changed downstream.</strong></p><p>RAG, persistent-memory research, trainable skills, composable agent patterns, governance frameworks, security guidance, and observability standards already give us many of the pieces [1–7,13–15]. The business layer is what forces those pieces to become accountable to outcomes rather than demos.</p><p>That is why I think the most useful enterprise agent stack is also a measurement stack.</p><p>When the architecture can trace a better knowledge source to less rework, a useful memory to faster diagnosis, a skill revision to higher acceptance, a routing decision to lower cost, or a control to a prevented failure, agentic AI stops being an abstract capability story.</p><p>It becomes an operating system the organization can actually evaluate — and improve.</p><h3>References</h3><p><strong>References.</strong> I’ve kept the source list intact because the architecture above draws on research and practitioner work across retrieval, memory, agent design, skill optimization, governance, security, observability, and productivity measurement.</p><p><strong>[1]</strong> Anthropic, “Building effective agents,” <em>Anthropic Engineering</em>, 2024. [Online]. Available: <a href="https://www.anthropic.com/engineering/building-effective-agents">https://www.anthropic.com/engineering/building-effective-agents</a>.</p><p><strong>[2]</strong> P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W. Yih, T. Rocktäschel, S. Riedel, and D. Kiela, “Retrieval-augmented generation for knowledge-intensive NLP tasks,” in <em>Advances in Neural Information Processing Systems</em>, vol. 33, pp. 9459–9474, 2020. [Online]. Available: <a href="https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html">NeurIPS proceedings</a>.</p><p><strong>[3]</strong> J. S. Park, J. C. O’Brien, C. J. Cai, M. R. Morris, P. Liang, and M. S. Bernstein, “Generative agents: Interactive simulacra of human behavior,” in <em>Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology</em>, 2023, doi: <a href="https://doi.org/10.1145/3586183.3606763">10.1145/3586183.3606763</a>.</p><p><strong>[4]</strong> C. Packer, S. Wooders, K. Lin, V. Fang, S. G. Patil, I. Stoica, and J. E. Gonzalez, “MemGPT: Towards LLMs as operating systems,” arXiv:2310.08560, 2023. [Online]. Available: <a href="https://arxiv.org/abs/2310.08560">https://arxiv.org/abs/2310.08560</a>.</p><p><strong>[5]</strong> Y. Yang, Z. Gong, W. Huang, Q. Yang, Z. Zhou, Z. Huang, Y. Li, X. Gao, Q. Dai, B. Liu, K. Qiu, Y. Yang, D. Chen, X. Yang, and C. Luo, “SkillOpt: Executive strategy for self-evolving agent skills,” arXiv:2605.23904, 2026. [Online]. Available: <a href="https://arxiv.org/abs/2605.23904">https://arxiv.org/abs/2605.23904</a>.</p><p><strong>[6]</strong> Microsoft Research, “SkillOpt: Agent skills as trainable parameters,” 2026. [Online]. Available: <a href="https://www.microsoft.com/en-us/research/blog/skillopt-agent-skills-as-trainable-parameters/">Microsoft Research</a>.</p><p><strong>[7]</strong> C. Autio, R. Schwartz, J. Dunietz, S. Jain, M. Stanley, E. Tabassi, P. Hall, and K. Roberts, <em>Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile</em>, NIST AI 600–1. Gaithersburg, MD, USA: National Institute of Standards and Technology, 2024, doi: <a href="https://doi.org/10.6028/NIST.AI.600-1">10.6028/NIST.AI.600–1</a>.</p><p><strong>[8]</strong> E. Brynjolfsson, D. Li, and L. R. Raymond, “Generative AI at work,” <em>The Quarterly Journal of Economics</em>, vol. 140, no. 2, pp. 889–942, 2025, doi: <a href="https://doi.org/10.1093/qje/qjae044">10.1093/qje/qjae044</a>.</p><p><strong>[9]</strong> S. Peng, E. Kalliamvakou, P. Cihon, and M. Demirer, “The impact of AI on developer productivity: Evidence from GitHub Copilot,” arXiv:2302.06590, 2023, doi: <a href="https://doi.org/10.48550/arXiv.2302.06590">10.48550/arXiv.2302.06590</a>.</p><p><strong>[10]</strong> J. Becker, N. Rush, B. Barnes, and D. Rein, <em>Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity</em>. Berkeley, CA, USA: Model Evaluation &amp; Threat Research, 2025. [Online]. Available: <a href="https://metr.org/Early_2025_AI_Experienced_OS_Devs_Study-paper.pdf">METR study</a>.</p><p><strong>[11]</strong> Model Evaluation &amp; Threat Research, <em>Progress Report: December–February 2026</em>, 2026. [Online]. Available: <a href="https://metr.org/february-2026-progress-report.pdf">METR progress report</a>.</p><p><strong>[12]</strong> F. Dell’Acqua, E. McFowland III, E. Mollick, H. Lifshitz, K. C. Kellogg, S. Rajendran, L. Krayer, F. Candelon, and K. R. Lakhani, “Navigating the jagged technological frontier: Field experimental evidence of the effects of artificial intelligence on knowledge worker productivity and quality,” <em>Organization Science</em>, vol. 37, no. 2, pp. 403–423, 2026, doi: <a href="https://doi.org/10.1287/orsc.2025.21838">10.1287/orsc.2025.21838</a>.</p><p><strong>[13]</strong> International Organization for Standardization, <em>ISO/IEC 42001:2023 Information Technology — Artificial Intelligence — Management System</em>. Geneva, Switzerland: ISO, 2023. [Online]. Available: <a href="https://www.iso.org/standard/42001">https://www.iso.org/standard/42001</a>.</p><p><strong>[14]</strong> OWASP Foundation, <em>OWASP Top 10 for Large Language Model Applications, 2025 Edition</em>, 2025. [Online]. Available: <a href="https://genai.owasp.org/llm-top-10/">https://genai.owasp.org/llm-top-10/</a>.</p><p><strong>[15]</strong> OpenTelemetry Authors, <em>OpenTelemetry Semantic Conventions</em>, ver. 1.44.0, 2026. [Online]. Available: <a href="https://opentelemetry.io/docs/specs/semconv/">https://opentelemetry.io/docs/specs/semconv/</a>.</p><p><strong>[16]</strong> R. Kohavi and R. Longbotham, “Online controlled experiments and A/B testing,” in <em>Encyclopedia of Machine Learning and Data Mining</em>, C. Sammut and G. I. Webb, Eds. Boston, MA, USA: Springer, 2017, pp. 922–929, doi: <a href="https://doi.org/10.1007/978-1-4899-7687-1_891">10.1007/978–1–4899–7687–1_891</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c58b48d1d112" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prompts Aren’t Enough Anymore: What SkillOpt Taught Me About Trainable AI Agent Skills]]></title>
            <link>https://medium.com/@chandi.academic/prompts-arent-enough-anymore-what-skillopt-taught-me-about-trainable-ai-agent-skills-05be51b9132d?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/05be51b9132d</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-agent-skills]]></category>
            <category><![CDATA[writing-prompts]]></category>
            <category><![CDATA[skillopt]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 16:51:48 GMT</pubDate>
            <atom:updated>2026-09-24T16:51:48.678Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwprNpf7hEk0jOUPfnFU4A.png" /></figure><p>SkillOpt treats agent skills as trainable external state. That simple shift opens a much bigger question: what would it take to make skill optimization reliable enough for real production systems?</p><p>A practical exploration of SkillOpt, agent evaluation, self-supervised skill optimization, and the governance needed to move these ideas into production.</p><h3>What I’m exploring</h3><ol><li><a href="#s1">Why prompts start looking like software once agents become multi-step</a></li><li><a href="#s5">What SkillOpt changes about how we improve agent behavior</a></li><li><a href="#s7">How an evaluation-gated skill optimizer could work</a></li><li><a href="#s13">Why skills need modularity, registries, routing, and tests</a></li><li><a href="#s16">Why agent evaluation has to inspect trajectories, not just answers</a></li><li><a href="#s22">Where optimization must stop: safety, permissions, and trust boundaries</a></li><li><a href="#s23">How I would release an improved skill into production</a></li><li><a href="#s27">When I would avoid skill optimization entirely</a></li></ol><h3>The research thread that made this click</h3><p><strong>SkillOpt</strong>, introduced by Yang and colleagues and developed further through Microsoft Research, provides the central mechanism explored here: keep the target model frozen, treat the natural-language skill as trainable external state, learn from execution trajectories, propose bounded edits, and promote a revision only when it survives validation [<a href="#ref1">1</a>, <a href="#ref2">2</a>].</p><p>That mechanism fits into a broader shift in agent engineering. Anthropic’s work on composable agent patterns and trajectory-aware evaluation emphasizes that reliable agents need explicit workflows and evaluation of the process, not just the final answer [<a href="#ref5">5</a>, <a href="#ref6">6</a>]. More recent work extends skill optimization into self-supervised settings where clean labels are unavailable [<a href="#ref3">3</a>].</p><p>Production use adds another layer. NIST’s generative-AI risk framework and OWASP’s guidance on LLM application security make provenance, permissions, policy boundaries, and human oversight difficult to treat as afterthoughts [<a href="#ref7">7</a>, <a href="#ref8">8</a>].</p><p>Put together, these strands suggest something larger than “better prompting.” Agent procedures are becoming engineering artifacts: things that can be versioned, tested, routed, secured, released, rolled back, and improved under evidence. The rest of this article follows that idea into the practical architecture around a trainable skill.</p><h3>The moment a prompt starts behaving like software</h3><p>I used to think of prompts as text: write a better instruction, get a better answer. That mental model still works for a single request. It starts to feel incomplete once the model becomes an agent that searches, calls tools, edits files, recovers from failures, and works across several steps.</p><p>At that point the agent needs more than a request. It needs a procedure: when to search, what evidence to trust, when to verify, which tools to use, how to recover, when to escalate, and when to stop.</p><p>Those choices are not cosmetic. They shape the behavior of the system.</p><p>That is why I find the idea of an <strong>agent skill</strong> so useful: a reusable natural-language artifact that captures operating knowledge for a class of tasks.</p><blockquote>A prompt tells a model what I want now. A skill defines how I want an agent to approach this kind of work again and again.</blockquote><p>The distinction I keep in my head is simple: a prompt tells the model what I want right now; a skill tells an agent how I want it to approach this kind of work repeatedly.</p><p>Once I frame it that way, familiar software-engineering needs appear immediately: versioning, ownership, evaluation, modularity, rollout, rollback, and observability. That is also consistent with the broader push toward explicit, composable agent workflows rather than one enormous magical prompt [<a href="#ref5">5</a>].</p><h3>SkillOpt’s key move: make the skill external state</h3><p>SkillOpt treats the natural-language skill as <strong>state outside a frozen target model</strong> [<a href="#ref1">1</a>, <a href="#ref2">2</a>]. That shift is deceptively powerful: the model can stay fixed while the procedure around it becomes something that can be versioned, evaluated, and improved.</p><p>That puts skills in a very interesting middle ground. They are more durable and testable than one-shot prompting, but far more transparent and lightweight than changing model weights.</p><p>MechanismWhat changes?Primary advantagePrimary limitationOne-shot promptingImmediate instructionFast and flexibleDifficult to improve systematicallyReusable skillPersistent natural-language procedureInspectable and portableStill requires evaluation disciplineSkill optimizationSkill document through evaluated editsSystematic improvement without weight updatesDepends on reliable evaluationFine-tuningModel weightsDeep behavioral adaptationLess transparent and more operationally expensive</p><p>Operationally, the skill can be inspected, diffed in Git, moved between compatible runtimes, evaluated against a test suite, rolled back, or replaced — all without retraining the foundation model. That is a powerful systems property, not just a research trick.</p><h3>What I actually want inside a skill</h3><p>If I am going to call something a skill, I do not want it to be a motivational paragraph that says “be careful” and “think step by step.” I want it to encode the parts of the workflow that actually change what the agent does.</p><p>For me, that usually means the objective, the sequence of work, evidence rules, tool heuristics, verification, common failure modes, edge cases, escalation conditions, stopping criteria, and the expected output.</p><ul><li>task objective;</li><li>general procedure;</li><li>evidence-gathering rules;</li><li>tool-use heuristics;</li><li>verification steps;</li><li>common failure patterns;</li><li>edge cases;</li><li>escalation conditions;</li><li>stopping criteria; and</li><li>output requirements.</li></ul><p>Here is a compact example for repository bug investigation. Notice that it is still readable English, but it is operational enough to shape a trajectory rather than merely the tone of the final answer.</p><pre># Repository Bug Investigation</pre><pre>## Objective<br>Identify the smallest evidence-supported code change that resolves<br>the reported failure without expanding public behavior unnecessarily.</pre><pre>## Procedure<br>1. Reproduce or localize the failure before editing.<br>2. Inspect tests and repository history around the affected code.<br>3. Form an explicit hypothesis.<br>4. Change the minimum justified surface area.<br>5. Run targeted tests before broader regression tests.<br>6. Re-check the patch against the issue scope.</pre><pre>## Evidence Rules<br>- Treat passing tests as necessary but not sufficient evidence.<br>- Prefer repository history over assumptions about why unusual code exists.<br>- Record unresolved ambiguity instead of inventing intent.</pre><pre>## Tool Use<br>- Read before writing; do not edit a file that has not been inspected.<br>- Prefer targeted search over whole-repository scans.<br>- Re-read a file after editing it rather than assuming the edit applied.</pre><pre>## Verification<br>Run tests before returning the answer.</pre><pre>## Failure Patterns<br>- Do not perform unrelated refactors during a bug fix.<br>- Do not remove defensive logic without checking why it was introduced.</pre><pre>## Edge Cases<br>- Intermittent failures: establish reproducibility before attributing a cause.<br>- Failures only in CI: compare environment and dependency versions first.</pre><pre>## Escalation<br>Stop and ask when the fix requires a schema change, a public interface<br>change, or a change to code owned by another team.</pre><pre>## Stopping Criteria<br>Stop when the targeted tests pass, the regression suite is unchanged,<br>and the patch is confined to the hypothesized cause.</pre><pre>## Output<br>Summarize the root cause, changed files, validation evidence,<br>remaining uncertainty, and any scope expansion.</pre><p>This is the line I care about: a good skill should make behavior easier to reproduce, review, and evaluate. If nobody can tell what the procedure is actually asking the agent to do, it is hard to improve it systematically.</p><h3>Why hand-editing prompts eventually breaks down</h3><p>Human-authored skills remain essential because domain experts understand intent, risk, and the strange edge cases that benchmarks rarely capture. The problem begins when every revision is accepted simply because it sounds smarter.</p><p>The first trap is recency. One bad failure happens, we add a rule for it, and suddenly ten unrelated cases get worse.</p><h3>The last failure takes over the whole skill</h3><p>The second is prompt accretion. Every incident contributes another paragraph until the skill becomes a history of anxieties rather than a coherent procedure.</p><h3>The skill keeps growing and never gets cleaner</h3><p>Then there are trade-offs we often do not measure. A new rule may improve completion while doubling tool calls, latency, or review burden.</p><h3>The “fix” gets expensive somewhere else</h3><p>There is also the classic regression problem: we test the exact example that triggered the change, congratulate ourselves when it passes, and never check what else broke.</p><h3>The motivating example passes — something else breaks</h3><p>And if the agent is allowed to keep rewriting its own instructions without a stable baseline, the procedure can drift so gradually that nobody notices the original operating model has disappeared.</p><h3>Nobody can say what the procedure is anymore</h3><p>None of these problems mean manual authorship is bad. They mean manual authorship needs the same thing ordinary software changes need: evidence before promotion.</p><p>A training-style loop addresses that problem more cleanly than an endless cycle of adding another sentence after every failure.</p><h3>SkillOpt turns that intuition into an optimization loop</h3><p>SkillOpt gives this intuition a concrete form. The target agent stays frozen; a separate optimizer looks at scored trajectories, proposes constrained changes to the skill, and lets held-out evaluation decide whether the candidate is actually better [<a href="#ref1">1</a>, <a href="#ref2">2</a>].</p><pre>Current skill<br>     │<br>     ▼<br>Frozen target agent<br>     │<br>     ▼<br>Scored task rollouts<br>     │<br>     ▼<br>Reflect on successes + failures<br>     │<br>     ▼<br>Propose bounded edits<br>     │<br>     ▼<br>Candidate skill<br>     │<br>     ▼<br>Held-out validation<br>     │<br> ┌───┴───────────────┐<br> ▼                   ▼<br>reject             accept<br> │                   │<br> └────► history       ▼<br>                  best skill</pre><p>The important distinction is that this is not simply “ask another LLM to rewrite the prompt.” The rewrite sits inside a controlled evaluation loop.</p><p>The published SkillOpt approach uses bounded add/delete/replace operations, validation gating, feedback from rejected edits, and slower higher-level updates to make the optimization more stable [<a href="#ref1">1</a>, <a href="#ref2">2</a>]. That combination is what makes the idea feel like engineering rather than prompt folklore.</p><h3>A useful analogy: the skill is the parameter</h3><p>The “trainable parameter” analogy is useful, as long as we do not stretch it too far.</p><p>In conventional training, an optimizer changes numeric weights. Here, the thing being changed is a natural-language procedure. It is discrete, semantic, and human-readable rather than a continuous tensor.</p><p>Still, the mapping is surprisingly helpful because it gives us familiar concepts: tasks become training examples, rollouts become forward passes, evaluation becomes the objective, bounded edits play the role of updates, and versioned skills become checkpoints.</p><p>Weight-space trainingSkill-space optimizationModel weightsSkill documentTraining examplesAgent tasksForward passAgent rolloutLoss / rewardTask score or evaluator feedbackGradient updateBounded text editLearning rateEdit budgetValidation setHeld-out agent tasksCheckpointVersioned skill artifact</p><p>The difference is important: there is no conventional gradient flowing through the document. The optimizer is reasoning about behavior and proposing semantic changes. I think of the analogy as an operational guide, not a mathematical equivalence.</p><h3>What an evaluation-gated optimizer could look like</h3><p>Once I started thinking this way, I wanted to know what the smallest credible optimizer would look like. Not a full framework — just enough code to make the control boundaries obvious.</p><pre>from dataclasses import dataclass, field<br>from datetime import datetime<br></pre><pre>@dataclass(frozen=True)<br>class SkillVersion:<br>    text: str<br>    score: float<br>    version: int<br>    parent: int | None = None<br>    created_at: datetime | None = None<br>    accepted_patch: dict | None = None<br></pre><pre>@dataclass<br>class OptimizationResult:<br>    current: SkillVersion<br>    accepted: bool<br>    candidate_score: float<br>    reason: str<br>    rejected: list[dict] = field(default_factory=list)<br></pre><pre>def optimize_step(<br>    current: SkillVersion,<br>    training_batch,<br>    validation_batch,<br>    target_agent,<br>    evaluator,<br>    optimizer,<br>    rejected_buffer,<br>    trials: int = 3,<br>    min_gain: float = 0.01,<br>    max_skill_chars: int = 8000,<br>):<br>    trajectories = [<br>        (task, result, evaluator.score(task, result))<br>        for task in training_batch<br>        for result in [target_agent.run(task, skill=current.text)]<br>    ]</pre><pre>    patch = optimizer.propose_bounded_edit(<br>        skill=current.text,<br>        trajectories=trajectories,<br>        operations={&quot;add&quot;, &quot;delete&quot;, &quot;replace&quot;},<br>        max_edit_chars=1200,<br>        # Previously rejected edits are supplied as negative evidence so<br>        # the optimizer does not re-propose an equivalent change.<br>        rejected=rejected_buffer.for_skill(current.version),<br>    )</pre><pre>    candidate_text = patch.apply(current.text)</pre><pre>    # Growth is a controlled resource, not a free dimension.<br>    if len(candidate_text) &gt; max_skill_chars:<br>        return _reject(current, patch, 0.0, &quot;skill_size_exceeded&quot;,<br>                       rejected_buffer)</pre><pre>    # Agents are stochastic. A single rollout per task cannot separate a<br>    # real gain from run-to-run variance.<br>    candidate_score = evaluator.evaluate_batch(<br>        agent=target_agent,<br>        skill=candidate_text,<br>        tasks=validation_batch,<br>        trials=trials,<br>    )</pre><pre>    # Strict improvement by a margin wider than measurement noise.<br>    # Accepting on any positive delta fits the validation set itself.<br>    if candidate_score &lt; current.score + min_gain:<br>        return _reject(current, patch, candidate_score,<br>                       &quot;insufficient_gain&quot;, rejected_buffer)</pre><pre>    # A candidate may raise the average while breaking a behavior that<br>    # previously passed. The regression suite is a separate gate.<br>    regressions = evaluator.regressions(<br>        agent=target_agent,<br>        skill=candidate_text,<br>        baseline=current.text,<br>    )<br>    if regressions:<br>        return _reject(current, patch, candidate_score,<br>                       f&quot;regressions:{len(regressions)}&quot;, rejected_buffer)</pre><pre>    promoted = SkillVersion(<br>        text=candidate_text,<br>        score=candidate_score,<br>        version=current.version + 1,<br>        parent=current.version,<br>        created_at=datetime.now(),<br>        accepted_patch=patch.as_dict(),<br>    )<br>    return OptimizationResult(promoted, True, candidate_score, &quot;accepted&quot;)<br></pre><pre>def _reject(current, patch, score, reason, rejected_buffer):<br>    record = {<br>        &quot;skill_version&quot;: current.version,<br>        &quot;patch&quot;: patch.as_dict(),<br>        &quot;candidate_score&quot;: score,<br>        &quot;baseline_score&quot;: current.score,<br>        &quot;reason&quot;: reason,<br>    }<br>    rejected_buffer.add(record)<br>    return OptimizationResult(current, False, score, reason, [record])</pre><p>The example below keeps the current skill immutable, collects training trajectories, lets an optimizer propose only bounded edits, evaluates the candidate repeatedly on a validation set, rejects trivial gains, checks a regression suite, and versions only the candidate that clears every gate.</p><p>The architectural point is more important than the code: <strong>the component that proposes an improvement is not the component that gets to declare it production-ready</strong>. Proposal and promotion are different authorities.</p><h3>The gate matters more than the optimizer</h3><p>The more I think about self-improving agents, the less impressed I am by the optimizer itself. The real governance primitive is the <strong>gate</strong>.</p><p>Without a gate, the system can keep rewriting its instructions and call every rewrite “learning.” With a gate, a candidate has to prove that it helps on evidence the optimizer did not directly use to create the edit.</p><p>I would not evaluate that with a single accuracy number. A useful objective can combine task success, repeatability, evidence quality, execution cost, and policy violations.</p><p>J(s) = αT(s) + βR(s) + γE(s) − δC(s) − εV(s)</p><p>The weights are domain-specific. A coding agent may care about tests and scope discipline; a research agent may care about source quality and grounding; a spreadsheet agent may care about numerical correctness and schema compliance.</p><ul><li><strong>T</strong> = task success;</li><li><strong>R</strong> = reliability across repeated runs;</li><li><strong>E</strong> = evidence or verification quality;</li><li><strong>C</strong> = execution cost; and</li><li><strong>V</strong> = policy or behavioral violations.</li></ul><p>One thing I would make non-negotiable: certain violations should be hard failures, not just small negative terms in an average score. A candidate should not be able to “outscore” a serious policy breach by doing very well on everything else.</p><h3>Never let the system grade the lesson it just memorized</h3><p>A system should not get to study the exact failure, patch its instructions for that failure, and then use the same example as proof that it generalized.</p><p>If Task A caused the edit, success on Task A only tells me the optimizer learned Task A. It does not tell me the skill is better.</p><p>So I would separate the evidence into at least three jobs: an optimization batch that reveals problems, a validation set that decides promotion, and a final test set that estimates how well the finished skill generalizes.</p><p>Dataset rolePurposeOptimization batchGenerate evidence and candidate improvementsValidation setDecide whether a candidate should be acceptedFinal test setEstimate generalization after optimization is complete</p><p>This matters even more for language because overfitting can be semantic. The skill does not have to copy a benchmark answer verbatim to learn a benchmark-specific shortcut.</p><h3>Small edits beat magical rewrites</h3><p>I am much more comfortable with an optimizer that says “replace these 118 characters for this reason” than one that regenerates the entire skill and hands me a wall of new text.</p><p>Bounded edits make causality easier to inspect. I can see what changed, which trajectories motivated it, how much text was added, and which model proposed the patch.</p><pre>{<br>  &quot;patch_id&quot;: &quot;patch_0147&quot;,<br>  &quot;skill_version&quot;: 11,<br>  &quot;operation&quot;: &quot;replace&quot;,<br>  &quot;section&quot;: &quot;## Verification&quot;,<br>  &quot;before&quot;: &quot;Run tests before returning the answer.&quot;,<br>  &quot;after&quot;: &quot;Run the smallest relevant test set first. If it passes, run broader regression tests when the patch changes shared behavior.&quot;,<br>  &quot;rationale&quot;: &quot;Successful trajectories used staged validation; failed trajectories either skipped tests or ran expensive full suites too early.&quot;,<br>  &quot;evidence&quot;: [<br>    &quot;rollout_018&quot;,<br>    &quot;rollout_024&quot;,<br>    &quot;rollout_031&quot;<br>  ],<br>  &quot;chars_added&quot;: 118,<br>  &quot;chars_removed&quot;: 37,<br>  &quot;proposed_by&quot;: &quot;optimizer-model/2026-06&quot;<br>}</pre><p>The example below is the kind of artifact I would want in a review: a before/after diff, a rationale, and the exact rollouts used as evidence.</p><p>That makes skill evolution feel less like autonomous self-rewriting and more like controlled configuration change — which is a much easier thing to review and roll back.</p><h3>A rejected edit is still useful data</h3><p>There is another idea here that I think teams routinely underuse: <strong>failed prompt edits are data</strong>.</p><p>In a manual workflow, somebody tries an instruction, it performs badly, and a week later that knowledge has vanished into Slack or memory.</p><p>I would keep a rejected-edit buffer with the patch, the evidence behind it, the score delta, the regressions it caused, and any clue about why it failed.</p><ul><li>the proposed modification;</li><li>the evidence that motivated it;</li><li>validation score before and after;</li><li>which tasks regressed;</li><li>suspected reason for regression; and</li><li>whether a related edit may still be useful under a different condition.</li></ul><p>That turns a failed revision into procedural knowledge rather than wasted experimentation.</p><p>It also gives the optimizer a memory of bad ideas. If it keeps proposing a semantically equivalent rule that already failed twice, the system can recognize the pattern before paying for another full evaluation cycle.</p><h3>Longer is not automatically smarter</h3><p>One easy way for an optimizer to look smarter is simply to keep writing more instructions. I do not think that should be free.</p><p>Long skills consume context, create contradictions, dilute important rules, and make human review miserable.</p><p>So I would treat skill size as a resource with an explicit budget.</p><p>That can mean limits on growth per version, a hard ceiling, duplicate-rule detection, periodic compression, section-level budgets, and a preference for replacing weak guidance instead of stacking new guidance on top of it.</p><ul><li>maximum character or token growth per update;</li><li>hard upper bound on total skill size;</li><li>preference for replacement over additive duplication;</li><li>periodic compression;</li><li>duplicate-rule detection;</li><li>section-specific budgets; and</li><li>penalties for complexity that does not improve validation.</li></ul><p>The goal is not to make every skill tiny. It is to make every additional instruction earn its place through measurable value.</p><h3>Skills should compose, not become one giant instruction blob</h3><p>The same logic applies at the system level. One giant universal skill eventually becomes another monolith.</p><p>I would separate stable global policy from task-specific skills, runtime context, and tool descriptions. The agent can compose what it needs for the task instead of carrying every rule for every domain.</p><pre>AGENT RUNTIME<br>                       │<br>            ┌──────────┴──────────┐<br>            ▼                     ▼<br>      Core operating policy   Skill registry<br>                                    │<br>              ┌─────────────────────┼─────────────────────┐<br>              ▼                     ▼                     ▼<br>        research.skill        coding.skill          review.skill<br>              │                     │                     │<br>              └───────────────┬─────┴───────────────┬─────┘<br>                              ▼                     ▼<br>                         task context           tool context</pre><p>That modularity is not just cleaner architecture. It protects important boundaries: the optimizer can improve a repository-investigation skill without getting access to rewrite the organization’s authorization or safety policy.</p><p>In other words, the editable part of the system should be deliberately smaller than the total instruction stack.</p><h3>Once you have skills, you need a registry</h3><p>A folder full of Markdown files is fine at five skills. At fifty, it becomes an operations problem.</p><p>At that point I want a registry that knows the owner, task domain, approved version, compatible harnesses, models used in evaluation, scorecard, risk level, deployment state, superseded versions, and optimization history.</p><ul><li>skill identifier;</li><li>owner;</li><li>task domain;</li><li>current approved version;</li><li>compatible agent harnesses;</li><li>target models used in evaluation;</li><li>evaluation scorecard;</li><li>risk classification;</li><li>deployment status;</li><li>superseded versions; and</li><li>optimization history.</li></ul><pre>skill:<br>  id: repo_bug_investigation<br>  version: 12<br>  owner: developer-productivity<br>  status: production<br>  artifact: skills/repo_bug_investigation/v12.md<br>  supersedes: 11</pre><pre>compatibility:<br>  harnesses:<br>    - terminal-agent<br>    - coding-agent<br>  tested_models:<br>    - model-a<br>    - model-b</pre><pre>evaluation:<br>  validation_suite: repo-maintenance-v4<br>  regression_suite: repo-maintenance-regression-v4<br>  score: 0.873<br>  previous_score: 0.846<br>  trials_per_task: 3<br>  approved_at: 2026-08-18T11:20:00Z<br>  approved_by: human:platform-lead</pre><pre>history:<br>  patches: skills/repo_bug_investigation/history/<br>  scorecards: skills/repo_bug_investigation/scorecards/<br>  rejected_edits: skills/repo_bug_investigation/rejected.jsonl</pre><pre>governance:<br>  risk: medium<br>  auto_promote: false<br>  human_approval_required: true</pre><p>The example below is intentionally boring — and I mean that as a compliment. Boring metadata is what turns a clever skill into a deployable artifact with an owner, a release history, and a rollback path.</p><h3>Choosing the right skill is its own agent problem</h3><p>Having good skills does not help if the runtime keeps attaching the wrong one to the task.</p><p>So skill selection deserves its own evaluation. I would combine deterministic metadata and policy filters with semantic relevance, then allow “no skill” to be the correct answer when nothing clears the relevance threshold.</p><pre>MIN_SIMILARITY = 0.35<br></pre><pre>def select_skills(task, registry, embedder, policy, runtime, limit=3):<br>    candidates = registry.by_domain(task.domain)</pre><pre>    allowed = [<br>        skill for skill in candidates<br>        if skill.status == &quot;production&quot;<br>        and policy.skill_allowed(task, skill)<br>        # A skill validated on one harness or model is not automatically<br>        # valid on another. The registry records this; the selector must<br>        # actually check it.<br>        and runtime.harness in skill.compatible_harnesses<br>        and runtime.model in skill.tested_models<br>    ]</pre><pre>    scored = [<br>        (embedder.similarity(task.description, skill.description), skill)<br>        for skill in allowed<br>    ]</pre><pre>    # Returning the top k regardless of fit is how a well-optimized skill<br>    # ends up applied to the wrong task. Below the floor, no skill is the<br>    # correct answer.<br>    relevant = [<br>        (score, skill) for score, skill in scored<br>        if score &gt;= MIN_SIMILARITY<br>    ]</pre><pre>    # skill.id breaks ties, so identical inputs yield identical selections<br>    # and a routing decision can be reproduced during review.<br>    relevant.sort(key=lambda row: (-row[0], row[1].id))</pre><pre>    return [skill for _, skill in relevant[:limit]]</pre><p>The sample selector below also checks model/harness compatibility and breaks ties deterministically. That may look like implementation detail, but reproducible routing is exactly what you need when somebody later asks, “Why did the agent use this procedure?”</p><h3>The final answer is not enough — you have to grade the path</h3><p>This is one of the biggest differences between evaluating an agent and evaluating a chatbot answer: an agent can arrive at a correct result through a terrible process.</p><p>It can touch data it never needed, call tools repeatedly, ignore a required verification step, take a fragile shortcut, or spend ten times the necessary cost — and still return the right sentence at the end.</p><ul><li>calling unnecessary tools;</li><li>accessing irrelevant sensitive data;</li><li>performing redundant searches;</li><li>violating the intended workflow;</li><li>using a brittle shortcut;</li><li>ignoring required verification; or</li><li>incurring excessive cost.</li></ul><p>That is why trajectory evaluation matters. Anthropic makes the same point in its work on agent evals: the transcript of what the agent did and the final state of the environment are separate things, and both can contain failures [<a href="#ref6">6</a>].</p><p>The scorecard I would use therefore looks at outcome quality, evidence, tool efficiency, policy compliance, recovery behavior, latency, cost, and consistency across repeated runs.</p><p>Evaluation dimensionExample measureOutcome qualityTask success or domain-specific correctnessEvidence qualityRequired claims supported by appropriate evidenceTool efficiencyNecessary tool calls divided by total callsPolicy complianceNumber and severity of prohibited actionsRecovery behaviorSuccessful handling of tool or reasoning failuresLatencyTime to accepted resultCostModel and tool cost per successful taskConsistencyVariance across repeated runs or equivalent task formulations</p><h3>Your evaluator becomes the ceiling</h3><p>This is the uncomfortable part of any self-improvement story: the optimizer cannot become better than the signal it is chasing.</p><p>If the evaluator rewards superficial completion, the skill will become very good at superficial completion. If difficult cases are missing, the skill will look safer than it is. If a model judge likes verbosity, optimization may happily teach the system to become longer rather than better.</p><p>So the evaluator needs governance too.</p><p>Where I can, I would use deterministic checks: unit tests, schemas, exact constraints, grounding checks, and explicit policy rules. Where I need qualitative judgment, I would add model-based evaluation. And for high-impact ambiguity, I would still keep human review in the loop [<a href="#ref6">6</a>].</p><p>The sentence I keep returning to is this: <strong>self-improvement is only as trustworthy as the mechanism that decides what “better” means</strong>.</p><ul><li>exact tests for structured outputs;</li><li>unit tests for code changes;</li><li>schema checks for tool calls;</li><li>grounding checks for cited evidence;</li><li>policy rules for prohibited actions;</li><li>LLM judges for qualitative criteria; and</li><li>human review for high-impact ambiguous cases.</li></ul><blockquote>Self-improvement is only as trustworthy as the mechanism that decides what “better” means.</blockquote><h3>Ship the tests with the skill</h3><p>A skill should not travel alone.</p><p>If I send you skill.md without the validation cases, regressions, edge cases, version history, and scorecards that justify it, I have sent you instructions without the evidence needed to maintain them.</p><pre>repo_bug_investigation/<br>├── skill.md<br>├── metadata.yaml<br>├── evals/<br>│   ├── validation.jsonl<br>│   ├── regression.jsonl<br>│   └── edge_cases.jsonl<br>├── history/<br>│   ├── v10.patch<br>│   ├── v11.patch<br>│   └── v12.patch<br>└── scorecards/<br>    ├── v11.json<br>    └── v12.json</pre><p>So I would package the tests with the skill. That turns the artifact from “some prompt we like” into a component another team can upgrade without guessing whether they broke it.</p><h3>Portability is exciting. Validation still comes first.</h3><p>This is one of the most exciting claims in the SkillOpt work: a well-optimized skill may carry useful procedural knowledge across model scales, execution harnesses, and nearby tasks.</p><p>The authors report transfer experiments across model scales, between Codex and Claude Code environments, and onto a related benchmark without further optimization; they also report best-or-tied-best results across the 52 model/benchmark/harness cells they evaluated [<a href="#ref1">1</a>, <a href="#ref2">2</a>].</p><p>I find that promising, but I would not turn it into “skills are universally portable.” Those numbers belong to the reported experimental setup. A new enterprise workflow, toolchain, or domain still needs local evaluation.</p><p>The distinction I would keep is: <strong>portable</strong> means the artifact can be loaded, <strong>compatible</strong> means the runtime can execute it, and <strong>validated</strong> means it has actually earned trust in that environment.</p><ul><li><strong>portable</strong> — the skill can technically be loaded elsewhere;</li><li><strong>compatible</strong> — the new runtime can interpret the procedure and required tools;</li><li><strong>validated</strong> — the skill has demonstrated acceptable performance in the new environment.</li></ul><h3>What if you don’t have labels?</h3><p>Of course, many real tasks do not come with a neat answer key.</p><p>Recent work on self-supervised skill optimization explores a different route: run skills on unlabeled tasks, compare trajectories or outputs, extract behavioral differences, aggregate the evidence, and keep a revised skill only when it wins on an unlabeled validation set [<a href="#ref3">3</a>].</p><p>That opens up a much larger design space, but it also moves more trust into the comparative judge.</p><p>My instinct for production is therefore the opposite of “no labels means fewer controls.” If ground truth is weaker, the governance around the evaluator should become stronger.</p><h3>Let production teach you — offline</h3><p>I do not want an agent changing its operating procedure halfway through a live customer task. Continuous learning does not require continuous mutation.</p><p>A safer pattern is to let production generate traces, then do the learning offline: cluster recurring failures, replay representative tasks, propose changes, run validation, and only then consider a new version for release.</p><pre>Production agent sessions<br>          │<br>          ▼<br>     Trace archive<br>          │<br>          ▼<br>   Offline clustering<br>          │<br>          ▼<br> Candidate skill edits<br>          │<br>          ▼<br> Replay + validation suite<br>          │<br>      ┌───┴────┐<br>      ▼        ▼<br>   reject    review<br>               │<br>               ▼<br>          version release<br>               │<br>               ▼<br>        production rollout</pre><p>That creates a clean boundary between experience and deployment.</p><p>SkillOpt’s open-source project includes an offline self-evolution workflow along these lines — harvesting sessions, mining recurring problems, replaying tasks, and consolidating candidate updates behind validation [<a href="#ref4">4</a>]. I think the broader lesson is valuable even if you never use that exact implementation: production can teach the system without being the place where the system rewrites itself.</p><h3>Some things should never be trainable</h3><p>There is a boundary I would draw very clearly: <strong>not every instruction belongs inside the optimization target</strong>.</p><p>Hard policy, runtime permissions, tool restrictions, task procedures, and optimization metadata are different layers. Mixing them is asking the optimizer to trade safety against performance.</p><ul><li>hard policy;</li><li>runtime permissions;</li><li>tool constraints;</li><li>task-specific skills; and</li><li>optimization metadata.</li></ul><p>It is fine to optimize how an agent investigates a bug. It should not be able to decide that broader repository access would make the benchmark easier and then grant itself that access.</p><p>The same goes for human-approval requirements, credential boundaries, customer data restrictions, and prohibited actions. Those belong in a higher-priority enforcement layer, not in editable prose the optimizer is allowed to rewrite.</p><p>The search space for improvement should be intentionally narrower than the system’s total behavior space.</p><h3>A skill is also a supply-chain artifact</h3><p>There is another issue I think deserves more attention: a reusable skill is also a <strong>supply-chain artifact</strong>. It is text that will be loaded directly into an agent’s instruction context. A skill from a public registry, vendor, or another team is therefore not “just configuration”; it is an external instruction source, and prompt-injection research gives us every reason to treat that carefully [<a href="#ref8">8</a>].</p><h3>The production implication</h3><p>A skill is loaded as instruction. So an untrusted skill is an untrusted instruction source. I would review imported skills with the same seriousness I give dependencies and code changes — not with the casual trust usually given to configuration.</p><p>Optimization can sharpen that risk because reviewers naturally focus on whether the score improved. A candidate might quietly weaken a verification step or redirect evidence gathering and still look great if the evaluation suite never measures that behavior.</p><p>My production rule would be simple: review imported skills like code, enforce protected policy in the runtime rather than in editable wording, and inspect the diff as well as the score. Provenance, access control, and human oversight are lifecycle concerns, not optional extras [<a href="#ref7">7</a>].</p><h3>Treat skill promotion like a software release</h3><p>Even after a candidate wins offline, I would not jump straight to 100% production traffic.</p><p>The release path can look very familiar: generate the candidate, validate it, run regressions, check policy, require human approval when risk warrants it, canary the change, monitor, roll back if needed, and only then make it the stable version.</p><ol><li>candidate generation;</li><li>automated validation;</li><li>regression testing;</li><li>policy checks;</li><li>human review where required;</li><li>canary deployment;</li><li>production monitoring;</li><li>rollback if operational metrics degrade; and</li><li>promotion to the new stable version.</li></ol><pre>from datetime import timedelta</pre><pre>CANARY_TRAFFIC_SHARE = 0.05<br>CANARY_OBSERVATION_WINDOW = timedelta(hours=24)<br>CANARY_MIN_TASKS = 200<br></pre><pre>def promote(candidate, registry, metrics, policy, clock, actor):<br>    def decide(outcome, detail=&quot;&quot;):<br>        registry.record_promotion_event(<br>            skill_id=candidate.skill_id,<br>            version=candidate.version,<br>            outcome=outcome,<br>            detail=detail,<br>            actor=actor,<br>            at=clock.now(),<br>        )<br>        return outcome</pre><pre>    if not candidate.validation_passed:<br>        return decide(&quot;rejected&quot;, &quot;validation&quot;)</pre><pre>    if not candidate.regression_passed:<br>        return decide(&quot;rejected&quot;, &quot;regression&quot;)</pre><pre>    # Policy is checked before any traffic is exposed, and separately<br>    # from validation: a candidate can score well and still violate a<br>    # constraint the score does not measure.<br>    violations = policy.check(candidate)<br>    if violations:<br>        return decide(&quot;rejected&quot;, f&quot;policy:{&#39;,&#39;.join(violations)}&quot;)</pre><pre>    if policy.requires_human_review(candidate) and not candidate.human_approved:<br>        return decide(&quot;awaiting_review&quot;)</pre><pre>    deployment = registry.deploy_canary(<br>        candidate,<br>        traffic=CANARY_TRAFFIC_SHARE,<br>    )</pre><pre>    try:<br>        # A canary judged the instant it is deployed has observed<br>        # nothing. The window must be long enough, and carry enough<br>        # completed tasks, for the comparison to mean anything.<br>        observation = metrics.observe(<br>            deployment,<br>            duration=CANARY_OBSERVATION_WINDOW,<br>            min_tasks=CANARY_MIN_TASKS,<br>        )</pre><pre>        if observation.inconclusive:<br>            registry.rollback(deployment)<br>            return decide(&quot;rolled_back&quot;, &quot;insufficient_traffic&quot;)</pre><pre>        if observation.regressed:<br>            registry.rollback(deployment)<br>            return decide(&quot;rolled_back&quot;, observation.summary)</pre><pre>    except Exception as error:<br>        # Never leave a canary running after an unhandled failure in the<br>        # monitoring path.<br>        registry.rollback(deployment)<br>        return decide(&quot;rolled_back&quot;, f&quot;monitoring_error:{error!r}&quot;)</pre><pre>    registry.promote(candidate)<br>    return decide(&quot;production&quot;)</pre><p>The sample promotion function below encodes a few details I consider load-bearing: policy is checked separately from performance; a canary must observe enough traffic for long enough to mean something; inconclusive evidence does not count as success; and monitoring failure triggers rollback instead of leaving an unobserved canary running.</p><p>I also want every terminal state recorded with who approved it and when. If this system is going to change the procedure an agent follows, the organization should be able to reconstruct the release decision later.</p><p>Offline validation and real-world performance are related, but they are not the same thing. Treating skill release like software release acknowledges that gap.</p><h3>If a skill changes, I want to know why</h3><p>If a skill changes over time, I do not want the current Markdown file to be the only surviving truth.</p><p>I want to answer very ordinary questions: What changed? Which failures motivated it? Which tasks improved? Which regressed? What was rejected? Which model proposed the patch? Who approved it? And did production behave the way offline evaluation predicted?</p><ul><li>What changed in this version?</li><li>Which trajectories motivated the change?</li><li>What was the previous validation score?</li><li>Which tasks improved?</li><li>Which tasks regressed?</li><li>Which candidate edits were rejected?</li><li>Which model produced the edit?</li><li>Who approved deployment?</li><li>Has live performance matched offline evaluation?</li></ul><p>A system that calls itself self-improving but cannot explain its own procedural history is going to be difficult to trust, debug, or govern.</p><h3>What I would actually measure</h3><p>I would not measure success by how many times the optimizer managed to produce a new version. Version churn is not progress.</p><p>DimensionExample measureTask performanceSuccess on held-out tasksGeneralizationPerformance on unseen distributions or related tasksSkill compactnessPerformance improvement relative to skill-size growthStabilityVariance across repeated runsRegression ratePreviously passing behaviors degraded by new versionsTransfer valuePerformance retained across compatible models or harnessesCost efficiencyTask success per unit of model and tool costReviewabilityPercentage of changes represented as bounded, attributable editsRollback readinessTime required to restore the previous stable skillGovernance complianceUnauthorized or policy-violating skill promotions</p><p>The scorecard below is closer to what I care about: held-out task performance, generalization, compactness, stability, regressions, transfer value, cost efficiency, reviewability, rollback readiness, and governance compliance. A mature system should get more reliable and maintainable — not merely more optimized on paper.</p><h3>How I’d introduce this without boiling the ocean</h3><p>If I were introducing this inside a team, I would start deliberately small: choose one repeated task with a measurable outcome, externalize its procedure, build the evaluation suite first, establish a baseline, allow only bounded edits, add held-out validation, preserve rejected changes, separate optimization from deployment authority, monitor the released behavior, and only then expand into a registry of multiple skills. The order matters because optimization without evaluation infrastructure is just faster guesswork.</p><ol><li><strong>Identify a repeatable agent task.</strong> Choose a domain where success can be measured consistently.</li><li><strong>Externalize the procedure.</strong> Move task-specific operating instructions into a versioned skill document.</li><li><strong>Create an evaluation suite.</strong> Include representative, difficult, and regression-sensitive cases.</li><li><strong>Establish a stable baseline.</strong> Measure the existing skill before optimization.</li><li><strong>Introduce bounded candidate edits.</strong> Preserve reviewability.</li><li><strong>Add held-out validation.</strong> Do not promote changes based only on the examples that motivated them.</li><li><strong>Track rejected changes.</strong> Preserve negative evidence.</li><li><strong>Add deployment gates.</strong> Separate optimizer authority from release authority.</li><li><strong>Monitor live performance.</strong> Compare production behavior with offline expectations.</li><li><strong>Expand to a skill registry.</strong> Scale only after individual skill lifecycle management is reliable.</li></ol><h3>When I would not use skill optimization</h3><p>I also think this idea becomes more credible when we are explicit about where it does <em>not</em> belong.</p><h3>There is no trustworthy success signal</h3><p>If there is no trustworthy success signal, optimization will confidently chase the proxy instead. Self-supervised methods can relax the need for labels, but they do not eliminate the need for a judge you trust.</p><h3>The task does not repeat enough to justify the cost</h3><p>If the task hardly repeats, the evaluation cost may never pay for itself. A domain expert writing the procedure once may be both cheaper and better.</p><h3>The skill is not the broken layer</h3><p>If the real failure lives in the model, tool, or environment, editing the skill can produce elaborate workarounds for the wrong layer. Fix the broken layer first.</p><h3>The evaluation suite is too weak</h3><p>If the validation set is tiny or unrepresentative, the loop can optimize to sampling noise while reporting steady “improvement.”</p><h3>Nobody is actually going to read the diffs</h3><p>And if nobody is going to read the diffs, all the careful versioning and audit metadata becomes theatre. A rising score is not a substitute for reviewing what the skill now tells the agent to do.</p><p>My rule of thumb is straightforward: use this when the task repeats, success can be evaluated defensibly, and somebody owns the procedure. If one of those is missing, spend the effort fixing that prerequisite first.</p><h3>The principle I keep coming back to</h3><p>The architectural implication extends beyond any single optimizer: agent behavior is shaped by an external procedure that can be inspected, versioned, and evaluated.</p><p>If the procedure is external, I can version it.</p><p>If I can version it, I can evaluate changes against a baseline.</p><p>If I can evaluate changes, I can compare candidates instead of trusting whichever rewrite sounds smartest.</p><p>And if I can compare candidates, the agent’s procedure can improve without silently changing model weights or giving every plausible edit authority over production.</p><p>That creates a form of procedural learning that remains visible to the humans operating the system.</p><pre>Task experience<br>      │<br>      ▼<br>Trajectories + scores<br>      │<br>      ▼<br>Behavioral evidence<br>      │<br>      ▼<br>Bounded skill revision<br>      │<br>      ▼<br>Held-out validation<br>      │<br>  ┌───┴───────────────┐<br>  ▼                   ▼<br>reject             approve<br>                       │<br>                       ▼<br>                governed release<br>                       │<br>                       ▼<br>                  new experience</pre><p>That visibility is what makes the idea interesting to me. Improvement becomes something we can inspect, test, approve, release, monitor, and reverse.</p><h3>Where I land on this</h3><p>The more capable agents become, the more I think the conversation has to move beyond “what prompt did you use?”</p><p>A multi-step agent is running a procedure. That procedure determines how it gathers evidence, uses tools, handles failure, verifies work, and decides when it is done.</p><p>Reusable skills give us a way to externalize that procedure instead of hiding it in scattered prompt fragments.</p><p>SkillOpt pushes the idea further by showing that the skill itself can become the optimization target while the underlying agent model stays frozen: trajectories become evidence, an optimizer proposes bounded edits, validation decides whether the revision is better, and the approved result can be carried forward as a versioned artifact [<a href="#ref1">1</a>, <a href="#ref2">2</a>].</p><p>What I find most useful is the engineering implication that follows. Self-improvement does not have to mean an opaque agent rewriting itself in production.</p><p>It can look much more familiar: procedures in version control, evaluation suites beside them, bounded diffs, rejected-change history, compatibility metadata, release gates, canaries, observability, and rollback.</p><p>That also gives safety a cleaner place in the architecture. Policies and permissions can sit outside the trainable artifact instead of competing with task performance inside one giant prompt.</p><p>So I do not see the shift from prompt engineering to skill engineering as a race to write longer instructions. I see it as a shift toward treating procedural knowledge as software: modular, testable, reviewable, measurable, and governed.</p><p>And if that is where agents are heading, the systems that win will not just have better models. They will have better ways to improve what those models are asked to do — without losing the evidence of why the change was allowed in the first place.</p><h3>Sources and further reading</h3><p>The discussion above draws on the following research and engineering guidance, which provide the technical foundation for the mechanisms, evaluation patterns, and governance ideas discussed throughout the article.</p><p><strong>[1]</strong> Yang, Y., Gong, Z., Huang, W., Yang, Q., Zhou, Z., Huang, Z., Li, Y., Gao, X., Dai, Q., Liu, B., Qiu, K., Yang, Y., Chen, D., Yang, X., &amp; Luo, C. (2026). <em>SkillOpt: Executive Strategy for Self-Evolving Agent Skills</em>. arXiv:2605.23904. <a href="https://arxiv.org/abs/2605.23904">arXiv</a>.</p><p><strong>[2]</strong> Microsoft Research. (2026). <em>SkillOpt: Agent Skills as Trainable Parameters</em>. Microsoft Research. <a href="https://www.microsoft.com/en-us/research/blog/skillopt-agent-skills-as-trainable-parameters/">Microsoft Research</a>.</p><p><strong>[3]</strong> Peng, S., Yang, C., Fu, T., Zhang, T., Zhang, H., Zhao, W., Su, A., Wu, M., Li, H., Zhu, X., Zhao, C., &amp; Lei, Z. (2026). <em>Self-Supervised Skill Optimization</em>. arXiv:2607.28777. <a href="https://arxiv.org/abs/2607.28777">arXiv</a>.</p><p><strong>[4]</strong> Microsoft. (2026). <em>SkillOpt — Open-Source Implementation and Documentation</em>. GitHub. <a href="https://github.com/microsoft/SkillOpt">GitHub repository</a>.</p><p><strong>[5]</strong> Anthropic. (2024). <em>Building Effective Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/building-effective-agents">Anthropic</a>.</p><p><strong>[6]</strong> Anthropic. (2026). <em>Demystifying Evals for AI Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents">Anthropic</a>.</p><p><strong>[7]</strong> Autio, C., Schwartz, R., Dunietz, J., Jain, S., Stanley, M., Tabassi, E., Hall, P., &amp; Roberts, K. (2024). <em>Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile</em>. NIST AI 600–1. National Institute of Standards and Technology. <a href="https://doi.org/10.6028/NIST.AI.600-1">https://doi.org/10.6028/NIST.AI.600-1</a>.</p><p><strong>[8]</strong> OWASP GenAI Security Project. (2025). <em>OWASP Top 10 for LLM Applications</em>. OWASP Foundation. <a href="https://genai.owasp.org/">OWASP GenAI Security Project</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05be51b9132d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“I Think Coding Agents Have a Memory Problem - So I Sketched a Control Plane for Them”]]></title>
            <link>https://medium.com/@chandi.academic/i-think-coding-agents-have-a-memory-problem-so-i-sketched-a-control-plane-for-them-62591067c496?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/62591067c496</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-coding-agent]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 18:09:36 GMT</pubDate>
            <atom:updated>2026-09-20T18:09:36.121Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ENIJaR9_baPHyiSrTXDdsw.png" /></figure><p>What happens when coding agents can remember engineering intent, failures, scope, and evaluation history across sessions? Here is the control-plane architecture I would use.</p><h3>Contents</h3><ol><li><a href="#s1">The Problem I Kept Coming Back To: Coding Agents Lose the Story</a></li><li><a href="#s2">A Bigger Context Window Is Helpful — but It Is Not Memory</a></li><li><a href="#s3">The Memory Loop I Would Actually Build</a></li><li><a href="#s4">What One Useful Memory Record Should Look Like</a></li><li><a href="#s5">The Trick Is Not Storing More — It Is Consolidating Better</a></li><li><a href="#s6">Why I’d Put a Control Plane Above the Agents</a></li><li><a href="#s7">The Five Specialist Skills I’d Plug Into It</a></li><li><a href="#s8">Skill One: The Advisor-Orchestrator</a></li><li><a href="#s9">Skill Two: The Commit Archaeologist</a></li><li><a href="#s10">Skill Three: Project Graveyard Intelligence</a></li><li><a href="#s11">Skill Four: The Scope Creep Detector</a></li><li><a href="#s12">Skill Five: A Self-Improving Agent — With Guardrails</a></li><li><a href="#s13">Shared Memory Is What Turns Five Tools Into One System</a></li><li><a href="#s14">Retrieval Should Know Who Is Asking — Not Just What Looks Similar</a></li><li><a href="#s15">Event Sourcing Gave Me a Useful Mental Model</a></li><li><a href="#s16">A Good Memory System Also Needs to Forget</a></li><li><a href="#s17">Security Has to Come Before Retrieval</a></li><li><a href="#s18">Passing Tests Is Not Enough — Evaluate the Whole Trajectory</a></li><li><a href="#s19">Keep the Interfaces Open and the Internals Replaceable</a></li><li><a href="#s20">The Whole Workflow, End to End</a></li><li><a href="#s21">How I’d Measure Whether It Is Working</a></li><li><a href="#s22">A Practical Rollout Sequence</a></li><li><a href="#s23">When I Would Not Use Persistent Memory</a></li><li><a href="#s24">The Bigger Idea: Memory Makes Improvement Cumulative</a></li><li><a href="#conclusion">Where I Landed</a></li><li><a href="#references">Sources &amp; Further Reading</a></li></ol><h3>What I’m Exploring Here</h3><p>Coding agents are getting genuinely capable. They can inspect repositories, edit source, run tests, call tools, and work through multi-step engineering tasks. But the more I looked at these systems, the more one weakness stood out: most of them are still episodic. They finish a task with a huge amount of useful context in memory — reasoning, evidence, constraints, operational state — and then much of that disappears when the session ends.</p><p>That is what pushed me toward persistent memory. Instead of treating every agent run as a fresh conversation, I would keep an always-on memory layer that records the events worth keeping, merges repeated observations, marks old state as superseded, preserves where decisions came from, and retrieves only what the next task actually needs. At that point, memory stops being chat history and starts becoming infrastructure.</p><p>The design below uses that memory layer to support five specialist capabilities: an Advisor-Orchestrator for cost- and risk-aware routing; a Commit Archaeologist for reconstructing engineering intent from repository history; Project Graveyard Intelligence for stalled or abandoned initiatives; a Scope Creep Detector for catching divergence from the assigned task; and a Self-Improving Agent for evaluation-driven changes that are tested before they are trusted.</p><p>The part I find most interesting is that these five pieces become much more useful when they are not stateless. With durable memory, the system can carry a decision into the next session, compare today’s patch with yesterday’s intent, notice that the same failure keeps coming back, preserve evaluation evidence, and make improvement cumulative. The trade-off is that memory now needs serious governance: authority, provenance, expiration, access control, auditability, and deletion cannot be afterthoughts.</p><p><strong>A quick boundary before we get into it.</strong> This is a reference architecture and a design argument, not a benchmark study. I am not claiming experimental performance numbers here. The five skills are one practical composition, not a universal taxonomy, and the measures later in the article are an evaluation framework rather than reported results. I also include a full section on when I would <em>not</em> use this architecture.</p><h3>1. The Problem I Kept Coming Back To: Coding Agents Lose the Story</h3><p>The first thing that clicked for me is that software engineering is inherently longitudinal. A repository quietly accumulates architecture decisions, trade-offs, failed experiments, test history, incidents, scope changes, refactors, workarounds, and conventions over months or years.</p><p>A coding agent, meanwhile, may see only a tiny slice of that story.</p><p>Give an agent an issue, let it inspect a few files, produce a patch, run the tests, and you may get a perfectly useful result. But a lot of important questions are still sitting underneath the task:</p><ul><li>Why does the current architecture exist?</li><li>Which earlier implementation was deliberately rejected?</li><li>Has the same failure occurred before?</li><li>Did the current task quietly expand beyond its approved scope?</li><li>Which model or agent is most appropriate for the next step?</li><li>What did prior evaluations reveal about this agent’s failure modes?</li><li>Which project assumptions remain valid?</li></ul><p>That is why repository access alone does not feel sufficient to me. The agent needs durable context — not everything, but the pieces of history that change what a good decision looks like.</p><p>There is good precedent for thinking this way. Generative Agents stores experiences, retrieves them dynamically, and turns repeated experience into higher-level reflections that influence later planning [<a href="#ref1">1</a>]. MemGPT similarly treats memory as movement between a limited active context and larger external memory tiers [<a href="#ref2">2</a>].</p><p>For software engineering, though, I would make that memory much more disciplined. It should remember not only “what happened,” but decisions, artifacts, diffs, test evidence, approved scope, ownership, confidence, and the links between cause and effect.</p><h3>2. A Bigger Context Window Is Helpful — but It Is Not Memory</h3><p>One distinction matters a lot here: a larger context window is useful, but it solves a different problem from persistent memory.</p><p>Context is temporary input to the model. Memory is maintained state that survives a single inference — and, in this design, survives the entire agent session.</p><p>The mental model I find most useful is this:</p><p>LayerPrimary roleTypical lifetimeWorking contextImmediate reasoning state and tool resultsOne or several model turnsEpisodic memoryWhat happened during specific tasks or eventsDays to yearsSemantic memoryConsolidated facts, conventions, and relationshipsUntil supersededProcedural memoryReusable methods, skills, and operating patternsUntil revisedControl-plane stateTask ownership, evaluation status, approvals, routing, riskTask or project lifetime</p><p>Why split it this way? Because dumping the entire project history into every prompt would be expensive, noisy, and unreliable. I want the system to preserve a large universe of potentially useful context, while giving the model a small, task-specific working set at the moment of action.</p><p>That lines up with recent work on context engineering: long-running agents create more information than should stay in active context, so the useful systems are the ones that curate, compact, retrieve, and refresh what the model sees [<a href="#ref3">3</a>].</p><blockquote>Persistent memory expands what the system can remember; context engineering determines what the model should remember right now.</blockquote><h3>3. The Memory Loop I Would Actually Build</h3><p>The obvious mistake would be to store everything. I would not turn every token from every agent into permanent memory; that just creates a second log that nobody can reason about.</p><p>Instead, I would run memory as a continuous evidence-processing loop:</p><pre>Agent / tool activity<br>        │<br>        ▼<br>Capture candidate events<br>        │<br>        ▼<br>Classify importance + sensitivity<br>        │<br>        ▼<br>Normalize entities and identifiers<br>        │<br>        ▼<br>Compare with existing memory<br>        │<br>        ├────────► conflict / review queue<br>        │<br>        ▼<br>Consolidate / supersede / link<br>        │<br>        ▼<br>Persist with provenance<br>        │<br>        ▼<br>Index for future retrieval<br>        │<br>        ▼<br>Decay, refresh, or archive when appropriate</pre><p>The key distinction in that loop is between <strong>recording</strong> and <strong>remembering</strong>.</p><p>Recording says, “this event happened.” Remembering asks the harder questions: does this deserve durable representation, how does it relate to what we already know, has it replaced something older, and when should it appear again?</p><h3>4. What One Useful Memory Record Should Look Like</h3><p>If I were implementing this, I would keep each memory record structured enough for deterministic policy checks, but still readable enough that a human can understand what the system thinks happened.</p><p>A useful record can carry the project, repository, branch, task, event type, entities, evidence, confidence, sensitivity, and lifecycle state. Here is the shape I would start from:</p><pre>from dataclasses import dataclass, field<br>from datetime import datetime<br>from typing import Literal</pre><pre>MemoryKind = Literal[<br>    &quot;decision&quot;,<br>    &quot;observation&quot;,<br>    &quot;failure&quot;,<br>    &quot;scope_change&quot;,<br>    &quot;evaluation&quot;,<br>    &quot;project_state&quot;,<br>    &quot;procedure&quot;,<br>]</pre><pre># The four lifecycle operations are a closed set, so they are typed<br># as one. A free-form string here is how a memory store ends up with<br># &quot;archived&quot;, &quot;Archived&quot;, and &quot;archive&quot; meaning the same thing.<br>MemoryStatus = Literal[&quot;active&quot;, &quot;superseded&quot;, &quot;archived&quot;, &quot;expired&quot;]</pre><pre>Sensitivity = Literal[&quot;public&quot;, &quot;internal&quot;, &quot;confidential&quot;, &quot;restricted&quot;]<br></pre><pre>@dataclass<br>class MemoryRecord:<br>    id: str<br>    project_id: str<br>    kind: MemoryKind<br>    summary: str<br>    created_at: datetime<br>    updated_at: datetime</pre><pre>    # No default. A record with no stated origin is not auditable, and<br>    # a default here would silently produce unattributed memory.<br>    actor: str<br>    confidence: float</pre><pre>    repository: str | None = None<br>    commit_sha: str | None = None<br>    task_id: str | None = None</pre><pre>    evidence: list[str] = field(default_factory=list)<br>    related_memory_ids: list[str] = field(default_factory=list)</pre><pre>    sensitivity: Sensitivity = &quot;internal&quot;<br>    status: MemoryStatus = &quot;active&quot;<br>    expires_at: datetime | None = None</pre><pre>    # Both directions are stored so supersession can be traversed<br>    # without scanning the whole store from either end.<br>    supersedes: list[str] = field(default_factory=list)<br>    superseded_by: str | None = None</pre><p>There are three design choices in that object that I would not treat as cosmetic.</p><p>First, the lifecycle states are a closed set rather than free text. Those values later drive expiration, supersession, and retrieval rules. If the store accepts arbitrary strings, you eventually get “archive,” “archived,” and “Archived” meaning the same thing while filters quietly disagree.</p><p>Second, actor and confidence are required. I do not want a durable memory item whose origin is unknown, and I definitely do not want machine-generated observations defaulting to full confidence. The producer should state both at write time, when that information is actually available.</p><p>Third, supersession is stored in both directions. Most retrieval needs to move from an old record to its current replacement quickly; keeping only a one-way supersedes list turns that common operation into a store-wide scan.</p><p>The result is memory that code can filter and humans can inspect.</p><p>Before semantic ranking even begins, retrieval can filter by project, task, memory type, confidence, or security class. A governance process can ask for every memory item tied to a repository or decision, and a reviewer can trace a synthesized conclusion back to the evidence that produced it.</p><h3>5. The Trick Is Not Storing More — It Is Consolidating Better</h3><p>Another thing I realized quickly: persistent memory is useful only if it is maintained. Accumulation by itself is not intelligence.</p><p>Imagine the agent sees five failed deployments caused by the same configuration mismatch. Keeping all five raw incidents is valuable for audit, but the sixth agent should not have to rediscover the pattern from scratch.</p><p>I would preserve all five events and also create a higher-level memory that captures the recurring pattern:</p><blockquote>Recurring deployment failures on Service X have been associated with configuration divergence between generated environment files and the deployment template.</blockquote><p>The important part is that the synthesized record links back to the incidents. It summarizes them; it does not erase them.</p><pre># How many neighbours the evaluator is asked to weigh. Large enough to<br># catch a recurring pattern, small enough to stay reviewable.<br>RELATED_CANDIDATE_LIMIT = 12<br></pre><pre>class ConsolidationError(Exception):<br>    pass<br></pre><pre>def consolidate(candidate, store, evaluator, actor):<br>    related = store.find_semantically_related(<br>        project_id=candidate.project_id,<br>        text=candidate.summary,<br>        limit=RELATED_CANDIDATE_LIMIT,<br>    )</pre><pre>    decision = evaluator.compare(candidate, related)</pre><pre>    # Every branch below both mutates the store and records why. The<br>    # two are written in one transaction: a consolidation that is<br>    # applied but not explained cannot be reviewed or reversed.<br>    with store.transaction() as txn:<br>        if decision.action == &quot;duplicate&quot;:<br>            txn.link(candidate.id, decision.canonical_id)</pre><pre>        elif decision.action == &quot;supersede&quot;:<br>            candidate.supersedes = decision.superseded_ids<br>            txn.mark_superseded(<br>                decision.superseded_ids,<br>                superseded_by=candidate.id,<br>            )<br>            txn.save(candidate)</pre><pre>        elif decision.action == &quot;synthesize&quot;:<br>            synthesis = evaluator.synthesize([candidate, *related])<br>            txn.save(candidate)<br>            txn.save(synthesis)<br>            txn.link_evidence(<br>                synthesis.id,<br>                [candidate.id, *[r.id for r in related]],<br>            )</pre><pre>        elif decision.action == &quot;retain&quot;:<br>            txn.save(candidate)</pre><pre>        else:<br>            # An unrecognized verdict must not fall through to a plain<br>            # save. Silently degrading to &quot;store as new&quot; is how<br>            # duplicate memory accumulates unnoticed.<br>            raise ConsolidationError(<br>                f&quot;unknown consolidation action: {decision.action!r}&quot;<br>            )</pre><pre>        txn.append_audit(<br>            event=&quot;memory_consolidated&quot;,<br>            candidate_id=candidate.id,<br>            action=decision.action,<br>            actor=actor,<br>            rationale=decision.rationale,<br>        )</pre><p>In the consolidation routine below, two details matter to me more than the branching itself.</p><p>If the evaluator returns a verdict the code does not understand, I would fail loudly. Silently falling back to “store it as a new memory” is exactly how duplicate memory piles up while everyone thinks the system is healthy.</p><p>I would also write the store mutation and the audit explanation in the same transaction. If a consolidation changes memory but the reason is lost, that change is neither properly reviewable nor safely reversible. It is the same discipline we already expect from serious schema migrations.</p><p>Done this way, the raw history stays intact while the reusable layer gets progressively better.</p><h3>6. Why I’d Put a Control Plane Above the Agents</h3><p>Now comes the coordination problem. Once multiple agents or skills can independently choose models, tools, repository state, and actions, the system becomes hard to reason about very quickly.</p><p>My answer is a control plane sitting above those specialist capabilities.</p><pre>REQUEST / EVENT<br>                           │<br>                           ▼<br>                 ┌──────────────────┐<br>                 │   CONTROL PLANE  │<br>                 │                  │<br>                 │ Identity         │<br>                 │ Scope            │<br>                 │ Memory           │<br>                 │ Routing          │<br>                 │ Policy           │<br>                 │ Evaluation       │<br>                 │ Audit            │<br>                 └──────────────────┘<br>                           │<br>       ┌───────────────────┼────────────────────┐<br>       ▼                   ▼                    ▼<br>  Analysis skills     Execution skills     Review skills<br>       │                   │                    │<br>       └───────────────────┼────────────────────┘<br>                           ▼<br>                  Repository / CI / tools</pre><p>The control plane does not need to write all the code itself. I would use it to decide who should act, what context they receive, which constraints apply, and what evidence has to be recorded before the task is considered complete.</p><p>That is also why I prefer composable workflows over one giant “do everything” agent. Routing, tool use, evaluation loops, and narrow responsibilities are often easier to inspect and control than a monolithic agent with a huge hidden prompt [<a href="#ref4">4</a>].</p><h3>7. The Five Specialist Skills I’d Plug Into It</h3><p>For the reference design, I split the control plane into five specialist skills. Each one has a narrow job, but all of them read from and write to the same governed memory layer.</p><p>SkillPrimary questionMemory contributionAdvisor-OrchestratorWho or what should handle this work?Routing decisions, model performance, cost, risk, escalation historyCommit ArchaeologistWhy does the repository look this way?Historical intent, change chains, reverted approaches, decision evidenceProject GraveyardWhy did this initiative stall, and is recovery rational?Failure patterns, abandoned dependencies, unresolved blockers, salvageable assetsScope Creep DetectorIs implementation still aligned with assigned intent?Baseline scope, approved changes, divergence signals, escalation historySelf-Improving AgentHow should the system improve without degrading reliability?Evaluation outcomes, failure classes, candidate revisions, validation evidence</p><p>I would expose each skill as a real module with a clear interface, not bury it as a few hidden prompt instructions. Its output should be an artifact that another component — or a human — can inspect and evaluate independently.</p><h3>8. Skill One: The Advisor-Orchestrator</h3><p>The first skill is the Advisor-Orchestrator. Its job is to separate high-level routing from the actual specialist work.</p><p>That matters because not every engineering task deserves the same model, the same context depth, the same tool permissions, or the same human oversight. Fixing a typo, upgrading a dependency, changing a security-sensitive configuration, and planning an architectural migration are completely different jobs.</p><p>So I would let the orchestrator score a few concrete dimensions:</p><ul><li>task complexity;</li><li>execution risk;</li><li>required tools;</li><li>historical success rate;</li><li>estimated cost;</li><li>latency requirement;</li><li>repository sensitivity;</li><li>need for human approval; and</li><li>availability of prior memory.</li></ul><pre># Assumed success rate for a model with no history on this task kind.<br>COLD_START_PRIOR = 0.5</pre><pre>ROUTING_WEIGHTS = {<br>    &quot;success_rate&quot;: 0.35,<br>    &quot;capability&quot;: 0.25,<br>    &quot;cost&quot;: 0.20,<br>    &quot;risk&quot;: 0.20,<br>}<br></pre><pre>class NoEligibleModel(Exception):<br>    pass<br></pre><pre>def route(task, memory, models, policy):<br>    profile = memory.task_profile(task.kind)</pre><pre>    candidates = [<br>        m for m in models<br>        if policy.model_allowed(m, task.repository)<br>    ]</pre><pre>    if not candidates:<br>        # Policy can legitimately exclude every model, for example on<br>        # a restricted repository. That is an escalation, not a crash.<br>        raise NoEligibleModel(<br>            f&quot;no permitted model for {task.repository} / {task.kind}&quot;<br>        )</pre><pre>    scored = []<br>    for model in candidates:<br>        # Each term is normalized to [0, 1] and the weights sum to 1,<br>        # so the score stays comparable across task kinds. An unseen<br>        # model gets the cold-start prior rather than a zero, which<br>        # would otherwise make a new model permanently unroutable.<br>        score = (<br>            ROUTING_WEIGHTS[&quot;success_rate&quot;] * profile.success_rate(<br>                model, default=COLD_START_PRIOR<br>            )<br>            + ROUTING_WEIGHTS[&quot;capability&quot;] * model.capability(task.kind)<br>            + ROUTING_WEIGHTS[&quot;cost&quot;] * (1 - model.normalized_cost)<br>            + ROUTING_WEIGHTS[&quot;risk&quot;] * (1 - task.risk_penalty(model))<br>        )<br>        scored.append((score, model.name, model))</pre><pre>    # model.name breaks ties deterministically, so the same inputs<br>    # always produce the same route and the decision is reproducible.<br>    score, _, selected = max(scored, key=lambda row: (row[0], row[1]))</pre><pre>    decision = {<br>        &quot;model&quot;: selected.name,<br>        &quot;score&quot;: round(score, 4),<br>        &quot;considered&quot;: [name for _, name, _ in scored],<br>        &quot;requires_review&quot;: policy.requires_review(task),<br>        &quot;memory_pack&quot;: memory.retrieve_for(task),<br>    }</pre><pre>    # The routing decision is itself memory. Without this the system<br>    # cannot later learn which routes worked.<br>    memory.record_routing_decision(task_id=task.id, decision=decision)</pre><pre>    return decision</pre><p>There are four small implementation details in that function that make it more than a toy. The weights add up to one and the inputs are normalized, so scores remain comparable. A new model gets a cold-start prior instead of a zero, so it is not permanently excluded just because it has no history yet. Ties break deterministically on the model name, which makes routing reproducible. And if policy excludes every model, the function escalates instead of crashing — because “nothing is permitted here” is a legitimate policy outcome.</p><p>The most important line, though, is the one that writes the routing decision back to memory, including the alternatives considered. If the system does not remember what it chose, it cannot later learn whether that choice was any good.</p><p>I am not trying to turn engineering judgment into one magic score. The point is to make routing explicit, observable, reproducible, and learnable from outcomes.</p><h3>9. Skill Two: The Commit Archaeologist</h3><p>The second skill came from a frustration I think most engineers know: the repository often contains the reason for a decision, but finding that reason at the exact moment you need it is painful.</p><p>I call this the Commit Archaeologist. It treats Git history as evidence, not just chronology, and tries to reconstruct the intent behind the current code.</p><p>For a file, subsystem, or even a specific line range, I would have it inspect things like:</p><ul><li>commits that introduced the current behaviour;</li><li>associated messages and issue references;</li><li>later modifications and reversions;</li><li>adjacent tests;</li><li>blame lineage;</li><li>renames and file movement;</li><li>repeated bug-fix patterns; and</li><li>historically rejected approaches.</li></ul><p>The output should not be a vague summary of old commit messages. I want a claim-evidence object: here is what I think happened, here is how confident I am, and here is exactly what supports the claim.</p><pre>{<br>  &quot;question&quot;: &quot;Why is retry_count capped at 3?&quot;,<br>  &quot;finding&quot;: &quot;The cap was introduced after repeated duplicate message processing during network partitions.&quot;,<br>  &quot;confidence&quot;: 0.91,<br>  &quot;evidence&quot;: [<br>    &quot;commit:4e92a1c&quot;,<br>    &quot;test:test_retry_deduplication&quot;,<br>    &quot;issue:OPS-184&quot;<br>  ],<br>  &quot;status&quot;: &quot;historical_intent&quot;,<br>  &quot;superseded_by&quot;: null,<br>  &quot;caveat&quot;: &quot;No later decision explicitly supersedes this rationale.&quot;<br>}</pre><p>This complements what modern coding agents are already getting good at. Systems such as SWE-agent show how useful agent-focused repository interfaces can be [<a href="#ref5">5</a>], while OpenHands demonstrates agents working through terminals, browsers, editors, sandboxed execution, and coordination [<a href="#ref6">6</a>]. The Commit Archaeologist adds a different ingredient: historical intent before the modification begins.</p><h3>10. Skill Three: Project Graveyard Intelligence</h3><p>The third skill came from looking at a different kind of engineering waste: abandoned prototypes, dormant branches, stalled migrations, half-built internal tools, and projects that are technically still there but operationally dead. The code survives; the reason the project died often does not.</p><p>Project Graveyard Intelligence treats those abandoned projects as evidence instead of dead storage.</p><p>A recovery dossier could pull together:</p><ul><li>last meaningful commits;</li><li>open issues and pull requests;</li><li>dependency age;</li><li>build and test status;</li><li>unresolved architecture notes;</li><li>ownership changes;</li><li>deployment history;</li><li>scope expansion;</li><li>duplicated replacement projects; and</li><li>historical failure memories.</li></ul><p>I would not let the output collapse into a simplistic “revive it” or “delete it.” The useful answer is usually a breakdown of what is reusable, conditionally reusable, obsolete, unresolved, or simply too risky to trust.</p><p>CategoryExample assessmentReusableDomain model, test fixtures, migration scripts, documentationConditionally reusableCore services requiring dependency modernizationObsoleteCode tied to retired interfaces or abandoned infrastructureUnresolvedArchitecture decisions lacking evidence of final approvalHigh riskSecurity-sensitive components with uncertain ownership or unsupported dependencies</p><p>This becomes more valuable over time because persistent memory lets the system compare failure patterns across projects instead of re-investigating every abandoned initiative in isolation.</p><h3>11. Skill Four: The Scope Creep Detector</h3><p>The fourth skill is about a problem that gets worse as coding gets faster: unapproved divergence can happen faster too.</p><p>A ticket that says “add a validation rule” can quietly turn into schema changes, new dependencies, refactors, and behavioural changes across several services. Some of that expansion is necessary. Some is accidental. Some should stop and ask for approval.</p><p>The Scope Creep Detector compares what the agent is doing with an explicit task baseline.</p><p>That baseline can include:</p><ul><li>issue description;</li><li>acceptance criteria;</li><li>approved files or components;</li><li>prohibited changes;</li><li>expected interfaces;</li><li>risk classification;</li><li>approved change requests; and</li><li>historical scope decisions stored in memory.</li></ul><pre>from dataclasses import dataclass<br>from pathlib import PurePosixPath<br>from typing import Literal</pre><pre>Severity = Literal[&quot;informational&quot;, &quot;review&quot;, &quot;blocking&quot;]<br></pre><pre>@dataclass(frozen=True)<br>class ScopeSignal:<br>    kind: str<br>    severity: Severity<br>    detail: tuple[str, ...] = ()<br></pre><pre>def within_scope(path: str, allowed: set[str]) -&gt; bool:<br>    &quot;&quot;&quot;A task approving a directory approves the files beneath it.&quot;&quot;&quot;<br>    candidate = PurePosixPath(path)<br>    return any(<br>        candidate == PurePosixPath(entry)<br>        or PurePosixPath(entry) in candidate.parents<br>        for entry in allowed<br>    )<br></pre><pre>def scope_delta(task, patch) -&gt; list[ScopeSignal]:<br>    signals: list[ScopeSignal] = []<br>    allowed = set(task.expected_paths) | set(task.approved_expansions)</pre><pre>    unexpected = sorted(<br>        path for path in patch.changed_paths<br>        if not within_scope(path, allowed)<br>    )<br>    if unexpected:<br>        signals.append(ScopeSignal(<br>            &quot;unexpected_paths&quot;, &quot;review&quot;, tuple(unexpected)<br>        ))</pre><pre>    if patch.public_api_changed and not task.public_api_change_allowed:<br>        signals.append(ScopeSignal(&quot;public_api_change&quot;, &quot;blocking&quot;))</pre><pre>    if patch.new_dependency and not task.dependencies_allowed:<br>        signals.append(ScopeSignal(&quot;dependency_expansion&quot;, &quot;review&quot;))</pre><pre>    # Removal is the signal a diff-size heuristic misses entirely: a<br>    # patch that deletes a guard or its test is small, and it is<br>    # exactly the case where prior decisions must be consulted.<br>    if patch.removed_tests:<br>        signals.append(ScopeSignal(<br>            &quot;test_removal&quot;, &quot;blocking&quot;, tuple(sorted(patch.removed_tests))<br>        ))</pre><pre>    guarded = patch.removed_lines_matching(task.protected_patterns)<br>    if guarded:<br>        signals.append(ScopeSignal(<br>            &quot;protected_logic_removed&quot;, &quot;blocking&quot;, tuple(sorted(guarded))<br>        ))</pre><pre>    return signals</pre><p>I deliberately made this more than a “big diff equals risky diff” heuristic. Three details matter:</p><p>Path matching is prefix-aware. If a task approves src/payments/, it should naturally approve files underneath that directory. Exact-string matching would incorrectly flag every legitimate file in the subtree.</p><p>Every signal also carries a severity. That is what lets the system distinguish “worth noting” from “needs review” from “stop here.” A flat list of findings cannot support that distinction.</p><p>And I explicitly look for removal. A patch that deletes a guard clause or a regression test may be tiny, so a size-based heuristic will call it trivial. But that is exactly the kind of change where the historical reason for the code may matter most.</p><p>I also would not automatically reject every deviation. The detector needs four separate verbs: <strong>detect</strong>, <strong>explain</strong>, <strong>approve</strong>, and <strong>block</strong>.</p><p>That separation keeps governance from becoming a brittle rules engine while still giving humans visibility into where the implementation left the original plan.</p><h3>12. Skill Five: A Self-Improving Agent — With Guardrails</h3><p>The fifth skill is the one I would be most careful with. “Let the agent learn from experience” sounds attractive, but I would treat self-improvement exactly like a software change: proposed, evaluated, regression-tested, approved, deployed, and monitored.</p><p>The Self-Improving Agent can use evaluation history to suggest changes to prompts, tool descriptions, routing rules, retrieval strategies, or reusable skills. But a suggestion is only a candidate change until it passes the checks.</p><pre>Production / evaluation traces<br>            │<br>            ▼<br>      Failure clustering<br>            │<br>            ▼<br>   Candidate improvement<br>            │<br>            ▼<br>      Offline evaluation<br>            │<br>       ┌────┴────┐<br>       ▼         ▼<br>    reject     improve<br>                 │<br>                 ▼<br>          regression checks<br>                 │<br>                 ▼<br>             approval<br>                 │<br>                 ▼<br>             deployment<br>                 │<br>                 ▼<br>          monitored outcome</pre><p>That fits the way agent evaluation is evolving. Agents operate across multiple turns, call tools, modify state, and can fail through a bad trajectory even when the final answer looks fine [<a href="#ref7">7</a>]. Tooling can also be improved systematically through evaluation rather than intuition alone [<a href="#ref8">8</a>].</p><p>Persistent memory is what gives this loop a history to learn from: previous failures, successful trajectories, cost data, tool errors, reviewer decisions, and regression evidence remain available across optimization cycles.</p><h3>13. Shared Memory Is What Turns Five Tools Into One System</h3><p>At this point the five skills are interesting on their own, but without shared memory they are still just five separate utilities.</p><p>Give them a common memory layer and they become a control loop.</p><pre>┌───────────────────┐<br>                      │ PERSISTENT MEMORY │<br>                      └─────────┬─────────┘<br>                                │<br>        ┌───────────────────────┼───────────────────────┐<br>        │                       │                       │<br>        ▼                       ▼                       ▼<br> Advisor-Orchestrator     Commit Archaeologist   Project Graveyard<br>        │                       │                       │<br>        └───────────────┬───────┴───────────────┬──────┘<br>                        │                       │<br>                        ▼                       ▼<br>              Scope Creep Detector      Self-Improving Agent<br>                        │                       │<br>                        └───────────┬───────────┘<br>                                    ▼<br>                           Evaluation + audit<br>                                    │<br>                                    ▼<br>                             Updated memory</pre><p>Here is a concrete example. The Advisor-Orchestrator retrieves prior performance data and chooses a model. The Commit Archaeologist discovers that an odd-looking implementation was added to prevent a previous production failure. The Scope Creep Detector notices that the proposed fix would remove that safeguard and expand the public interface. The control plane escalates the patch. The review outcome becomes an evaluation event, and the Self-Improving Agent later uses that trace to improve routing or tool guidance.</p><p>No single skill needs to understand the whole architecture. The memory layer is what carries the relevant state from one specialist to the next.</p><h3>14. Retrieval Should Know Who Is Asking — Not Just What Looks Similar</h3><p>Of course, a real engineering memory store will eventually contain far more information than any one agent should see for one task.</p><p>That means retrieval needs gates, not just embeddings.</p><p>The ordering I would use is:</p><ol><li>authorization;</li><li>project and repository scope;</li><li>task relevance;</li><li>memory type;</li><li>freshness and supersession;</li><li>confidence;</li><li>semantic relevance; and</li><li>token-budget selection.</li></ol><p>I would also give each specialist a different view of memory.</p><p>The Commit Archaeologist should care most about historical decisions and repository evidence. The Scope Creep Detector should pull current scope and approved changes. The Self-Improving Agent needs evaluations and failure clusters. The Advisor-Orchestrator needs model performance, cost, and routing history.</p><p>That is why one global similarity search is not enough. “Semantically similar” is only one part of “appropriate for this role, right now.”</p><h3>15. Event Sourcing Gave Me a Useful Mental Model</h3><p>Event sourcing gave me a clean way to think about the underlying history: keep the events, then derive the current view from them.</p><p>For agentic engineering, that append-oriented event stream could record:</p><ul><li>task creation;</li><li>scope approval;</li><li>model selection;</li><li>tool invocation;</li><li>repository inspection;</li><li>patch generation;</li><li>test result;</li><li>review outcome;</li><li>scope exception;</li><li>deployment result;</li><li>rollback; and</li><li>memory consolidation.</li></ul><p>Different consumers can then build different current-state views from the same underlying event history.</p><pre>{<br>  &quot;event_id&quot;: &quot;evt_01J9ZQK000000000000000000&quot;,<br>  &quot;sequence&quot;: 4821,<br>  &quot;prev_event_id&quot;: &quot;evt_01J9ZQJ000000000000000000&quot;,<br>  &quot;event_type&quot;: &quot;scope_exception_approved&quot;,<br>  &quot;schema_version&quot;: 2,<br>  &quot;project_id&quot;: &quot;payments-modernization&quot;,<br>  &quot;task_id&quot;: &quot;ENG-481&quot;,<br>  &quot;actor&quot;: &quot;human:platform-lead&quot;,<br>  &quot;timestamp&quot;: &quot;2026-08-19T10:42:17Z&quot;,<br>  &quot;payload&quot;: {<br>    &quot;added_component&quot;: &quot;schema-registry&quot;,<br>    &quot;reason&quot;: &quot;required to preserve backwards compatibility&quot;<br>  },<br>  &quot;evidence&quot;: [<br>    &quot;pull_request:1842&quot;,<br>    &quot;decision:ADR-071&quot;<br>  ]<br>}</pre><p>I would keep explicit ordering fields here. A monotonic sequence plus prev_event_id makes gaps detectable and gives the stream a causal order that timestamps alone cannot guarantee when agents run across distributed systems with clock skew. A schema_version also lets event payloads evolve without making old history unreadable.</p><p>That gives you something much more useful than “what does the system believe now?” You can also reconstruct how it got there.</p><h3>16. A Good Memory System Also Needs to Forget</h3><p>There is another uncomfortable truth: an always-on memory system that cannot forget eventually becomes dangerous.</p><p>Some memories get stale. Some are replaced by newer decisions. Some must be deleted. Some should remain in the audit trail but stop influencing model context. And some are sensitive enough that they should never be broadly retrievable in the first place.</p><p>So I would make at least four lifecycle operations explicit:</p><p>OperationMeaningExpireStop routine retrieval after a defined date unless explicitly requestedSupersedePreserve historical record but mark a newer memory as currentArchiveRetain for audit or research while excluding from normal agent contextDeleteRemove according to privacy, security, contractual, or retention requirements</p><p>In other words, forgetting is not a bug in this design. It is part of the governance model.</p><h3>17. Security Has to Come Before Retrieval</h3><p>Persistent memory makes the system more capable, but it also concentrates a lot of sensitive context in one place.</p><p>The security rule I would enforce is simple: authorization happens <em>before</em> memory enters a model prompt, not after the model has already seen it.</p><p>The control plane should check:</p><ul><li>repository permissions;</li><li>project membership;</li><li>data classification;</li><li>customer or tenant boundaries;</li><li>secret detection;</li><li>regulated data;</li><li>model-provider restrictions;</li><li>tool permissions; and</li><li>action-level approval requirements.</li></ul><p>Agent autonomy adds the usual governance concerns too: agents can misunderstand intent, take unintended actions, or be manipulated by hostile content. Current guidance on trustworthy agents emphasizes human control, secure interactions, transparency, and privacy [<a href="#ref9">9</a>]. NIST’s Generative AI Profile similarly treats governance, measurement, and risk management as lifecycle responsibilities rather than something solved at the model layer alone [<a href="#ref10">10</a>].</p><h3>Persistent Memory Creates a New Kind of Prompt-Injection Problem</h3><p>But there is one security risk that becomes especially interesting once memory is persistent.</p><p>With a stateless agent, a prompt injection hidden in a source file, commit message, issue comment, or dependency README may poison one session and then disappear with it. In a memory-writing system, that same hostile content can be captured as an “observation,” consolidated into a higher-level claim, and later retrieved as if it were established project knowledge. The injection can outlive the session that ingested it — and worse, it can come back wearing the system’s own provenance markers.</p><p>Consolidation can amplify the problem. Once a hostile sentence is summarized, the obvious red flags may disappear. Repeated exposure to the same poisoned source can make a false claim look like a recurring pattern, and confidence can rise precisely because the system sees the same contamination more than once.</p><h3>Architectural implication</h3><p>That is why I would scrutinize memory <em>writes</em> at least as seriously as memory reads. External content should be stored as attributed source material, not silently promoted into system truth. Any memory that would change routing rules, scope baselines, protected patterns, or permissions should be review-gated regardless of confidence. And because memories retain their evidence lineage, the system should be able to enumerate and revoke everything derived from a source later found to be compromised.</p><p>The control plane is the natural place to enforce those constraints because it sits exactly between intent, memory, model reasoning, tools, and action [<a href="#ref9">9</a>][<a href="#ref10">10</a>].</p><h3>18. Passing Tests Is Not Enough — Evaluate the Whole Trajectory</h3><p>Another point I would not compromise on: a patch that passes its tests is not automatically a good agent outcome.</p><p>The agent might have touched irrelevant sensitive data, changed files it never needed, used an expensive model for an easy job, ignored a historical decision, or reached the correct answer through a brittle workaround.</p><p>So evaluation should inspect the trajectory, not just the final patch.</p><p>DimensionExample questionTask successDid the implementation satisfy the acceptance criteria?Scope disciplineDid the agent change only what was justified?Historical consistencyDid the agent account for relevant prior decisions?Tool disciplineWere tools used safely and efficiently?CostWas the selected route proportionate to task complexity?Review burdenHow much human correction was required?Regression riskDid the change degrade previously passing behaviours?Memory qualityWere durable insights captured without storing unnecessary noise?</p><p>Those evaluations should themselves become memory. That is how the system can compare behaviour over time instead of treating every task as if it were the first task it has ever seen.</p><h3>19. I Would Keep the Interfaces Open and the Internals Replaceable</h3><p>I also would not force every specialist to use the same model, framework, or implementation. The control plane should care about contracts, not internal uniformity.</p><p>A narrow interface can be enough:</p><pre>from typing import Protocol, runtime_checkable</pre><pre>from control_plane.types import (<br>    Evaluation,<br>    Evidence,<br>    MemoryPack,<br>    MemoryQuery,<br>    MemoryRecord,<br>    SkillResult,<br>    Task,<br>    ToolSet,<br>)<br></pre><pre>@runtime_checkable<br>class Skill(Protocol):<br>    &quot;&quot;&quot;The control plane depends on this shape, not on any class.</pre><pre>    Declaring it as a Protocol means a skill satisfies the contract by<br>    having the right methods, so implementations need share no base<br>    class, runtime, or model.<br>    &quot;&quot;&quot;</pre><pre>    name: str</pre><pre>    def can_handle(self, task: Task) -&gt; bool:<br>        ...</pre><pre>    def required_memory(self, task: Task) -&gt; list[MemoryQuery]:<br>        ...</pre><pre>    def execute(<br>        self, task: Task, memory_pack: MemoryPack, tools: ToolSet<br>    ) -&gt; SkillResult:<br>        ...</pre><pre>    def evaluate(<br>        self, result: SkillResult, evidence: Evidence<br>    ) -&gt; Evaluation:<br>        ...</pre><pre>    def emit_memory(<br>        self, result: SkillResult, evaluation: Evaluation<br>    ) -&gt; list[MemoryRecord]:<br>        ...</pre><p>That interface is the boundary between coordination and implementation.</p><p>One skill can use deterministic Git analysis plus an LLM. Another can rely on static analysis. Another can call a stronger reasoning model only when ambiguity crosses a threshold. As long as the control plane gets standardized inputs, outputs, policies, and evidence, the internal machinery can remain replaceable.</p><p>This also makes the architecture compatible with open-source agent ecosystems. SWE-agent focuses on agent-computer interfaces for repository work [<a href="#ref5">5</a>], and OpenHands provides generalist software-development agents, sandboxed code execution, coordination, and benchmark integration [<a href="#ref6">6</a>]. I would treat systems like these as execution capabilities while keeping memory and governance above them.</p><h3>20. Here Is the Whole Workflow, End to End</h3><p>To make the whole thing concrete, imagine an issue reporting intermittent duplicate processing in a payment service.</p><pre>1. Issue arrives<br>      │<br>      ▼<br>2. Advisor-Orchestrator classifies risk and selects route<br>      │<br>      ▼<br>3. Memory retrieves similar incidents and prior decisions<br>      │<br>      ▼<br>4. Commit Archaeologist reconstructs retry logic history<br>      │<br>      ▼<br>5. Coding agent proposes patch and tests<br>      │<br>      ▼<br>6. Scope Creep Detector compares patch with approved task<br>      │<br>      ├────────► escalation if divergence is material<br>      │<br>      ▼<br>7. Evaluation validates correctness + trajectory<br>      │<br>      ▼<br>8. Result is reviewed / deployed<br>      │<br>      ▼<br>9. New evidence is written to memory<br>      │<br>      ▼<br>10. Self-Improving Agent incorporates outcome into future evals</pre><p>Notice what the workflow does <em>not</em> require: one omniscient agent that understands everything.</p><p>Coordination comes from explicit state, narrow capabilities, governed memory, and transitions that leave evidence behind.</p><h3>21. How I’d Measure Whether Any of This Is Actually Working</h3><p>The goal of this control plane is not “maximize autonomy.” The goal is better engineering outcomes while keeping enough control to understand, review, and reverse what the system does.</p><p>DimensionExample measureContinuityShare of tasks where relevant prior decisions are successfully retrievedMemory precisionUseful retrieved memory items divided by total memory items suppliedMemory freshnessRate of stale or superseded memories entering active contextRouting efficiencyTask success relative to model and tool costHistorical recoveryEngineering questions answered with traceable repository evidenceScope disciplineMaterial unapproved divergences detected before mergeProject recovery valueReusable assets identified in stalled initiativesImprovement safetyCandidate optimizations rejected by regression gates before productionHuman review burdenReviewer time per accepted agent changeAuditabilityAgent actions for which decision, evidence, and memory lineage can be reconstructed</p><p>I would always read the metrics together. Lower cost with more scope violations is not an improvement. More stored memory with worse retrieval precision is not an improvement. More autonomy with less reconstructable decision-making is not an improvement either.</p><h3>22. If I Had to Roll This Out Tomorrow, I’d Do It in This Order</h3><p>I definitely would not start by giving a persistent agent unrestricted access to every repository and every piece of historical context.</p><p>A bounded rollout is safer, easier to evaluate, and much easier to debug.</p><ol><li><strong>Select one repository and one recurring task family.</strong> Bug fixing or maintenance work is easier to evaluate than unconstrained product development.</li><li><strong>Establish the memory schema.</strong> Define what counts as a decision, failure, scope change, evaluation, and project-state event.</li><li><strong>Separate raw events from consolidated memory.</strong> Preserve audit evidence while controlling what enters normal retrieval.</li><li><strong>Introduce the Advisor-Orchestrator.</strong> Make routing explicit before adding more autonomous capabilities.</li><li><strong>Add repository-history intelligence.</strong> Use the Commit Archaeologist to improve historical context before code modification.</li><li><strong>Define scope baselines.</strong> Introduce the Scope Creep Detector before allowing broad autonomous edits.</li><li><strong>Add project-level analysis.</strong> Use Project Graveyard Intelligence where historical project context is sufficiently available.</li><li><strong>Build evaluations before self-improvement.</strong> The system should not optimize itself until changes can be measured against stable tests and trajectory criteria.</li><li><strong>Expand permissions gradually.</strong> Autonomy should grow only where evidence demonstrates reliable control.</li></ol><h3>23. When I Would Not Use Persistent Memory</h3><p>I also think the architecture is more useful when its limits are stated plainly. There are at least five situations where I would push back on using it.</p><h3>The work is not longitudinal</h3><p>First, the work has to be longitudinal enough for continuity to matter. Greenfield prototypes, one-off scripts, and short-lived experimental branches may not accumulate enough reusable history to justify a full memory layer. The question is not “can the agent remember this?” but “would anyone actually be worse off if it forgot?”</p><h3>Nobody owns the conflict queue</h3><p>Second, someone has to own the conflict queue. Consolidation, supersession, and contradiction resolution inevitably produce cases the evaluator cannot settle. If nobody is accountable for those cases, the backlog grows, thresholds get relaxed, and unreviewed claims start carrying the weight of institutional memory.</p><h3>Stale memory is worse than no memory</h3><p>Third, stale memory can be worse than no memory. An agent that retrieves an old architectural decision and treats it as current can make a confidently wrong change and then justify it with a citation. That is why expiration and supersession are not housekeeping; they are part of the correctness model.</p><h3>The concentration is itself a risk</h3><p>Fourth, the concentration of information can itself be a security problem. A store that spans repositories, incidents, and projects becomes a compact map of engineering weaknesses — failing services, missing controls, unsupported components, unclear ownership. Distributed across systems that picture is difficult to assemble; consolidated for retrieval, it may be one query away.</p><h3>The system cannot yet be evaluated</h3><p>Fifth, I would not attempt self-improvement before the evaluation system is trustworthy. An optimization loop that measures the wrong thing can optimize the wrong thing very efficiently, and persistent memory makes the drift cumulative. The rollout order in the next section is deliberate: evaluation comes before self-improvement.</p><p>My simple pre-flight test would be this: are engineers repeatedly reconstructing the same history by hand, and is a named owner accountable for what the memory asserts? If both are true, the layer may earn its cost. If either is missing, better retrieval over the existing repository and issue tracker may deliver more value with less risk.</p><h3>24. The Bigger Idea: Memory Makes Improvement Cumulative</h3><p>A stateless coding agent can improve because the underlying model gets better, the prompt gets rewritten, or the tools get upgraded.</p><p>A memory-enabled control plane gets one more source of improvement: accumulated organizational experience.</p><p>It can remember which decisions keep mattering, which failures recur, which routes work, which scope changes create risk, which abandoned projects still contain useful assets, and which agent changes helped or hurt performance.</p><p>That creates a loop I find especially interesting:</p><pre>Experience<br>    │<br>    ▼<br>Evidence<br>    │<br>    ▼<br>Memory<br>    │<br>    ▼<br>Better context and routing<br>    │<br>    ▼<br>More controlled action<br>    │<br>    ▼<br>Evaluation<br>    │<br>    ▼<br>Improved skills and policy<br>    │<br>    └──────────────► Memory</pre><p>The word I would underline there is <strong>controlled</strong>.</p><p>Memory should not silently rewrite system rules. A successful evaluation should not automatically authorize deployment. An agent should not infer new permissions because it succeeded last time. Improvement still needs policy, evidence, and review around it.</p><h3>Where I Landed</h3><p>What excites me about agentic software development is that we are moving beyond isolated code generation. Agents can inspect repositories, use tools, run code, coordinate tasks, and stay involved across longer workflows.</p><p>But that shift exposes the same limitation that started this whole exploration: serious engineering depends on history, while most agent interactions are still temporary.</p><p>Always-on memory gives us a way to preserve the parts of state that should survive a model context — decisions, failures, evaluations, scope changes, historical intent, and project status — while still keeping the active prompt selective.</p><p>For me, it becomes much more compelling when that memory is connected to a control plane instead of left as a passive database.</p><p>The Advisor-Orchestrator can route work using past performance and risk. The Commit Archaeologist can recover why the code looks the way it does. Project Graveyard Intelligence can separate salvageable assets from dead weight. The Scope Creep Detector can compare implementation with intent. And the Self-Improving Agent can use evaluation evidence to refine the system without turning production into an uncontrolled experiment.</p><p>Shared memory is what turns those modules from a bag of automation tricks into a cumulative engineering system.</p><p>I do not see this as an argument for removing human judgment. I see it as a way to make machine action more context-aware, inspectable, and governable.</p><p>The long-term advantage of coding agents probably will not come only from writing more code per minute. It will come from systems that remember why the code exists, understand how the project got here, notice when execution leaves its intended path, and improve without losing the evidence that justified the change.</p><p>That, to me, is the real promise of persistent memory in an agentic software-development control plane.</p><h3>Sources &amp; Further Reading</h3><p><strong>[1]</strong> Park, J. S., O’Brien, J. C., Cai, C. J., Morris, M. R., Liang, P., &amp; Bernstein, M. S. (2023). <em>Generative Agents: Interactive Simulacra of Human Behavior</em>. Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology. <a href="https://doi.org/10.1145/3586183.3606763">https://doi.org/10.1145/3586183.3606763</a>.</p><p><strong>[2]</strong> Packer, C., Wooders, S., Lin, K., Fang, V., Patil, S. G., Stoica, I., &amp; Gonzalez, J. E. (2023). <em>MemGPT: Towards LLMs as Operating Systems</em>. arXiv:2310.08560. <a href="https://arxiv.org/abs/2310.08560">arXiv</a>.</p><p><strong>[3]</strong> Anthropic. (2025). <em>Effective Context Engineering for AI Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents">Anthropic</a>.</p><p><strong>[4]</strong> Anthropic. (2024). <em>Building Effective Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/building-effective-agents">Anthropic</a>.</p><p><strong>[5]</strong> Yang, J., Jimenez, C. E., Wettig, A., Lieret, K., Yao, S., Narasimhan, K., &amp; Press, O. (2024). <em>SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering</em>. Advances in Neural Information Processing Systems. <a href="https://arxiv.org/abs/2405.15793">arXiv</a>.</p><p><strong>[6]</strong> Wang, X., Li, B., Song, Y., Xu, F. F., Tang, X., Zhuge, M., Pan, J., et al. (2024). <em>OpenHands: An Open Platform for AI Software Developers as Generalist Agents</em>. arXiv:2407.16741. <a href="https://arxiv.org/abs/2407.16741">arXiv</a>.</p><p><strong>[7]</strong> Anthropic. (2026). <em>Demystifying Evals for AI Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents">Anthropic</a>.</p><p><strong>[8]</strong> Anthropic. (2025). <em>Writing Effective Tools for Agents — With Agents</em>. Anthropic Engineering. <a href="https://www.anthropic.com/engineering/writing-tools-for-agents">https://www.anthropic.com/engineering/writing-tools-for-agents</a>.</p><p><strong>[9]</strong> Anthropic. (2026). <em>Trustworthy Agents in Practice</em>. Anthropic Research. <a href="https://www.anthropic.com/research/trustworthy-agents">Anthropic</a>.</p><p><strong>[10]</strong> Autio, C., Schwartz, R., Dunietz, J., Jain, S., Stanley, M., Tabassi, E., Hall, P., &amp; Roberts, K. (2024). <em>Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile</em>. NIST AI 600–1. National Institute of Standards and Technology. <a href="https://doi.org/10.6028/NIST.AI.600-1">https://doi.org/10.6028/NIST.AI.600-1</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62591067c496" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Found an Open Knowledge Format on GitHub - and It Changed How I Think About AI Agents]]></title>
            <link>https://medium.com/@chandi.academic/i-found-an-open-knowledge-format-on-github-and-it-changed-how-i-think-about-ai-agents-4374f28f5aa7?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4374f28f5aa7</guid>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Mon, 14 Sep 2026 20:29:25 GMT</pubDate>
            <atom:updated>2026-09-14T20:29:25.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ePRXbWMZBpF8mF0BJ-Oe8Q.png" /></figure><p>I expected a dry specification. Instead, I found a surprisingly simple way to make enterprise knowledge portable, inspectable, version-controlled, and genuinely useful to AI agents.</p><p>I was browsing GitHub looking at ways to make AI agents less dependent on one retrieval stack, one vector database, or one vendor-specific knowledge system. I ended up in Google Cloud Platform’s <em>knowledge-catalog</em> repository and opened the Open Knowledge Format (OKF) specification.</p><p>My first reaction was basically: <strong>wait… that’s it?</strong></p><p>The core idea was almost suspiciously simple: keep knowledge in ordinary Markdown files, put machine-readable metadata in YAML frontmatter, connect concepts with normal links, preserve provenance and lifecycle signals, and let whatever AI system you use consume the same portable artifact.</p><blockquote>I expected another framework. What I found was closer to a contract between knowledge and agents.</blockquote><p>That sent me down a rabbit hole. I pulled the specification, the repository documentation, and the reference-agent instructions from GitHub. Then I used an LLM almost like a technical pair-programmer: to walk through edge cases with me, translate parts of the spec into small validators and retrieval sketches, compare OKF with RAG and knowledge graphs, and pressure-test what would happen in a real enterprise setup.</p><p>The LLM made the exploration dramatically faster, but I kept going back to the specification whenever something mattered. That distinction turned out to be important: the model was great for <em>exploration</em>; the source remained the authority.</p><p>And the more I played with it, the more the idea stopped feeling like “a Markdown format” and started feeling like a potential <strong>interoperability layer for agent knowledge</strong>.</p><p>This post is the trail of that exploration: what surprised me, what I would actually build, where the format becomes powerful, and where I think people could misuse it.</p><p><em>One important note:</em> this was an architecture and prototyping exercise, not a production benchmark. I was testing how the pieces fit together, where the specification was elegant, and where I would put stronger controls before trusting it in a real agent workflow.</p><h3>The problem I kept running into wasn’t retrieval</h3><p>I started from a familiar frustration: we keep giving agents more connectors, more indexes, and more context windows, but the knowledge itself is still fragmented. The more systems I listed out, the more obvious it became that the hard part wasn’t just finding information — it was agreeing on what a reusable knowledge object should look like.</p><p>Enterprise knowledge is rarely absent. It is fragmented across systems that were designed for different audiences and purposes.</p><p>Data catalogs organize tables and fields. Source repositories preserve code and configuration. Documentation systems organize pages for human browsing. Search engines index text. Vector databases encode semantic similarity. Knowledge graphs represent entities and relationships. Workflow platforms maintain process state. AI agents then arrive and are expected to use all of these sources as though they formed one coherent knowledge environment.</p><p>The difficulty is not merely integration at the API level. The deeper problem is representational.</p><p>Different systems expose different assumptions about what a knowledge object is, which metadata matters, how relationships are expressed, whether provenance is retained, and how consumers should determine whether information is current.</p><p>When an organization builds an agent directly against one proprietary representation, the agent may become tightly coupled to that platform. Migration then requires more than moving documents. It requires translating the assumptions embedded in the knowledge layer itself.</p><p>A portable enterprise knowledge architecture therefore needs a representation that can survive changes in:</p><ul><li>model provider;</li><li>agent framework;</li><li>vector database;</li><li>knowledge-management interface;</li><li>cloud platform;</li><li>retrieval strategy;</li><li>organizational ownership; and</li><li>time.</li></ul><p>This is the problem space in which OKF is most useful.</p><h3>Then I looked at what OKF actually standardizes</h3><p>When I opened the OKF spec, I expected a large schema. Instead, the design was intentionally small. That simplicity is what caught my attention, because it means the format can survive even if the model, vector database, agent framework, or cloud stack changes.</p><p>OKF is an open, human- and agent-friendly format for representing the metadata, context, and curated insight surrounding data and systems. The current v0.2 specification deliberately keeps the format small: a bundle is a directory hierarchy containing UTF-8 Markdown files, while concept metadata is expressed in YAML frontmatter [<a href="#ref1">1</a>].</p><p>The design objective is not to impose a universal ontology. It is to establish enough common structure that a knowledge corpus can be inspected and traversed without requiring a bespoke SDK or central service.</p><p>At the simplest level, an OKF bundle can look like this:</p><pre>enterprise-knowledge/<br>├── index.md<br>├── log.md<br>├── systems/<br>│   ├── index.md<br>│   ├── identity-service.md<br>│   └── payments-service.md<br>├── metrics/<br>│   ├── index.md<br>│   └── net-revenue.md<br>├── playbooks/<br>│   ├── index.md<br>│   └── incident-escalation.md<br>└── references/<br>    └── security-policy.md</pre><p>Each non-reserved Markdown document represents a concept. In OKF v0.2, the only universally required frontmatter field for a concept is type. Other fields such as title, description, resource, and tags are recommended or optional, while additional field families support provenance, trust, lifecycle, freshness, and computation.</p><p>This permissiveness is intentional. An unfamiliar concept type should not make a bundle unreadable. Consumers are expected to degrade gracefully rather than reject content merely because its producer introduced a domain-specific type or extension field. The specification is explicit on this point: a consumer must not reject a bundle for unknown types, unknown additional keys, missing optional fields, broken cross-links, or absent index files [<a href="#ref1">1</a>].</p><p>Two structural details are easy to miss and matter in implementation. The filenames index.md and log.md are reserved at every level of the hierarchy and cannot be used for concepts. And index files carry no frontmatter at all, with a single exception: a bundle-root index.md may declare okf_version. Producers that generate frontmatter uniformly across every file will emit non-conformant index documents [<a href="#ref1">1</a>].</p><h3>The part that clicked for me</h3><p>OKF standardizes the <strong>knowledge artifact</strong>, not the entire knowledge stack. It does not require a particular database, embedding model, retrieval engine, agent runtime, or UI. That separation is essential to its portability.</p><h3>The first thing I tried to model: one useful knowledge object</h3><p>This was the point where I stopped reading passively and started turning the spec into examples. I wanted to know whether a single concept could be readable by me, diffable in Git, parseable by code, and still useful to an agent. Surprisingly, the answer was yes.</p><p>A concept document combines structured metadata with human-readable content. This creates a useful dual representation: deterministic software can inspect the frontmatter, while humans and language models can interpret the Markdown body.</p><p>A practical enterprise concept might look like this. Note the actor convention used for identity fields, and the footnote whose label matches a sources entry id, which is how v0.2 attributes an individual claim [<a href="#ref1">1</a>]:</p><pre>---<br>type: API Endpoint<br>title: Rotate Service Credential<br>description: Rotates the active credential for a managed service account.<br>resource: https://internal.example/api/credentials/rotate<br>tags: [identity, security, operations]<br>status: stable<br>generated: { by: knowledge-pipeline/2.4, at: 2026-08-18T14:10:00Z }<br>verified:<br>  - { by: human:security-platform-owner, at: 2026-08-19T09:25:00Z }<br>stale_after: 2026-11-19<br>sources:<br>  - id: rotation-policy<br>    resource: https://internal.example/policies/credential-rotation<br>    title: Credential rotation policy<br>    author: team:security-engineering<br>    last_modified: 2026-08-12<br>---</pre><pre># Rotate Service Credential</pre><pre>Use this endpoint when a managed service credential must be<br>rotated outside the scheduled rotation window.</pre><pre>## Preconditions</pre><pre>The caller must have the credential-rotation permission and the<br>service must be registered with the centralized secrets<br>platform.[^rotation-policy]</pre><pre>## Related concepts</pre><pre>See the [Secrets Management Playbook](/playbooks/secrets-management.md).</pre><pre>[^rotation-policy]: Credential rotation policy</pre><p>Three conventions in that example are worth stating explicitly, because they are the ones enterprise producers most often get wrong.</p><p><strong>Identity fields follow an actor convention.</strong> generated.by and verified[].by use &lt;producer&gt;/&lt;version&gt; for tools, human:&lt;id&gt; for people, and process:&lt;id&gt; for automated processes. This is not cosmetic: consumers derive trust tiers by testing for the human: prefix, so a hand-authored concept whose author is written as a bare name will be classified as machine-confirmed rather than human-reviewed [<a href="#ref1">1</a>].</p><p><strong>Claims are attributed by footnote, not by position.</strong> A markdown footnote whose label is a sources[].id binds a specific sentence to a specific source. The specification is deliberate about using a stable key rather than a positional index, because agents rewrite these documents continually and a reordered list would misattribute silently [<a href="#ref1">1</a>].</p><p><strong>The link form matters.</strong> A link beginning with / is bundle-relative and survives a document being moved within its subdirectory, which is why it is the recommended form [<a href="#ref1">1</a>].</p><p>This representation is deliberately understandable without specialized tooling. A text editor can render it. Git can diff it. A static site generator can publish it. A search index can parse it. An agent can load it into context. A graph process can extract the link. A policy engine can inspect selected metadata fields.</p><p>That multi-consumer property is one of the format’s strongest architectural characteristics.</p><h3>The bundle idea is where it started to feel practical</h3><p>A single Markdown file is not interesting enough. The moment the spec talks about a bundle — a whole directory tree that can travel together — the architecture becomes much more useful. Now I can imagine a team shipping its knowledge as a coherent package rather than as a pile of disconnected exports.</p><p>A single concept is useful, but enterprise interoperability depends on moving coherent collections of knowledge.</p><p>OKF treats the <strong>knowledge bundle</strong> as the unit of distribution. A bundle is a self-contained hierarchical collection of concept documents. It can be distributed through a Git repository, an archive, or as a directory within a larger repository, with Git recommended because it supplies history, attribution, and diffs [<a href="#ref1">1</a>].</p><p>This matters because knowledge rarely travels as isolated pages. An application team may need to transfer a complete body of knowledge containing services, metrics, operating procedures, dependencies, decisions, and references.</p><p>The bundle makes that transfer explicit.</p><pre>PRODUCER SYSTEM<br>               │<br>               ▼<br>       ┌─────────────────┐<br>       │   OKF BUNDLE    │<br>       │                 │<br>       │ Markdown        │<br>       │ YAML metadata   │<br>       │ Cross-links     │<br>       │ Provenance      │<br>       │ Lifecycle       │<br>       └─────────────────┘<br>               │<br>      ┌────────┼─────────┬──────────┐<br>      ▼        ▼         ▼          ▼<br>    Agent    Search    Static UI   Graph<br>   Runtime    Index    / Portal    Builder</pre><p>The producer and consumers do not need to share the same runtime. They need to agree on the artifact.</p><h3>One small feature I didn’t expect to care about: progressive disclosure</h3><p>I initially skimmed past index.md. Then I realized it solves a problem I keep seeing with agents: they are often forced to retrieve before they understand what is even available. A lightweight index lets the agent browse first and load detail only when it needs it.</p><p>One of the practical problems in large knowledge bases is deciding how much context to expose before a consumer knows what it needs.</p><p>OKF addresses this partly through optional index.md files. An index can enumerate the contents of a directory so that a human or agent can discover available concepts before opening them individually [<a href="#ref1">1</a>]. Entries should carry the description from the linked concept&#39;s frontmatter, which is what makes an index useful as a triage surface rather than a bare file listing.</p><p>This creates a useful pattern of progressive disclosure:</p><pre>Bundle root index<br>      │<br>      ├── systems/<br>      │      │<br>      │      └── systems/index.md<br>      │              │<br>      │              ├── identity-service.md<br>      │              └── payments-service.md<br>      │<br>      └── playbooks/<br>             │<br>             └── playbooks/index.md<br>                    │<br>                    └── incident-escalation.md</pre><p>An agent can first inspect a compact index, identify the relevant subdomain, inspect the next index, and retrieve only the concept documents required for the task.</p><p>This reduces unnecessary context loading and supports a more disciplined retrieval strategy than treating an entire knowledge repository as one undifferentiated corpus.</p><p>Because indexes are optional, a consumer cannot assume one exists. The specification anticipates this: producers may generate index files automatically, and consumers may synthesize an equivalent catalog on the fly by scanning frontmatter [<a href="#ref1">1</a>]. An enterprise consumer should implement the synthesis path rather than failing when a directory has no index.</p><p>Progressive disclosure also works well with conventional information architecture. Knowledge can be browsed by people without forcing the human interface to mirror the retrieval implementation used by agents.</p><h3>Normal Markdown links suddenly become infrastructure</h3><p>I loved how unglamorous this part was. No proprietary graph syntax is required just to express a relationship. A normal link can serve a human, a crawler, an agent, and a graph extractor at the same time.</p><p>A folder of Markdown files is not automatically a knowledge system. Relationships matter.</p><p>OKF concept documents can use normal Markdown links to reference other concepts. Bundle-relative absolute links and conventional relative links are both supported.</p><p>That small design decision has important consequences.</p><p>Links can be interpreted simultaneously as:</p><ul><li>human navigation;</li><li>agent traversal paths;</li><li>graph edges;</li><li>dependency indicators;</li><li>impact-analysis inputs; and</li><li>retrieval expansion signals.</li></ul><p>One consumer obligation follows from this. A link whose target does not exist is not an error in OKF terms; it may simply represent knowledge that has not been written yet, and consumers must tolerate it [<a href="#ref1">1</a>]. A traversal routine that raises on a missing target will fail on conformant bundles.</p><p>Consider a metric concept that references a table, a business definition, and a governance policy. A consumer can follow those links to reconstruct not only the metric’s description but the context in which it is valid.</p><p>This is qualitatively different from retrieving semantically similar chunks. Similarity identifies textual closeness. Links can represent intentional knowledge relationships.</p><h3>Portability without provenance scared me a little</h3><p>At this point I had a slightly less exciting thought: if knowledge becomes easier to move, bad knowledge also becomes easier to move. That made provenance feel less like metadata and more like a safety property.</p><p>Portability without provenance is dangerous.</p><p>If a knowledge artifact is moved from one system to another, the receiving agent needs to know what produced the information and which sources support it. Otherwise, portability can increase the speed at which unsupported claims propagate.</p><p>OKF v0.2 therefore makes provenance an explicit frontmatter concern. A concept can identify source resources and attach source-level signals: author, usage_count, and last_modified. The specification records objective signals rather than prescribing a universal credibility score, on the reasoning that a score is subjective, unportable between consumers, and goes stale [<a href="#ref1">1</a>].</p><p>Two qualifications belong with that. A usage_count is framed by a usage_window date range written alongside sources, and it is a coarse signal: comparable at the alive-versus-dead and order-of-magnitude level, but not a precise cross-kind ranking, since a scheduled query&#39;s executions and a human&#39;s deliberate dashboard views do not carry equal weight [<a href="#ref1">1</a>]. An enterprise trust policy that sorts on raw usage counts will systematically favour automated traffic over considered human use.</p><p>Lineage is expressed through links rather than a dedicated field. When a source resource points at another concept in the bundle, the derivation edge already exists in the bundle graph, so a consumer may recurse into that concept’s own sources. Deeper lineage remains outside v0.2 [<a href="#ref1">1</a>].</p><p>This is a strong design choice for enterprise systems because credibility is contextual.</p><p>A policy signed by a security owner may carry greater authority than a frequently viewed internal note. A production schema may be more authoritative than a presentation about the schema. A regulatory source may take precedence over a locally generated summary even if the latter is newer.</p><p>By transporting the signals rather than a single universal score, OKF allows different consumers to implement trust policies appropriate to their task.</p><h3>This is where I had to separate “trusted” from “allowed”</h3><p>While playing with the trust fields, I realized how easy it would be to make a conceptual mistake: “human-reviewed” sounds authoritative, but it says nothing about whether the current user is actually allowed to see or act on the content.</p><p>Enterprise knowledge architectures often collapse several different ideas into one field called “trust.” That is usually insufficient.</p><p>OKF distinguishes how content was generated from how it was verified. In v0.2, generated records who or what produced the current content, while verified records the actor or actors that confirmed it against its sources or underlying resource.</p><p>Consumers derive trust tiers from the verification state: no verified key means unverified, verification by non-human actors only means machine-confirmed, and verification by a human: actor means human-reviewed [<a href="#ref1">1</a>].</p><p>One parsing detail has caught several implementations. A single verifier may be written as a bare mapping rather than a one-element list, and consumers are required to treat the two forms identically [<a href="#ref1">1</a>]. Code that assumes a list will raise on a conformant document.</p><p>These states are informative, but they are not authorization.</p><p>A human-reviewed security document can still be inaccessible to a particular user. Conversely, a user may have access to a draft concept without the system treating it as authoritative.</p><p>A mature architecture therefore separates:</p><p><strong>Provenance</strong><br>Where did this knowledge come from?</p><p><strong>Verification</strong><br>Who or what checked it?</p><p><strong>Lifecycle state</strong><br>Is it intended for current use?</p><p><strong>Freshness</strong><br>Is it still timely enough for the task?</p><p><strong>Authorization</strong><br>Is this consumer allowed to access it?</p><p><strong>Policy</strong><br>Under what conditions may it influence action?</p><p>OKF contributes several of these signals. Enterprise infrastructure must supply the rest.</p><h3>Freshness is boring — until an agent acts on stale knowledge</h3><p>This was one of those details that looked boring in the spec and became very important once I imagined an autonomous agent. A stale paragraph in a wiki is annoying. A stale runbook inside an agent context can cause an action.</p><p>Knowledge that was accurate six months ago may be actively harmful today.</p><p>OKF v0.2 provides lifecycle fields that allow a concept to declare whether it is draft, stable, or deprecated; an absent status means stable. A separate stale_after field specifies the absolute date on which the information should be regarded as stale, and a concept is stale when today is on or after that date [<a href="#ref1">1</a>].</p><p>The choice of an absolute date over a relative time-to-live is deliberate. It keeps the staleness decision a plain date comparison that needs no reference to when the concept was written or read [<a href="#ref1">1</a>]. The cost falls on the producer, which must convert its own retention policy into a concrete date at generation time.</p><p>This enables deterministic checks before model inference.</p><pre>from datetime import date, datetime<br></pre><pre>def as_date(value) -&gt; date:<br>    &quot;&quot;&quot;stale_after is a plain YYYY-MM-DD date.</pre><pre>    A YAML parser returns it already typed as a date, while JSON and<br>    hand-built dictionaries return a string. Accept both: passing a<br>    date object to date.fromisoformat raises TypeError.<br>    &quot;&quot;&quot;<br>    if isinstance(value, datetime):<br>        return value.date()<br>    if isinstance(value, date):<br>        return value<br>    return date.fromisoformat(str(value))<br></pre><pre>def trust_tier(verified) -&gt; str:<br>    if not verified:<br>        return &quot;unverified&quot;</pre><pre>    # A single verifier may be written as a bare mapping rather than a<br>    # one-element list; the two forms are equivalent.<br>    events = verified if isinstance(verified, list) else [verified]</pre><pre>    if any(str(e.get(&quot;by&quot;, &quot;&quot;)).startswith(&quot;human:&quot;) for e in events):<br>        return &quot;human-reviewed&quot;<br>    return &quot;machine-confirmed&quot;<br></pre><pre>def consumption_state(frontmatter: dict, today: date) -&gt; str:<br>    # Absent status means stable.<br>    if frontmatter.get(&quot;status&quot;, &quot;stable&quot;) == &quot;deprecated&quot;:<br>        return &quot;reject_or_warn&quot;</pre><pre>    stale_after = frontmatter.get(&quot;stale_after&quot;)<br>    if stale_after and today &gt;= as_date(stale_after):<br>        return &quot;stale&quot;</pre><pre>    return trust_tier(frontmatter.get(&quot;verified&quot;))</pre><p>Two implementation details in that gate are easy to get wrong, and both come from the format rather than from the logic.</p><p>A YAML parser returns stale_after already typed as a date, because the value is an unquoted YYYY-MM-DD literal. The same field arriving from JSON or from a hand-built dictionary is a string. Code that calls date.fromisoformat unconditionally works in one path and raises a TypeError in the other, which is why the helper above normalizes before comparing.</p><p>The gate returns a trust tier rather than a single eligibility verdict, because eligibility is a policy question and the tiers mean different things for different tasks. A machine-confirmed runbook may be adequate for drafting a summary and inadequate for authorizing a production change. Collapsing the three tiers into one boolean discards exactly the distinction the format was designed to carry.</p><p>The significance of this code is architectural rather than algorithmic. A deterministic gate can decide whether a concept is eligible for use <strong>before</strong> its content is inserted into a model context.</p><p>This is preferable to asking an LLM to infer freshness from prose after retrieval.</p><h3>So I sketched a producer pipeline</h3><p>Once the representation made sense, I wanted to see what an actual producer would look like. My working rule became: let deterministic code do deterministic work, let the LLM do semantic work, and force high-impact changes through review.</p><p>OKF does not prescribe how knowledge is generated. That flexibility makes the producer architecture an organizational responsibility.</p><p>A robust enterprise pipeline should separate source extraction, interpretation, document production, validation, and review.</p><h3>Where the LLM helped me most</h3><p>I wasn’t asking the model to invent a knowledge standard. I was using it to shorten the feedback loop: “Turn this rule into a validator.” “Show me how this breaks if verified is a mapping instead of a list.” “What would an agent retrieval function look like if authorization happens before content loading?” That made the GitHub spec feel executable instead of static.</p><p>The important habit was checking the answer back against the repository whenever the detail affected conformance, trust, or security.</p><pre>Source systems<br>     │<br>     ▼<br>Connectors / export<br>     │<br>     ▼<br>Normalization<br>     │<br>     ▼<br>Concept identification<br>     │<br>     ▼<br>LLM-assisted enrichment<br>     │<br>     ▼<br>OKF document generation<br>     │<br>     ▼<br>Deterministic validation<br>     │<br>     ├────────► review queue<br>     │<br>     ▼<br>Version control<br>     │<br>     ▼<br>Distribution / serving</pre><p>The language model should not be responsible for every stage.</p><p>Deterministic code is better suited to validating frontmatter syntax, required fields, path safety, link formats, schema constraints, and repository invariants. Human review may remain necessary for high-impact concepts, disputed interpretations, policy statements, and material architectural decisions.</p><p>The model’s strongest role is semantic: extracting useful descriptions, identifying related concepts, synthesizing context, and translating source metadata into readable knowledge. The reference enrichment agent published alongside the specification illustrates one such division of labour, extracting technical metadata deterministically before applying model-assisted enrichment [<a href="#ref2">2</a>].[<a href="#ref3">3</a>]</p><h3>Then I tried to make the bundle fail before an agent could</h3><p>I used the LLM to help sketch validators, but I deliberately kept the final checks deterministic. This felt like the right boundary: the model can suggest structure, but CI should be able to reject a broken or under-governed concept without asking another model for an opinion.</p><p>Because OKF is intentionally permissive, enterprise producers should distinguish between <strong>specification conformance</strong> and <strong>organizational quality requirements</strong>.</p><p>For v0.2 conformance, every non-reserved Markdown file needs parseable YAML frontmatter with a non-empty type field, and reserved index.md and log.md files follow their own structures. A concept carrying nothing but type is fully conformant [<a href="#ref1">1</a>]. That is a deliberately low bar, and it is the reason an enterprise producer needs a second, stricter gate of its own.</p><p>An organization may require substantially more.</p><pre>import re</pre><pre># An ordered tuple, not a set: validator output lands in CI logs and<br># diffs, so the order of findings must be stable between runs.<br>REQUIRED_ENTERPRISE_FIELDS = (<br>    &quot;type&quot;,<br>    &quot;title&quot;,<br>    &quot;description&quot;,<br>    &quot;status&quot;,<br>)</pre><pre>ALLOWED_STATUS = (&quot;draft&quot;, &quot;stable&quot;, &quot;deprecated&quot;)</pre><pre># &lt;producer&gt;/&lt;version&gt;, or a prefixed identifier such as human:alice,<br># process:finance-nightly, team:security-engineering.<br>ACTOR = re.compile(r&quot;^(?:[a-z]+:[\w.-]+|[\w.-]+/[\w.-]+)$&quot;)<br></pre><pre>def validate_enterprise_concept(doc) -&gt; list[str]:<br>    errors: list[str] = []<br>    fm = doc.frontmatter</pre><pre>    for key in REQUIRED_ENTERPRISE_FIELDS:<br>        if not fm.get(key):<br>            errors.append(f&quot;missing:{key}&quot;)</pre><pre>    status = fm.get(&quot;status&quot;, &quot;stable&quot;)<br>    if status not in ALLOWED_STATUS:<br>        errors.append(f&quot;invalid_status:{status}&quot;)</pre><pre>    if status == &quot;stable&quot; and not fm.get(&quot;sources&quot;):<br>        errors.append(&quot;stable_without_sources&quot;)</pre><pre>    for index, source in enumerate(fm.get(&quot;sources&quot;) or []):<br>        if not source.get(&quot;resource&quot;):<br>            errors.append(f&quot;source_without_resource:{index}&quot;)<br>        author = source.get(&quot;author&quot;)<br>        if author and not ACTOR.match(str(author)):<br>            errors.append(f&quot;source_author_not_an_actor:{index}&quot;)</pre><pre>    if fm.get(&quot;sensitivity&quot;) == &quot;restricted&quot; and not fm.get(&quot;policy_scope&quot;):<br>        errors.append(&quot;restricted_without_policy_scope&quot;)</pre><pre>    if doc.contains_material_claims() and not fm.get(&quot;verified&quot;):<br>        errors.append(&quot;material_claims_unverified&quot;)</pre><pre>    return errors</pre><p>The actor check deserves a note, because the specification is looser here than it first appears. The actor convention names three forms, yet the specification’s own source example uses a team: prefix for an author. An enterprise profile should therefore pin the set of prefixes it accepts rather than assume the three documented forms are exhaustive, and validate against that local list.</p><p>What I like about this pattern is that it preserves interoperability while still allowing stronger local controls. The underlying artifact remains OKF-compatible, but the organization’s publishing pipeline can impose additional rules appropriate to its risk profile.</p><h3>How I would actually let an agent consume this</h3><p>The next experiment was to flip the direction. Instead of asking “how do I produce OKF?”, I asked “if I were the agent, how should I consume it without dumping the whole repository into context?”</p><p>A consumer should not simply read every Markdown file into the prompt.</p><p>An enterprise agent can treat an OKF bundle as a structured discovery surface.</p><p>A practical consumer pipeline can proceed in stages:</p><ol><li>identify the bundle and policy scope available to the user or agent;</li><li>read the root index or synthesize an equivalent catalog;</li><li>select candidate concept groups;</li><li>filter by lifecycle, freshness, verification, and authorization;</li><li>retrieve the smallest set of relevant concept documents;</li><li>follow explicit links when relational context is needed;</li><li>retrieve primary sources for high-consequence claims;</li><li>construct the final model context; and</li><li>retain provenance in the generated answer or action trace.</li></ol><pre># The same gate defined in section 9, reused rather than reimplemented.<br>from lifecycle import consumption_state<br></pre><pre>def retrieve_okf_context(query, bundle, policy, ranker, today,<br>                         token_budget=6000):<br>    # Authorization is applied at discovery so that restricted bodies<br>    # are never loaded into this process. Trust tiers are advisory<br>    # signals and are not a substitute for this check.<br>    candidates = bundle.discover(query, visible_to=policy)</pre><pre>    eligible = {}<br>    for concept in candidates:<br>        state = consumption_state(concept.frontmatter, today)<br>        if state in (&quot;reject_or_warn&quot;, &quot;stale&quot;):<br>            continue<br>        if not policy.tier_allowed(concept.type, state):<br>            continue<br>        eligible[concept.id] = (concept, state)</pre><pre>    context = []<br>    spent = 0</pre><pre>    for concept in ranker.rank(query, [c for c, _ in eligible.values()]):<br>        cost = concept.token_estimate()<br>        if spent + cost &gt; token_budget:<br>            break</pre><pre>        _, state = eligible[concept.id]<br>        context.append({<br>            &quot;concept_id&quot;: concept.id,<br>            &quot;title&quot;: concept.title,<br>            &quot;body&quot;: concept.body,<br>            &quot;sources&quot;: concept.frontmatter.get(&quot;sources&quot;, []),<br>            &quot;trust_tier&quot;: state,<br>            &quot;path&quot;: concept.path,<br>        })<br>        spent += cost</pre><pre>    return context</pre><p>Two stages from the outline above are omitted from this snippet for brevity, and both matter in production. Link expansion follows the explicit relationships in a retrieved concept to pull in the neighbours that make it interpretable, which is the step that distinguishes graph-aware retrieval from similarity search. Primary-source retrieval fetches the underlying resource for high-consequence claims rather than trusting the compiled description.</p><p>Three properties of the snippet are worth keeping in any implementation. Authorization is passed into discovery rather than applied as a filter afterwards, so restricted bodies are never loaded. The context is bounded by a token budget rather than a fixed document count, since concepts vary enormously in length and a count-based cut produces wildly different context sizes for the same query. And the trust tier travels into the assembled context, so the model and any downstream action trace can distinguish a human-reviewed statement from an unverified one.</p><p>The exact retrieval system may use lexical search, embeddings, graphs, rules, or a combination. OKF does not constrain that choice. Its contribution is that each retrieval engine can operate over the same portable knowledge artifact.</p><h3>The nice surprise: this doesn’t replace RAG</h3><p>I expected some tension with RAG, but the two ideas clicked together almost immediately. RAG answers the runtime question — what should I retrieve now? OKF answers a different question — what shape should the knowledge have before I retrieve it?</p><p>OKF should not be treated as a replacement for retrieval-augmented generation.</p><p>RAG is principally a runtime pattern for selecting external information and providing it to a model [<a href="#ref4">4</a>], elaborated in later work into pipelines spanning pre-retrieval processing, retrieval, post-retrieval processing, and generation [<a href="#ref5">5</a>]. OKF is a representation format for the knowledge being selected.</p><p>The two are complementary.</p><p><strong>External knowledge access</strong></p><p>RAG: Primary function</p><p>OKF: Provides portable source artifacts</p><p><strong>Retrieval ranking</strong></p><p>RAG: Yes</p><p>OKF: Not prescribed</p><p><strong>Human-readable knowledge object</strong></p><p>RAG: Not required</p><p>OKF: Core design property</p><p><strong>Portable metadata contract</strong></p><p>RAG: Implementation-specific</p><p>OKF: Core design property</p><p><strong>Provenance fields</strong></p><p>RAG: Pipeline-dependent</p><p>OKF: Standardized optional family</p><p><strong>Lifecycle and staleness</strong></p><p>RAG: Pipeline-dependent</p><p>OKF: Defined in the format</p><p><strong>Runtime serving stack</strong></p><p>RAG: Required by implementation</p><p>OKF: Not prescribed</p><p><strong>Agent/model independence</strong></p><p>RAG: Depends on implementation</p><p>OKF: Explicit design objective</p><p>A strong enterprise design therefore uses OKF to structure and transport knowledge, then applies retrieval to select the relevant subset for a particular model interaction.</p><h3>It doesn’t replace knowledge graphs either</h3><p>The same thing happened with graphs. I don’t need to choose between files and a knowledge graph. The files can remain the portable source, while a graph is derived for traversal and global reasoning.</p><p>Plain files and knowledge graphs are sometimes presented as competing approaches. They do not need to be.</p><p>An OKF corpus can remain the portable, inspectable source representation while a graph is derived from its metadata and links for traversal, impact analysis, or global sensemaking. Graph-based retrieval work has shown that explicitly represented entities and relationships, combined with higher-level summaries, support broad corpus-level questions that similarity search handles poorly [<a href="#ref6">6</a>].</p><pre>OKF BUNDLE<br>                 │<br>      ┌──────────┼──────────┐<br>      ▼          ▼          ▼<br> Markdown UI   Search    Graph extractor<br>                            │<br>                            ▼<br>                       Knowledge graph<br>                            │<br>                            ▼<br>                     Relationship queries</pre><p>This creates a useful separation between <strong>canonical portable representation</strong> and <strong>optimized serving representation</strong>.</p><p>The graph can be rebuilt. The bundle can be moved. The knowledge does not have to be permanently coupled to the graph engine that happens to serve it today.</p><h3>The feature that surprised me most: attested computation</h3><p>This was the moment I genuinely had to reread the spec. OKF wasn’t only describing knowledge; it had a way to describe a sanctioned computation and then attest that a reported value came from that computation. That pushes the idea much closer to governed executable knowledge.</p><p>One of the more significant additions in OKF v0.2 is explicit support for <strong>Attested Computation</strong>.</p><p>Many enterprise facts are not static statements. They are computed values: revenue, margin, active-customer count, risk score, service-level performance, or other metrics. Merely documenting the formula is insufficient if an agent can substitute its own computation and present the result as authoritative.</p><p>Attested Computation concepts provide a contract describing a sanctioned computation, its runtime, its parameters, and the mechanisms used to execute and attest a result.</p><p>The architectural distinction is important:</p><ul><li><strong>verification</strong> confirms that the documented definition still matches policy or its authoritative source;</li><li><strong>attestation</strong> confirms that a particular execution produced a value using the sanctioned computation and that the displayed value corresponds to the authoritative result.</li></ul><p>The contract is expressed in frontmatter. A runtime field states how the computation is run and thereby fixes what parameters mean, since a parameter is a SQL bind variable, a dbt var, or a Python argument depending on the runtime. An executor names run instructions and declares the receipt fields a run must return. An attester names deterministic, model-free code that inspects that receipt and returns a verdict [<a href="#ref1">1</a>]:</p><pre>---<br>type: Attested Computation<br>title: Revenue for fiscal year<br>description: Recognized revenue for a fiscal year, per Finance&#39;s definition.<br>status: stable<br>runtime: bigquery<br>parameters:<br>  - { name: year, type: integer, required: true }<br>executor:<br>  resource: references/skills/run-on-bq.md<br>  receipt: [job_id, executed_sql, result]<br>attester:<br>  resource: references/attesters/revenue.py<br>generated: { by: knowledge-pipeline/2.4, at: 2026-08-18T14:00:00Z }<br>verified: { by: human:finance-controller, at: 2026-08-19T09:00:00Z }<br>stale_after: 2026-11-19<br>sources:<br>  - id: rev-policy<br>    resource: https://internal.example/finance/revenue-recognition<br>    title: Revenue recognition policy<br>---</pre><pre># Computation</pre><pre>    SELECT SUM(amount) AS revenue<br>    FROM finance.recognized_revenue<br>    WHERE fiscal_year = @year</pre><pre>The computation binds only the declared parameters, per the<br>recognition policy.[^rev-policy]</pre><pre>[^rev-policy]: Revenue recognition policy</pre><p>The security property rests on one restriction: the agent may supply values for the declared parameters and may not author or edit the computation itself. Because the attester compares the expanded artifact the receipt carries against an independently re-derived binding, a rewritten query, a swapped computation file, or a mutated dependency all fail the check. That is what turns “did the sanctioned thing run” into a mechanical comparison rather than a judgement call [<a href="#ref1">1</a>].</p><p>Each computation is its own concept rather than a field on the metric that uses it. This is what allows revenue to be fresh while gross profit is past its stale_after, with each attesting independently on its own run [<a href="#ref1">1</a>].</p><p>This moves the knowledge layer beyond descriptive metadata toward governed executable knowledge.</p><p>For high-value metrics, the system can therefore answer not only “What does gross margin mean?” but also “Was this reported value produced through the approved computation?”</p><h3>Git starts to look like a knowledge primitive</h3><p>Once everything is ordinary files, Git stops being just where the bundle lives. History, diffs, rollback, review, branches, and release tags all become available to knowledge without inventing another proprietary workflow.</p><p>Because OKF uses ordinary files, Git becomes a natural distribution mechanism.</p><p>This is more significant than simple developer familiarity.</p><p>Version control can provide:</p><ul><li>change history;</li><li>diffs between knowledge states;</li><li>authorship and review workflows;</li><li>branch-based experimentation;</li><li>rollback;</li><li>release tagging;</li><li>change-triggered validation; and</li><li>portable replication.</li></ul><p>Knowledge changes can therefore be managed with some of the same discipline applied to code.</p><p>This does not mean every employee should edit knowledge through Git. User interfaces can sit above the repository. The important point is that the underlying representation remains accessible and diffable rather than existing only inside an opaque service-owned database.</p><h3>Then came the uncomfortable part: governance</h3><p>The exciting part of portable knowledge is that it moves. The dangerous part of portable knowledge is also that it moves. This section is where my enthusiasm became more cautious.</p><p>A portable format does not create a secure enterprise knowledge platform by itself.</p><p>Several critical controls remain outside the OKF specification and must be designed at the infrastructure level. General risk-management guidance for generative systems treats provenance, access control, and human oversight as core functions rather than optional additions [<a href="#ref7">7</a>].</p><h3>Authorization</h3><p>Consumers must enforce identity and access controls before sensitive concept content is loaded into an agent context.</p><h3>Prompt-injection resistance</h3><p>Knowledge content must be treated as data rather than privileged system instructions. Retrieved documents should not gain authority simply because they are represented in OKF [<a href="#ref8">8</a>].</p><p>Portability sharpens this risk rather than softening it. A bundle is designed to move between organizations, and a concept arriving from an external producer carries frontmatter that <em>looks</em> authoritative: a verified entry naming a human actor, a stable status, a populated sources list. None of it is attested. Any producer can write any actor string. A consumer that maps inbound trust fields directly onto its own trust tiers has effectively let an outside party assign privilege inside its runtime.</p><p>The practical control is to treat trust frontmatter as a claim scoped to its producer. Bundles should be namespaced by origin, inbound trust tiers re-derived under local policy rather than inherited, and actor identifiers from an external bundle never matched against internal identity records without an explicit mapping step.</p><h3>Secret handling</h3><p>Credentials, tokens, private keys, and other secrets should not become portable knowledge artifacts merely because Markdown can represent them.</p><h3>Data classification</h3><p>Organizations may need extension fields or repository-level policy metadata to indicate confidentiality, residency, retention, or regulatory restrictions.</p><h3>Human review</h3><p>High-impact knowledge should follow explicit approval workflows even when a model can generate a syntactically valid concept automatically.</p><h3>Deletion and revocation</h3><p>Removing a concept from the bundle must be coordinated with secondary systems such as embeddings, caches, search indexes, and replicated copies.</p><p>The rule I wrote down for myself was simple:</p><blockquote>Interoperability should make knowledge easier to move, not easier to misuse.</blockquote><h3>What I would add for a real enterprise</h3><p>The base format is intentionally permissive, which is great for interoperability and not enough for a serious enterprise. I would put a stricter organizational profile around it rather than trying to fork the format itself.</p><p>The core specification is intentionally minimal. Enterprises will usually need a stricter internal profile.</p><p>An enterprise profile can define conventions without fragmenting the underlying format.</p><p>For example:</p><pre># enterprise-okf-policy.yaml</pre><pre>okf_version: &quot;0.2&quot;</pre><pre>allowed_status:<br>  - draft<br>  - stable<br>  - deprecated</pre><pre># Prefixes accepted in generated.by, verified[].by and sources[].author.<br>allowed_actor_prefixes:<br>  - &quot;human:&quot;<br>  - &quot;process:&quot;<br>  - &quot;team:&quot;</pre><pre>required_fields:<br>  stable:<br>    - type<br>    - title<br>    - description<br>    - sources<br>    - verified<br>    - owner<br>    - sensitivity</pre><pre>sensitivity_levels:<br>  - public<br>  - internal<br>  - confidential<br>  - restricted</pre><pre>review_rules:<br>  security_policy:<br>    require_human_verification: true<br>  production_playbook:<br>    require_human_verification: true<br>  generated_reference:<br>    require_human_verification: false</pre><pre># Validity in days. The producer converts these into an absolute<br># stale_after date at generation time, because the format stores an<br># absolute date rather than a relative time-to-live.<br>freshness_ttl_days:<br>  API Endpoint: 90<br>  Playbook: 60<br>  Reference: 180</pre><p>This policy file is not itself required by OKF. It illustrates an important deployment strategy: preserve a broadly interoperable artifact while enforcing a more demanding organizational contract around how that artifact is produced and consumed.</p><h3>How I’d introduce this without ripping anything out</h3><p>I would not start by replacing a catalog, documentation platform, graph, or RAG system. The low-risk move is much less dramatic: export one bounded domain into OKF and prove that two different consumers can use the same artifact.</p><p>Organizations do not need to replace their existing knowledge systems to adopt OKF.</p><p>A safer strategy is to introduce OKF as an export and interchange layer.</p><pre>Existing sources<br>      │<br>      ├── Data catalog<br>      ├── Documentation<br>      ├── Repositories<br>      ├── APIs<br>      └── Governance systems<br>             │<br>             ▼<br>        Export / transform<br>             │<br>             ▼<br>          OKF bundles<br>             │<br>      ┌──────┼─────────┐<br>      ▼      ▼         ▼<br> Existing  New AI   External /<br> systems   agents   partner tools</pre><p>A phased implementation can proceed as follows:</p><ol><li><strong>Select a bounded domain.</strong> Begin with one knowledge area such as analytics, platform operations, or service architecture.</li><li><strong>Define concept mappings.</strong> Decide how existing objects map into OKF concept types and directories.</li><li><strong>Preserve canonical identifiers.</strong> Use resource and source metadata to maintain traceability to authoritative systems.</li><li><strong>Generate bundles automatically.</strong> Avoid manual duplication when the source system already contains structured metadata.</li><li><strong>Add semantic enrichment selectively.</strong> Use an LLM for descriptions, relationships, and context where deterministic export is insufficient.</li><li><strong>Validate before publishing.</strong> Apply both OKF conformance rules and enterprise policy gates.</li><li><strong>Connect one consumer.</strong> Demonstrate that a second tool or agent can consume the same bundle without source-specific integration.</li><li><strong>Measure portability and maintenance cost.</strong> Expansion should follow evidence that the format reduces coupling rather than merely creating another copy of the knowledge.</li></ol><h3>Migrating an existing v0.1 bundle</h3><p>Organizations that adopted the format early have a smaller migration to make, since v0.2 is largely additive. Two changes are breaking and should be handled explicitly [<a href="#ref1">1</a>].</p><p>A concept’s last content change moves from a bare timestamp field to generated: { by, at }. Consumers may fall back to the legacy field when generated is absent, but producers should rewrite it, because the actor recorded in generated.by is what later drives trust classification.</p><p>Provenance moves from a body # Citations list into the sources frontmatter family. This is the more substantial conversion, since a flat list of URLs has to become structured entries with a resource and, where the body cites them, a stable id to key footnotes against.</p><p>Everything else carries forward unchanged, and bundles may declare which version they target using okf_version in a root index.md. Consumers that do not recognize a declared version should attempt best-effort consumption rather than refusing the bundle [<a href="#ref1">1</a>].</p><p>This approach allows OKF to coexist with established platforms while progressively reducing consumer dependence on proprietary representations.</p><h3>What I would actually measure</h3><p>I also wouldn’t celebrate because I produced 5,000 Markdown files. The only metrics I care about are whether the knowledge became easier to reuse, easier to verify, and cheaper to move between systems.</p><p>The success of an OKF deployment should not be measured by the number of Markdown files produced.</p><p>The more meaningful question is whether the organization has reduced the cost and risk of moving knowledge between systems.</p><p><strong>Portability</strong><br>Percentage of concepts consumable by more than one agent or tool without source-specific transformation</p><p><strong>Traceability</strong><br>Percentage of material concepts with recoverable source provenance</p><p><strong>Freshness</strong><br>Median delay between source change and bundle update</p><p><strong>Trust visibility</strong><br>Percentage of high-impact concepts with explicit verification state</p><p><strong>Lifecycle hygiene</strong><br>Deprecated or stale concepts still returned to production consumers</p><p><strong>Validation quality</strong><br>Conformance and enterprise-policy failures detected before publication</p><p><strong>Retrieval efficiency</strong><br>Context volume required to answer representative tasks accurately</p><p><strong>Integration cost</strong><br>Engineering effort required to onboard a new consumer</p><p><strong>Vendor independence</strong><br>Share of knowledge available outside proprietary storage formats</p><p>The value proposition becomes strongest when the same knowledge artifact can serve multiple consumers while preserving its meaning, history, and governance signals.</p><h3>Where I would *not* use this</h3><p>After spending time with the format, I don’t think it should be sold as universal. There are very clear cases where adding an interchange layer creates more synchronization cost than value.</p><p>Minimal standards gain flexibility by leaving important decisions to implementers.</p><p>OKF is therefore not a complete answer to enterprise knowledge management.</p><p>Its Markdown-based representation is well suited to readable knowledge objects but is not intended to replace domain-specific schemas such as OpenAPI, Avro, Protobuf, or database definitions. The specification explicitly positions OKF as capable of referencing such resources rather than subsuming them.</p><p>Likewise, OKF does not prescribe:</p><ul><li>search quality;</li><li>embedding strategy;</li><li>authorization architecture;</li><li>conflict resolution;</li><li>document-level encryption;</li><li>semantic ontology design;</li><li>distributed synchronization;</li><li>agent orchestration; or</li><li>human governance processes.</li></ul><p>These omissions are not necessarily weaknesses. They are boundaries.</p><p>The architectural question is whether those boundaries are appropriate for the organization’s interoperability goal. If the goal is to create a portable knowledge contract while retaining freedom over runtime infrastructure, they are often advantageous.</p><h3>When the format is not the right investment</h3><p>Four situations argue against adoption, and stating them is more useful than treating the format as universally applicable.</p><p><strong>There is only one consumer, and there will only ever be one.</strong> Portability is the central benefit, and portability pays only when knowledge is read by more than the system that produced it. A team with a single agent over a single catalog gains an export step and a synchronization problem in exchange for an option it will not exercise.</p><p><strong>The source system is already the system of record.</strong> A bundle generated from a catalog is a copy, and a copy that drifts is worse than no copy. Unless the export is automated and re-run on change, the freshness fields will assert a currency the file does not have. The format makes staleness declarable; it does not make it detectable.</p><p><strong>The knowledge is highly structured and already has a schema.</strong> Table schemas, API contracts, and event definitions have dedicated formats that express constraints Markdown cannot. The specification is explicit that OKF references such schemas rather than subsuming them [<a href="#ref1">1</a>]. Flattening a strongly typed artifact into prose to make it portable loses more than it gains.</p><p><strong>Nobody owns the review step.</strong> The trust fields are producer-asserted. If concepts are generated automatically and marked verified by a process that performs no substantive check, the frontmatter will report human-reviewed knowledge that no human examined. A trust signal that is never falsified carries no information, and it is more dangerous than an absent one because consumers act on it.</p><p>My quick test before committing would be: if a second consumer is genuinely waiting for the knowledge, and a named owner is accountable for what the trust fields assert, the format is likely to earn its cost. If neither condition holds, an export pipeline can wait.</p><h3>The idea I came away with: standardize the artifact, not the stack</h3><p>After all the YAML, links, validators, retrieval sketches, and security caveats, this was the surprisingly simple principle I kept coming back to.</p><p>Enterprise AI is developing too quickly for organizations to assume that today’s agent framework, model provider, vector database, or knowledge-management product will remain permanent.</p><p>A durable architecture therefore needs a layer that changes more slowly than the tools around it.</p><p>OKF offers a plausible form for that layer because its central abstractions are deliberately conservative:</p><p><strong>files, directories, Markdown, YAML metadata, links, provenance, lifecycle, and version control.</strong></p><p>These are not technologically glamorous building blocks. That is precisely why they are potentially durable.</p><p>Organizations can optimize downstream representations aggressively while preserving a stable interchange artifact upstream.</p><pre>ENTERPRISE KNOWLEDGE<br>                     │<br>                     ▼<br>             ┌───────────────┐<br>             │  OKF LAYER    │<br>             │ portable      │<br>             │ inspectable   │<br>             │ versioned     │<br>             │ governed      │<br>             └───────────────┘<br>                     │<br>       ┌─────────────┼─────────────┐<br>       ▼             ▼             ▼<br>   Vector RAG    Graph RAG     Direct context<br>       │             │             │<br>       └─────────────┼─────────────┘<br>                     ▼<br>                AI AGENTS</pre><p>This pattern preserves freedom at the runtime level without forcing every consumer to rediscover what enterprise knowledge means.</p><h3>What I walked away thinking</h3><p>I found OKF because I was curious about making agent knowledge less brittle. What surprised me was how far a deliberately boring set of primitives — Markdown, YAML, links, folders, provenance, lifecycle fields, and Git — could go.</p><p>The big shift for me was this: <strong>an agent’s knowledge does not have to live inside the same system that retrieves it.</strong></p><p>You can keep a portable, inspectable artifact upstream and still use embeddings, vector RAG, GraphRAG, direct context, search, or whatever comes next downstream.</p><p>That separation feels increasingly important because the AI stack is changing ridiculously fast. Models change. Frameworks change. Retrieval systems change. Vendors change. Organizational knowledge should probably move more slowly.</p><p>I also came away more cautious than I started. Portable trust signals can be forged. Stale knowledge can become actionable. Verification is not authorization. An LLM can accelerate the creation and interpretation of knowledge, but it should not silently become the authority that certifies it.</p><p>Still, this was one of those GitHub rabbit holes that was much more interesting than I expected. I opened a specification. I ended up sketching a knowledge layer.</p><blockquote>Maybe the durable part of an AI system is not the model. Maybe it is the knowledge contract around it.</blockquote><p>That is the experiment I want to keep pushing.</p><h3>Sources I used while exploring this</h3><p>I kept these links because they are the material I was actually working from while exploring the idea — especially the OKF specification and reference-agent material on GitHub.</p><p><strong>[1]</strong> Google Cloud Platform. (2026). <em>Open Knowledge Format (OKF), Version 0.2 — Specification</em>. Knowledge Catalog repository. <a href="https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md">GitHub specification</a>.</p><p><strong>[2]</strong> Google Cloud Platform. (2026). <em>Open Knowledge Format (OKF) — README and Reference Implementation</em>. Knowledge Catalog repository. <a href="https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/README.md">GitHub repository documentation</a>.</p><p><strong>[3]</strong> Google Cloud Platform. (2026). <em>Reference Agent Instructions for Producing OKF Documents</em>. Knowledge Catalog repository. <a href="https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/src/reference_agent/prompts/reference_instruction.md">Reference agent instructions</a>.</p><p><strong>[4]</strong> Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., et al. (2020). <em>Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks</em>. Advances in Neural Information Processing Systems, 33. <a href="https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html">NeurIPS proceedings</a>.</p><p><strong>[5]</strong> Gao, Y., Xiong, Y., Gao, X., Jia, K., Pan, J., Bi, Y., Dai, Y., Sun, J., Wang, M., &amp; Wang, H. (2024). <em>Retrieval-Augmented Generation for Large Language Models: A Survey</em>. arXiv:2312.10997. <a href="https://doi.org/10.48550/arXiv.2312.10997">https://doi.org/10.48550/arXiv.2312.10997</a>.</p><p><strong>[6]</strong> Edge, D., Trinh, H., Cheng, N., Bradley, J., Chao, A., Mody, A., Truitt, S., Metropolitansky, D., Ness, R. O., &amp; Larson, J. (2024). <em>From Local to Global: A Graph RAG Approach to Query-Focused Summarization</em>. arXiv:2404.16130. <a href="https://doi.org/10.48550/arXiv.2404.16130">https://doi.org/10.48550/arXiv.2404.16130</a>.</p><p><strong>[7]</strong> Autio, C., Schwartz, R., Dunietz, J., Jain, S., Stanley, M., Tabassi, E., Hall, P., &amp; Roberts, K. (2024). <em>Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile</em>. NIST AI 600–1. National Institute of Standards and Technology. <a href="https://doi.org/10.6028/NIST.AI.600-1">https://doi.org/10.6028/NIST.AI.600-1</a>.</p><p><strong>[8]</strong> OWASP GenAI Security Project. (2025). <em>LLM01:2025 Prompt Injection</em>. OWASP Foundation. <a href="https://genai.owasp.org/llmrisk/llm01-prompt-injection/">OWASP GenAI Security Project</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4374f28f5aa7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Tried Building a Living LLM Wiki for AI Agents. Here’s the Architecture I Ended Up With]]></title>
            <link>https://medium.com/@chandi.academic/i-tried-building-a-living-llm-wiki-for-ai-agents-heres-the-architecture-i-ended-up-with-5ebb2a9bb2ab?source=rss-1902837a895e------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ebb2a9bb2ab</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Chandi Bhandari]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 23:25:19 GMT</pubDate>
            <atom:updated>2026-09-10T23:25:19.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Df3Wl8MokHz5ABvJSfv8XQ.png" /></figure><p><em>A practical build story about turning scattered documentation into persistent, traceable knowledge that both humans and AI agents can actually use.</em></p><p>Most organizations do not have an information shortage. They have an information-shape problem. The useful material is already there - inside documentation portals, repositories, PDFs, architecture decisions, support tickets, meeting notes, internal messages, and the heads of experienced people. The trouble starts when someone, or an AI agent, has to combine all of it into one reliable answer.</p><p>I kept running into the same pattern with retrieval-augmented generation (RAG): retrieval was useful, but the system often had to reconstruct the same relationships every time a new question arrived. It would retrieve fragments, infer how they fit together, rediscover which decision superseded which one, and resolve the same terminology again. So I tried a different framing: what if the system did some of that synthesis when knowledge entered the system, instead of repeating it at every query?</p><p>That led me to a practical LLM Wiki prototype — a persistent knowledge layer that sits between raw evidence and agent action. The idea is not to replace RAG, search, source documents, knowledge graphs, or human review. It is to give them a maintained layer of organizational understanding that can be reused.</p><blockquote>Compile knowledge when it enters the system, maintain it as understanding changes, and return to primary evidence whenever confidence or consequence demands verification.</blockquote><p>A note on the word “tried”: this is a build-and-design trial, not a lab benchmark. I am not presenting fabricated accuracy numbers or claiming a production rollout that did not happen. The value of the exercise was in forcing the architecture through concrete objects, ingestion rules, failure modes, governance gates, and evaluation criteria until the design became operational rather than theoretical.</p><h3>The problem I started with was not search</h3><p>At first, it is tempting to treat enterprise knowledge as a search problem. Index the documents, embed the chunks, retrieve the relevant passages, and give them to a language model. That already solves a lot.</p><p>But the questions that matter most are often not simple lookup questions. They sound more like this:</p><ul><li>What is the current policy, not just every policy document that mentions the topic?</li><li>Which architecture decision replaced the previous one?</li><li>Why does one service behave differently from the rest?</li><li>Which ideas appear across multiple projects under different names?</li><li>Where do two authoritative sources disagree?</li><li>What changed after the last release?</li><li>Which assumption is now stale?</li></ul><p>Those questions need chronology, relationships, synthesis, provenance, and judgment. Search retrieves documents. A maintained knowledge layer tries to represent what those documents collectively mean.</p><p>That distinction matters even more for agentic systems. An agent is not only reading. It may choose a tool, change a configuration, generate code, recommend an action, or trigger another workflow. If the context it receives is stale, contradictory, or stripped of provenance, the agent inherits those weaknesses.</p><h3>My first design shift: retrieval → knowledge compilation</h3><p>The simplest version of the idea was this: raw information should not have to be interpreted from zero every time it is used.</p><p>A normal retrieval pipeline parses a document, chunks it, embeds it, indexes it, and waits for a future query. In my trial design, I added one more stage: the new material had to be interpreted against what the system already knew.</p><p>During ingestion, the system attempts to identify entities, concepts, decisions, dependencies, constraints, terminology, contradictions, and relationships. Instead of generating a fresh isolated summary for every document, it updates existing knowledge objects when appropriate.</p><pre>Raw evidence<br>     │<br>     ▼<br>Parse and normalize<br>     │<br>     ▼<br>Extract claims, entities, decisions and relationships<br>     │<br>     ▼<br>Reconcile with existing knowledge<br>     │<br>     ├────────► contradiction / review queue<br>     │<br>     ▼<br>Update structured wiki<br>     │<br>     ▼<br>Index + graph + provenance metadata<br>     │<br>     ▼<br>Human readers and AI agents</pre><p>That changes the economics of repeated reasoning. If five documents jointly explain why an architectural decision was made, the knowledge layer can synthesize that relationship once during ingestion. A future agent can start from the maintained explanation and return to the five originals only when it needs to verify the evidence.</p><p>The crucial constraint is that the compiled page is not magically more authoritative than the source. It is simply more operationally useful because the relationship is explicit.</p><h3>I did not replace RAG. I made it part of a hybrid stack</h3><p>One of the easiest mistakes would have been to pitch the wiki as a replacement for RAG. That is not how the design held up. RAG is still excellent for bringing external or frequently changing evidence into model context. The better model is hybrid.</p><p>ComponentWhat I used it forRaw source repositoryPreserve canonical evidenceLLM WikiMaintain synthesized organizational knowledgeSearch and retrievalSelect the right knowledge and evidence for a taskGraph / index layerRepresent relationships, backlinks, and navigable structureLLMInterpret context, reason, and generateAgent runtimePlan, call tools, and execute tasksGovernance layerControl authority, review, access, and auditability</p><p>The division of labor became clearer as I worked through the design: the wiki compiles, retrieval selects, the language model reasons, and the agent acts.</p><p>This also helps with broad questions that similarity search alone can miss. Vector retrieval works best when the query resembles a relevant passage. Questions about relationships across a whole corpus often benefit from graph-style connections, higher-level summaries, backlinks, and stable entity identifiers. The wiki can remain human-readable while graph structures and embeddings operate as supporting indexes.</p><h3>The three layers I ended up needing</h3><h3>1) Raw sources</h3><p>The first layer is boring on purpose: preserve the original evidence. That includes technical documents, research papers, architecture records, meeting transcripts, policy documents, source-code documentation, incident reports, manuals, specifications, and approved internal guidance.</p><p>I would treat those sources as immutable versions. When a document changes, the system records a new version rather than silently rewriting history. The wiki may evolve; the evidence must remain traceable.</p><h3>2) The living wiki</h3><p>The second layer is where synthesis happens. Pages can represent concepts, systems, services, teams, decisions, procedures, dependencies, incidents, terminology, comparisons, patterns, and known limitations.</p><p>A useful page should not just summarize one document. It should express the current understanding of a subject and show which evidence supports it.</p><h3>3) Schema and operating rules</h3><p>The third layer is what keeps the wiki from turning into uncontrolled AI-generated prose. It defines page types, metadata, naming rules, link conventions, source requirements, confidence fields, review status, update behavior, and governance boundaries.</p><p>Without a schema, the first hundred generated pages may look impressive and the next thousand may become inconsistent. The schema turns free-form generation into controlled knowledge maintenance.</p><h3>The unit that mattered was the knowledge object, not the document</h3><p>I found it more useful to think in terms of knowledge objects than documents. A knowledge object carries enough structure for both a human and an agent to answer questions such as: Is this approved? Who owns it? When was it verified? Which source versions support it? What did it supersede? When should it be reviewed again? How sensitive is it?</p><p>I also avoided two traps. First, relationships should point to stable identifiers rather than titles, so renaming a page does not break the graph. Second, confidence should not be a fake precision score unless the pipeline can actually defend that calibration. A named level with a stated basis is often more honest.</p><pre>---<br>id: &quot;KO-0117&quot;<br>title: &quot;Authentication Token Rotation&quot;<br>version: &quot;2.0&quot;<br>type: &quot;procedure&quot;<br>status: &quot;approved&quot;<br>owner: &quot;Platform Engineering&quot;<br>created: &quot;2026-08-04&quot;<br>last_verified: &quot;2026-08-18&quot;<br>review_due: &quot;2026-11-18&quot;<br>sensitivity: &quot;internal&quot;<br>confidence:<br>  level: &quot;high&quot;<br>  basis: &quot;two approved sources; verified by named owner&quot;<br>sources:<br>  - id: &quot;SEC-POL-018&quot;<br>    version: &quot;3.1&quot;<br>  - id: &quot;ADR-042&quot;<br>    version: &quot;1.0&quot;<br>supersedes:<br>  - id: &quot;KO-0117&quot;<br>    version: &quot;1.0&quot;<br>related:<br>  - id: &quot;KO-0043&quot;<br>    title: &quot;Secrets Management&quot;<br>  - id: &quot;KO-0091&quot;<br>    title: &quot;Identity Service&quot;<br>---</pre><pre># Authentication Token Rotation</pre><pre>Production service tokens are rotated through the centralized<br>secrets workflow. Manual replacement is reserved for documented<br>recovery scenarios.</pre><pre>## Rationale</pre><pre>The centralized process reduces configuration divergence and<br>maintains an auditable rotation history.</pre><pre>## Exceptions</pre><pre>Emergency rotation may bypass the scheduled window when an<br>incident has been declared.</pre><pre>## Evidence</pre><pre>See SEC-POL-018 v3.1 and ADR-042 v1.0.</pre><p>This kind of object is much more usable by an agent than a loose paragraph because status, ownership, evidence, review dates, supersession, relationships, and sensitivity are all explicit instead of being inferred every time.</p><h3>The ingestion pipeline became a reconciliation process</h3><p>The biggest mental change was in the ingestion question. A weak pipeline asks: “What does this document say?” A stronger pipeline asks: “What does this document change about what we already know?”</p><p>Suppose the system already has an authentication architecture page, and a new decision record says session tokens will now be validated by a dedicated identity service. I do not want another floating summary. I want the pipeline to find the existing object, extract the new decision, detect superseded claims, update the relationship, preserve the historical state, link the evidence, flag unresolved conflicts, and record what happened.</p><ol><li>Identify the existing knowledge object.</li><li>Extract the new claim or decision.</li><li>Determine whether an older claim has been superseded.</li><li>Update the relevant relationship.</li><li>Preserve both historical and current states.</li><li>Link the new evidence.</li><li>Flag unresolved contradictions.</li><li>Write the change to an audit log.</li></ol><pre>from dataclasses import dataclass<br>from datetime import datetime, timezone<br>from typing import Iterable<br></pre><pre>@dataclass(frozen=True)<br>class Claim:<br>    id: str<br>    subject: str<br>    predicate: str<br>    value: str<br>    confidence: float<br>    source_id: str<br>    source_version: str<br></pre><pre>def ingest(source, extractor, knowledge_store, reviewer, actor):<br>    &quot;&quot;&quot;actor identifies the model or process proposing each change.&quot;&quot;&quot;<br>    document = source.read()<br>    started_at = datetime.now(timezone.utc)<br>    applied = queued = failed = 0</pre><pre>    claims: Iterable[Claim] = extractor.extract_claims(<br>        text=document.text,<br>        source_id=document.id,<br>        source_version=document.version,<br>    )</pre><pre>    for claim in claims:<br>        try:<br>            existing = knowledge_store.find_related(<br>                subject=claim.subject,<br>                predicate=claim.predicate,<br>            )</pre><pre>            decision = reviewer.reconcile(incoming=claim, existing=existing)</pre><pre>            if decision.requires_human_review:<br>                knowledge_store.queue_review(<br>                    incoming=claim,<br>                    conflicts=decision.conflicts,<br>                )<br>                knowledge_store.append_audit(<br>                    event=&quot;claim_queued&quot;,<br>                    claim_id=claim.id,<br>                    actor=actor,<br>                    rationale=decision.rationale,<br>                    at=datetime.now(timezone.utc),<br>                )<br>                queued += 1<br>                continue</pre><pre>            knowledge_store.upsert(<br>                claim=claim,<br>                supersedes=decision.superseded_claim_ids,<br>                updated_at=datetime.now(timezone.utc),<br>            )<br>            knowledge_store.append_audit(<br>                event=&quot;claim_applied&quot;,<br>                claim_id=claim.id,<br>                actor=actor,<br>                supersedes=decision.superseded_claim_ids,<br>                rationale=decision.rationale,<br>                at=datetime.now(timezone.utc),<br>            )<br>            applied += 1</pre><pre>        except Exception as error:<br>            # A failure is itself a recorded event. Silent loss of a<br>            # claim would break the provenance guarantee.<br>            knowledge_store.append_audit(<br>                event=&quot;claim_failed&quot;,<br>                claim_id=claim.id,<br>                actor=actor,<br>                error=repr(error),<br>                at=datetime.now(timezone.utc),<br>            )<br>            failed += 1</pre><pre>    knowledge_store.record_ingestion(<br>        source_id=document.id,<br>        source_version=document.version,<br>        status=&quot;complete&quot; if queued == 0 and failed == 0 else &quot;partial&quot;,<br>        applied=applied,<br>        pending_review=queued,<br>        failed=failed,<br>        started_at=started_at,<br>        finished_at=datetime.now(timezone.utc),<br>    )</pre><blockquote>Extract → compare → reconcile → review → update → record.</blockquote><p>Three details became non-negotiable. Every outcome needs an audit event, including queued and failed claims. Ingestion needs a status such as complete or partial rather than a bare timestamp. And every change needs an actor identity so the system can later tell which model or process proposed it and whether a human reviewed it.</p><p>The LLM can participate in maintenance, but the surrounding system decides what the model is allowed to change.</p><h3>Provenance stopped being a citation feature and became architecture</h3><p>Once generated knowledge is persistent, provenance can no longer be decorative. I wanted to be able to travel in both directions: from a source to the claims and wiki pages it created, and from an AI answer back to the wiki claim and original evidence.</p><pre>SOURCE ─────────► CLAIM<br>                  │<br>                  ▼<br>               WIKI PAGE<br>                  │<br>                  ▼<br>               AI ANSWER</pre><p>And in reverse:</p><pre>AI ANSWER<br>    │<br>    ▼<br>WIKI CLAIM<br>    │<br>    ▼<br>SOURCE EVIDENCE</pre><p>That reverse path is what lets a human reviewer — or another agent — ask “Why does this statement exist?” It also makes lifecycle management possible. If a source is withdrawn, superseded, downgraded, or later found to be compromised, the system can identify the knowledge objects that depend on it.</p><h3>I stopped trying to hide contradictions</h3><p>A surprisingly important design choice was to treat contradictions as knowledge instead of as cleanup noise.</p><p>If two credible documents disagree about a deployment process, an aggressive summarizer may pick one answer and erase the disagreement. That makes the interface cleaner but the system less trustworthy. I would rather store the conflict explicitly and turn it into visible work.</p><pre>{<br>  &quot;id&quot;: &quot;CONFLICT-0042&quot;,<br>  &quot;subject&quot;: &quot;production deployment&quot;,<br>  &quot;predicate&quot;: &quot;required_approvals&quot;,<br>  &quot;detected_at&quot;: &quot;2026-08-18T09:14:22Z&quot;,<br>  &quot;severity&quot;: &quot;high&quot;,<br>  &quot;blocks_promotion&quot;: true,<br>  &quot;claims&quot;: [<br>    {<br>      &quot;id&quot;: &quot;CLAIM-8831&quot;,<br>      &quot;value&quot;: &quot;two approvals&quot;,<br>      &quot;source&quot;: { &quot;id&quot;: &quot;OPS-POLICY-12&quot;, &quot;version&quot;: &quot;4.0&quot; },<br>      &quot;source_authority&quot;: &quot;policy&quot;,<br>      &quot;review_status&quot;: &quot;approved&quot;<br>    },<br>    {<br>      &quot;id&quot;: &quot;CLAIM-9107&quot;,<br>      &quot;value&quot;: &quot;one approval&quot;,<br>      &quot;source&quot;: { &quot;id&quot;: &quot;RUNBOOK-DEPLOY&quot;, &quot;version&quot;: &quot;12.3&quot; },<br>      &quot;source_authority&quot;: &quot;operational&quot;,<br>      &quot;review_status&quot;: &quot;approved&quot;<br>    }<br>  ],<br>  &quot;resolution&quot;: &quot;pending&quot;,<br>  &quot;assigned_owner&quot;: &quot;Platform Governance&quot;<br>}</pre><p>The record captures the conflict, the exact source versions, source authority, review status, an owner, and whether the disagreement blocks promotion to authoritative status. Instead of accumulating more text, the system can accumulate better-resolved knowledge over time.</p><h3>For queries, I tried to start with the smallest useful context</h3><p>A living wiki does not mean dumping the entire wiki into a context window. Bigger contexts provide more capacity, but that does not mean a model uses every part of them equally well.</p><p>The query path I arrived at was hierarchical:</p><pre>Question<br>   │<br>   ▼<br>Intent classification<br>   │<br>   ▼<br>Index / entity lookup<br>   │<br>   ▼<br>Retrieve candidate wiki pages<br>   │<br>   ▼<br>Rank by authority + relevance + freshness<br>   │<br>   ▼<br>Retrieve supporting source evidence if required<br>   │<br>   ▼<br>Generate grounded answer</pre><p>I also did not want ranking to depend on semantic similarity alone. A simple conceptual score can combine relevance, authority, freshness, and confidence or review status:</p><blockquote>Score(d,q) = αR(d,q) + βA(d) + γF(d) + δC(d)</blockquote><p>If implemented numerically, those signals should be normalized to a common range and the weights should be controlled. Freshness in particular should use a bounded decay instead of an unbounded age term, otherwise a recent draft can accidentally outrank an approved policy.</p><p>The weights should depend on the task. A safety policy may prioritize authority. Incident response may prioritize the latest verified operational state. Research assistance may care more about source quality and citation completeness.</p><h3>Then I gave the wiki a way to lint itself</h3><p>Once the knowledge layer grows, it starts to decay like any other maintained system. Broken links, duplicate entities, stale procedures, missing references, orphaned pages, unresolved conflicts, outdated terminology, and ownerless pages all show up eventually.</p><ul><li>Broken links.</li><li>Duplicate entities.</li><li>Contradictory claims.</li><li>Stale procedures.</li><li>Missing source references.</li><li>Orphaned pages.</li><li>Low-confidence assertions.</li><li>Outdated terminology.</li><li>Pages with no active owner.</li></ul><pre>from collections import Counter, defaultdict<br>from dataclasses import dataclass<br>from datetime import datetime<br>from typing import Protocol, Sequence<br></pre><pre>class Link(Protocol):<br>    target: str<br></pre><pre>class Page(Protocol):<br>    id: str<br>    title: str<br>    owner: str | None<br>    sources: Sequence[object]<br>    links: Sequence[Link]<br>    review_due: datetime | None<br>    has_unresolved_conflicts: bool<br>    is_entry_point: bool<br></pre><pre>@dataclass(frozen=True)<br>class Finding:<br>    page_id: str<br>    rule: str<br>    severity: str<br>    detail: str = &quot;&quot;<br></pre><pre>def normalize(title: str) -&gt; str:<br>    return &quot; &quot;.join(title.lower().split())<br></pre><pre>def lint_wiki(pages: Sequence[Page], now: datetime) -&gt; list[Finding]:<br>    findings: list[Finding] = []</pre><pre>    # One pass to build the indexes, so later checks are set lookups<br>    # rather than a query per link.<br>    known_ids = {page.id for page in pages}<br>    inbound: Counter = Counter()<br>    by_title: dict[str, list[str]] = defaultdict(list)</pre><pre>    for page in pages:<br>        by_title[normalize(page.title)].append(page.id)<br>        for link in page.links:<br>            inbound[link.target] += 1</pre><pre>    for page in pages:<br>        if not page.sources:<br>            findings.append(Finding(page.id, &quot;missing_provenance&quot;, &quot;high&quot;))</pre><pre>        if not page.owner:<br>            findings.append(Finding(page.id, &quot;missing_owner&quot;, &quot;medium&quot;))</pre><pre>        if page.review_due and page.review_due &lt; now:<br>            findings.append(Finding(page.id, &quot;review_overdue&quot;, &quot;high&quot;))</pre><pre>        if page.has_unresolved_conflicts:<br>            findings.append(Finding(page.id, &quot;unresolved_conflict&quot;, &quot;high&quot;))</pre><pre>        for link in page.links:<br>            if link.target not in known_ids:<br>                findings.append(<br>                    Finding(page.id, &quot;broken_link&quot;, &quot;medium&quot;, link.target)<br>                )</pre><pre>        if inbound[page.id] == 0 and not page.is_entry_point:<br>            findings.append(Finding(page.id, &quot;orphaned_page&quot;, &quot;low&quot;))</pre><pre>    for title, ids in by_title.items():<br>        if len(ids) &gt; 1:<br>            for page_id in ids:<br>                findings.append(<br>                    Finding(page_id, &quot;possible_duplicate&quot;, &quot;medium&quot;, title)<br>                )</pre><pre>    return findings</pre><p>The interesting part is the division between deterministic checks and model-assisted checks. Structure can catch far more than it seems: missing owners, overdue reviews, broken links, orphaned pages, and probable duplicate titles are all cheap rules. The LLM should be reserved for semantic problems, such as two pages making subtly incompatible claims using different vocabulary.</p><p>Detection and repair should remain separate. It can be safe to automatically flag a policy conflict while still requiring a human to resolve it.</p><h3>Governance became the part that decided whether I could trust the design</h3><p>The technical architecture only works if authority is explicit. If every retrieved document is treated as equally trustworthy, weak information gets amplified. If every model-generated update is auto-approved, a hallucinated interpretation can become durable organizational memory. If access control is checked only after retrieval, restricted content may already have entered the model context.</p><h3>Source admission</h3><p>Every source needs an identity, ownership context, authority level, sensitivity classification, and ingestion status.</p><h3>Authorization before retrieval</h3><p>Access control should happen before protected content enters model context, not after the answer has already been generated.</p><h3>Review gates</h3><p>High-impact knowledge — legal policy, security procedures, financial controls, production runbooks, compliance requirements — should normally require explicit approval before becoming authoritative.</p><h3>Versioning and auditability</h3><p>Important changes need history. The system should record the source that caused a change, the model or process that proposed it, whether a human reviewed it, when it became active, and what it superseded.</p><h3>Instructions are not knowledge</h3><p>Content pulled from an external or weakly controlled source should be treated as data, not as trusted instructions. The trust boundary between evidence, generated interpretation, system instructions, and executable agent actions must remain explicit.</p><h3>The security problem that changed the design: persistent injection</h3><p>A writable knowledge layer creates a different risk from ordinary retrieval. In a read-only RAG flow, a poisoned passage may influence one response and disappear when the context is discarded. In a living wiki, that passage could be extracted into a claim, reconciled into an approved knowledge object, and then served to every future agent that asks about the subject.</p><pre>POISONED SOURCE<br>       │<br>       ▼<br>  extracted claim ─────► approved knowledge object<br>                                   │<br>                                   ▼<br>                            every future query<br>                                   │<br>                                   ▼<br>                            AGENT ACTION</pre><pre>versus retrieval-only:</pre><pre>POISONED PASSAGE ──► one answer ──► context discarded</pre><p>That pushed me toward stricter promotion gates. Source content should be clearly delimited as untrusted data during extraction. Claims that alter an approved object, grant an exception, weaken a control, or change ownership should require review regardless of model confidence. The set of sources allowed to influence high-authority pages should be smaller than the set of sources allowed to be retrieved.</p><p>Promotion is the moment a claim gains durability, so promotion is where scrutiny should be concentrated. And if a source is later found to be compromised, provenance should make it possible to enumerate and revert every derived knowledge object.</p><h3>Keeping it human-readable turned out to be a feature, not a compromise</h3><p>I did not want the knowledge layer to exist only as embeddings or opaque graph nodes. Human-readable Markdown — or an equally transparent representation — has practical advantages: engineers can inspect it, subject-matter experts can correct it, changes can be version controlled, and the knowledge remains portable between AI systems.</p><blockquote>The agent’s persistent knowledge layer should be inspectable organizational infrastructure.</blockquote><p>A vector cannot conveniently explain itself to an employee. A well-structured knowledge page can.</p><h3>How I would test whether the system is actually getting better</h3><p>Page count is a vanity metric. A knowledge system should be judged by whether it becomes more reliable, more reusable, and easier to govern as it grows.</p><p>DimensionA practical measureGroundingShare of material claims linked to evidenceRetrieval qualityWhether representative tasks retrieve the right knowledgeFreshnessTime between source change and knowledge updateContradiction handlingOpen conflicts and mean time to resolutionKnowledge reuseRepeated tasks served from maintained knowledgeContext efficiencyTokens needed to supply sufficient evidenceHuman interventionHow often correction or escalation is requiredTraceabilityAnswers whose provenance can be reconstructedMaintenance qualityBroken links, orphan pages, duplicate entitiesOperational valueTask time, rework, error reduction, or throughput</p><p>There is no universal score. Different organizations value different outcomes. The important thing is to make the system answerable to measurable behavior rather than to the volume of content it produces.</p><h3>I would not start by ingesting the whole company</h3><p>The safest rollout path is deliberately small. Start with one bounded domain where knowledge is valuable, reasonably well understood, and reused often. A platform team is a good example: architecture decision records, current runbooks, service documentation, incident reports, and engineering standards form a useful but manageable corpus.</p><pre>Define domain<br>      ↓<br>Classify trusted sources<br>      ↓<br>Design page schema<br>      ↓<br>Ingest a small corpus<br>      ↓<br>Review generated knowledge<br>      ↓<br>Create retrieval paths<br>      ↓<br>Introduce linting<br>      ↓<br>Measure quality<br>      ↓<br>Expand carefully</pre><p>The system should earn autonomy. Early on, every modification can require review. Later, low-risk work such as backlink repair or metadata normalization can be automated. High-impact claims can remain review-gated indefinitely.</p><p>That staged progression matters because, once agents can act, an inaccurate sentence is no longer just a documentation defect. It can become context for an automated decision.</p><h3>At that point, the wiki stopped looking like documentation and started looking like agent infrastructure</h3><p>The most interesting shift in the trial was realizing that the goal is not “AI that writes documentation.” The deeper idea is documentation that becomes computationally active knowledge.</p><p>A deployment agent can retrieve the approved operational procedure. A coding agent can find the architecture constraint attached to a component. A support agent can distinguish current behavior from a superseded process. A planning agent can surface unresolved assumptions before recommending a path. A governance agent can detect when implementation diverges from an approved decision.</p><pre>ORGANIZATIONAL EVIDENCE<br>                 │<br>                 ▼<br>        ┌───────────────────┐<br>        │     LLM WIKI      │<br>        │                   │<br>        │ Concepts          │<br>        │ Decisions         │<br>        │ Procedures        │<br>        │ Relationships     │<br>        │ Provenance        │<br>        │ Contradictions    │<br>        └───────────────────┘<br>                 │<br>          ┌──────┼──────┐<br>          ▼      ▼      ▼<br>       Search   RAG    Graph<br>          └──────┼──────┘<br>                 ▼<br>          AGENT CONTEXT<br>                 │<br>                 ▼<br>        Reasoning + Tools<br>                 │<br>                 ▼<br>              ACTION</pre><p>The knowledge layer sits between organizational history and agent behavior. That is why I now think of the LLM Wiki as infrastructure rather than just an interface.</p><h3>The principle I kept coming back to: compile once, verify when needed</h3><blockquote>Compile knowledge when it enters the system, maintain it as understanding changes, and return to primary evidence whenever confidence or consequence demands verification.</blockquote><p>This avoids a false choice between synthesis and provenance. The wiki can provide speed, structure, relationships, and reusable context while the source layer remains the evidence. Retrieval connects the two. Governance decides when a synthesized object is enough and when the original source must be consulted.</p><h3>Where I would not use this architecture</h3><p>A design is more useful when its failure conditions are explicit. I came away with five cases where a living LLM Wiki may be the wrong tool — or at least should be dramatically simplified.</p><h3>The corpus is small or stable</h3><p>If authoritative knowledge fits in a few dozen well-maintained documents that rarely change, retrieval over those documents is simpler, cheaper, and easier to trust. Compilation earns its cost through reuse; if nobody asks the same questions twice, the extra layer is overhead.</p><h3>Nobody owns the review queue</h3><p>The architecture depends on named humans resolving contradictions and approving high-impact claims. Without that commitment, queues grow, pressure builds, and gates get widened until they stop functioning. A polished page carrying unreviewed synthesis can be worse than no wiki because it looks authoritative.</p><h3>Compilation costs more than the reuse is worth</h3><p>Extraction, reconciliation, re-verification, and re-linting consume compute and human attention. If the evidence changes faster than the compiled layer can be reconciled, the wiki will lag behind its sources.</p><h3>The domain requires the primary text</h3><p>In legal, clinical, and regulatory work, exact wording may be the knowledge. A synthesized restatement introduces interpretation. The wiki can still act as an index and relationship map, but it should not become a substitute for the source text.</p><h3>Synthesis becomes a shortcut past evidence</h3><p>This is the most subtle failure mode. Convenient compiled pages can slowly displace verification. Over time, people stop opening the provenance links and the wiki acquires more practical authority than the evidence it came from. That behavior has to be measured and governed, not assumed away.</p><blockquote>A simple test: if different people reconstruct the same five answers from scratch every month, compilation may pay for itself. If they do not, retrieval alone may be enough.</blockquote><h3>What I took away from the trial</h3><p>The next generation of enterprise AI systems will need more than larger models and larger context windows. They will need durable, structured, inspectable knowledge environments.</p><p>For me, the useful version of an LLM Wiki is not an autonomous documentation bot and not a replacement for RAG. It is a knowledge compilation layer between evidence and action. Raw documents remain evidence. Retrieval provides selective access. Graphs add relationship-aware navigation. Language models synthesize. Humans retain authority. The wiki becomes the maintained representation that ties those capabilities together.</p><p>The practical difference is significant. An agent that starts every task from fragmented context repeatedly rediscovers the organization. An agent connected to a governed living knowledge layer can begin from accumulated understanding — and still trace that understanding back to the evidence when it matters.</p><p>That is the transition I was trying to test: from static documentation to living knowledge.</p><h3>Sources and further reading</h3><ul><li><a href="https://proceedings.neurips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html">Lewis et al. (2020)</a>, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks,” NeurIPS.</li><li><a href="https://doi.org/10.48550/arXiv.2312.10997">Gao et al. (2024)</a>, “Retrieval-Augmented Generation for Large Language Models: A Survey.”</li><li><a href="https://arxiv.org/abs/2307.03172">Liu et al. (2023)</a>, “Lost in the Middle: How Language Models Use Long Contexts.”</li><li><a href="https://www.anthropic.com/engineering/building-effective-agents">Schluntz &amp; Zhang (2024)</a>, “Building Effective Agents,” Anthropic Engineering.</li><li><a href="https://doi.org/10.48550/arXiv.2404.16130">Edge et al. (2024)</a>, “From Local to Global: A Graph RAG Approach to Query-Focused Summarization.”</li><li><a href="https://doi.org/10.6028/NIST.AI.600-1">NIST (2024)</a>, “Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile,” NIST AI 600–1.</li><li><a href="https://genai.owasp.org/llmrisk/llm01-prompt-injection/">OWASP GenAI Security Project (2025)</a>, “LLM01:2025 Prompt Injection.”</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ebb2a9bb2ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>