<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Melvin McMonagle — Prompt &amp; Error</title>
    <link>https://mcmonagle.eu/en</link>
    <atom:link href="https://mcmonagle.eu/en/rss.xml" rel="self" type="application/rss+xml" />
    <description>A logbook on using AI in software engineering: what an approach really cost in daily use, where it hit its limits and why I abandoned it again. If it saves someone else the same detour, it was worth writing.</description>
    <language>en</language>
    <lastBuildDate>Tue, 01 Sep 2026 21:49:14 GMT</lastBuildDate>
    <item>
      <title>How I built an army of agents and drowned in token garbage</title>
      <link>https://mcmonagle.eu/en/blog/agent-army-token-garbage</link>
      <guid isPermaLink="true">https://mcmonagle.eu/en/blog/agent-army-token-garbage</guid>
      <pubDate>Tue, 01 Sep 2026 09:00:00 GMT</pubDate>
      <description>A specialised multi-agent pipeline for software development — why it worked alarmingly well, and why I scrapped it anyway.</description>
      <category>AI</category>
      <category>Orchestration</category>
      <category>Multi-agent</category>
      <content:encoded><![CDATA[<h2 id="foreword-why-i-am-keeping-this-logbook">Foreword: why I am keeping this logbook</h2>
<p>AI is not going anywhere in our working lives. As many areas as AI touches, that is how many ways there are to use it sensibly and effectively. So what I share here is neither <em>right</em>, nor is it an attempt — as is the custom on LinkedIn these days — to put myself on stage and show off which AI buzzwords I happen to know. My logs are therefore deliberately kept at surface level, without a technical deep dive.</p>
<p>These logs are simply a snapshot. They document a past approach, specific to my own work, for dealing with the ever-accelerating development of AI in software engineering and integrating it into my working day as an actually performant tool.</p>
<p>What I hope for is an exchange: the chance to hear about other approaches, and to learn from one another. Learning and staying current has never been as relevant as it is now.</p>
<h2 id="the-outdated-approach-a-specialised-multi-agent-pipeline">The outdated approach: a specialised multi-agent pipeline</h2>
<p>Over the past months I experimented a lot, like everyone else. In larger projects, growing complexity and the resulting loss of context became the core problem: models hallucinated, wrote syntactically valid but functionally wrong tests for faulty code, produced poor software architecture — all while telling us, for the umpteenth time, that they had now grasped the full picture.</p>
<p>To counter that, I built a structured orchestration pipeline of specialised agents: a complete dev team of agents with firmly assigned roles, working semi-autonomously on real tasks. Its modules break down roughly as follows.</p>
<h3 id="triage-and-data-cleaning">Triage and data cleaning</h3>
<p>Jira tickets were connected and read through MCP (Model Context Protocol) interfaces. An upstream triage agent analysed and cleaned the raw data — filtering out irrelevant comments, formatting debris and historical baggage — and assessed complexity, rough target areas, dependencies and the domains affected (frontend, backend, security).</p>
<p>I always compare this agent to the reception desk in an emergency room: the patient arrives with a bleeding, broken leg, reception filters and documents the problems and sends them to the department that fits.</p>
<h3 id="model-routing-in-a-dag-pipeline">Model routing in a DAG pipeline</h3>
<p>The workflow was modelled as a directed acyclic graph, effectively a state machine. Depending on the sub-task — specification, test authoring, implementation — and its complexity, dynamic routing assigned the appropriate LLM: leaner, faster models for standard work, flagship models only where deep reasoning was genuinely required.</p>
<p>My experience is that hardly any task truly needs the most expensive flagship models, provided the groundwork has been done.</p>
<h3 id="specification-driven-test-development">Specification-driven test development</h3>
<p>A specialised test agent derived concrete test suites from the acceptance criteria. The downstream developer agent received both those tests and the cleaned functional requirements — to prevent pure overfitting to isolated assertions and to ensure that the domain logic was satisfied, not merely the test suite.</p>
<h3 id="automated-feedback-loops-before-review">Automated feedback loops before review</h3>
<p>Before any code reached a human, the output went through an automated checking loop: static type analysis, linters, test runs. Error messages went straight back to the developer agent for self-correction. That way the human in the loop did not have to act as a debugger for syntax errors and could concentrate purely on architectural and functional code review.</p>
<h2 id="why-i-scrapped-it-anyway">Why I scrapped it anyway</h2>
<p>At first glance this sounds genuinely good, and it was in fact alarming how well and how reliably the system worked. But as token costs rose and experience accumulated, the problems grew with them.</p>
<p>The core problem only became truly visible once token costs climbed: exploding <strong>token overhead and context drift</strong>. Every handover between agents required serialising and passing along the previous system state. Endless markdown protocols, uncompressed terminal output (<code>yarn test</code>, stack traces, compiler logs) and redundant file snapshots inflated the context window exponentially. Important earlier instructions were effectively lost to context drift — and the cost per actual delivered change rose at the same rate.</p>
<p>A second issue was <strong>cascading latency</strong>. A workflow of four to six sequential agent steps quickly adds up to several minutes of waiting per ticket. If a detail was missing at an early stage, the error propagated through the entire chain.</p>
<p>But the decisive point that made me rethink the approach was above all the feeling of building an ever more fragile house of cards out of dependencies, costs and coordination.</p>
<h2 id="the-takeaway">The takeaway</h2>
<p>The most important lesson of the past months was to try things even more aggressively — and, above all, to discard them just as aggressively. &quot;Trial and error on steroids&quot;, because that is exactly what AI enables.</p>
<p>That approach led me to my current one (as of September 2026), which I call <strong>control-layer orchestration</strong>. At its core it consists of two parts: a deterministic control layer — plain deterministic code that decides when something is allowed to run — and a stochastic data layer that defines interchangeable specialised units through schemas. I will document the new approach in detail in a follow-up article.</p>
<h2 id="summary">Summary</h2>
<p>Lots of communication between lots of agents is a wonderful way to reach your goal while simultaneously burning an enormous amount of money.</p>
<p>If you have taken similar architectural detours: write to me, let us talk.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
