<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dexter N</title>
    <description>The latest articles on DEV Community by Dexter N (@dextee).</description>
    <link>https://dev.to/dextee</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4073683%2F8112b2a6-9e0e-4fab-8a73-b348f78c4e8c.png</url>
      <title>DEV Community: Dexter N</title>
      <link>https://dev.to/dextee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dextee"/>
    <language>en</language>
    <item>
      <title>Giving a fleet of AI agents one shared memory — when each agent runs a different model</title>
      <dc:creator>Dexter N</dc:creator>
      <pubDate>Tue, 11 Aug 2026 21:05:49 +0000</pubDate>
      <link>https://dev.to/dextee/giving-a-fleet-of-ai-agents-one-shared-memory-when-each-agent-runs-a-different-model-1c4k</link>
      <guid>https://dev.to/dextee/giving-a-fleet-of-ai-agents-one-shared-memory-when-each-agent-runs-a-different-model-1c4k</guid>
      <description>&lt;p&gt;Most agent frameworks give each agent its own context window and call it memory. That works right up&lt;br&gt;
until you run more than one agent, and then it quietly becomes the most expensive design decision in&lt;br&gt;
the system.&lt;/p&gt;

&lt;p&gt;We run a fleet where different agents are deliberately backed by &lt;strong&gt;different models&lt;/strong&gt; — one family&lt;br&gt;
handles long-form drafting, another handles structured extraction, a couple run on a local path with&lt;br&gt;
no external inference at all. Routing by capability is the easy part. The hard part is that an agent&lt;br&gt;
which learns something has learned it &lt;em&gt;alone&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This is a writeup of what broke, and the design we ended up with.&lt;/p&gt;

&lt;h2&gt;
  
  
  The failure mode
&lt;/h2&gt;

&lt;p&gt;The symptom shows up as repeated work.&lt;/p&gt;

&lt;p&gt;An extraction agent determines that a particular vendor's invoices put the tax line above the&lt;br&gt;
subtotal. Useful. Two days later a different agent — different model, different prompt, same&lt;br&gt;
pipeline — hits the same vendor and re-derives it from scratch. Then a third does it again.&lt;/p&gt;

&lt;p&gt;Nothing is &lt;em&gt;wrong&lt;/em&gt;. Every agent behaves correctly. The system as a whole just has no way to&lt;br&gt;
accumulate anything, because knowledge lives inside whichever context window happened to be open at&lt;br&gt;
the time. You are paying inference costs to rediscover facts you already own.&lt;/p&gt;

&lt;p&gt;The naive fix is to pass more history. That fails for a specific reason worth naming: &lt;strong&gt;context&lt;br&gt;
windows are per-invocation and per-model.&lt;/strong&gt; A 200k window on one model does not help an agent&lt;br&gt;
running a different model with a 32k window, and neither survives the session ending. You cannot&lt;br&gt;
solve a persistence problem with a bigger buffer.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "unified memory" has to mean
&lt;/h2&gt;

&lt;p&gt;Once you accept that memory has to live &lt;em&gt;outside&lt;/em&gt; the agents, the requirements get concrete:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Model-agnostic storage.&lt;/strong&gt; If memory is stored as one model's embeddings, you have coupled your
memory layer to a vendor. Swapping models later means reindexing everything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Written by one agent, readable by all.&lt;/strong&gt; Otherwise you have per-agent memory again, with extra
steps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attributable.&lt;/strong&gt; When memory is wrong — and it will be — you need to know which agent, which
session, and when. Un-attributable memory is unfixable memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scoped.&lt;/strong&gt; Not every agent should see everything. A support agent has no business reading
finance context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditable.&lt;/strong&gt; For anything touching regulated work, "the agent knew X" needs to be a claim you
can evidence, not infer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Point 3 is the one people skip, and it is the one that hurts. A shared memory store with no&lt;br&gt;
provenance turns every bad output into an unbounded investigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape we landed on
&lt;/h2&gt;

&lt;p&gt;Two layers, deliberately separated:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;An append-only event log&lt;/strong&gt; is the source of truth. Every memory write is an event with the agent&lt;br&gt;
identity, session identity, channel, and timestamp attached. It is never mutated. If a fact turns&lt;br&gt;
out to be wrong, you append a correction — you do not edit history. This is the layer that makes&lt;br&gt;
point 3 and point 5 possible, and it is boring on purpose.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A derived index&lt;/strong&gt; is what agents actually query. It is rebuilt from the log, which means it is&lt;br&gt;
disposable. Change your embedding model, change your chunking, decide semantic search was the wrong&lt;br&gt;
call for a given path — rebuild the index, the log is untouched.&lt;/p&gt;

&lt;p&gt;The important property is the direction of the dependency. &lt;strong&gt;The index depends on the log. Nothing&lt;br&gt;
depends on the index.&lt;/strong&gt; That is what lets you swap retrieval strategies without a migration, and it&lt;br&gt;
is the difference between "we changed our embedding model" being an afternoon or a quarter.&lt;/p&gt;

&lt;p&gt;Our current implementation runs a document-indexing backend over configured paths with a scheduled&lt;br&gt;
embed cycle, plus session export with a retention window. The specific backend matters much less&lt;br&gt;
than the split — we have changed it once already and the log made that a non-event.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retrieval is a scoping problem, not a search problem
&lt;/h2&gt;

&lt;p&gt;The instinct is to make retrieval smarter. Better embeddings, reranking, hybrid search.&lt;/p&gt;

&lt;p&gt;In practice the wins came from &lt;strong&gt;narrowing what is searchable per agent&lt;/strong&gt; before ranking anything.&lt;br&gt;
An agent asking about invoice formats should not be searching across support transcripts. Not for&lt;br&gt;
quality reasons — for correctness reasons. Cross-domain semantic neighbours are exactly the kind of&lt;br&gt;
plausible-but-wrong context that produces confident nonsense.&lt;/p&gt;

&lt;p&gt;Scope first, then rank. A small correctly-scoped candidate set beats a large well-ranked one, and it&lt;br&gt;
is dramatically cheaper.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we got wrong
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;We stored summaries too early.&lt;/strong&gt; Summarising a session into memory at write time felt efficient&lt;br&gt;
and destroyed the ability to re-derive anything later when we changed our minds about what mattered.&lt;br&gt;
Store the raw event; summarise at read time if you need to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We under-specified identity.&lt;/strong&gt; Early on, "which agent wrote this" meant an agent &lt;em&gt;name&lt;/em&gt;, which we&lt;br&gt;
then renamed. Use a stable identifier that survives renaming, and record the model separately —&lt;br&gt;
you will want to answer "did the model change when the quality dropped?"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We assumed retrieval failures were retrieval failures.&lt;/strong&gt; Most were scoping failures wearing a&lt;br&gt;
costume.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does this actually pay off
&lt;/h2&gt;

&lt;p&gt;Honestly: it depends on fleet size. With one or two agents, per-agent context is fine and this&lt;br&gt;
architecture is overhead you do not need. The crossover came for us somewhere around five or six&lt;br&gt;
agents sharing a domain, where the rediscovery cost and the "why did it do that" investigations&lt;br&gt;
started dominating.&lt;/p&gt;

&lt;p&gt;The clearest signal that you have crossed it: you find yourself explaining the same fact to&lt;br&gt;
different agents, or you cannot answer why an agent produced a given output without reading raw&lt;br&gt;
logs. Both are memory-architecture problems presenting as prompt problems.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;We build and deploy governed AI agents for Singapore businesses at&lt;br&gt;
&lt;a href="https://vyrwork.com" rel="noopener noreferrer"&gt;VYR&lt;/a&gt; — every agent runs with a human approval gate on any action that writes,&lt;br&gt;
sends or pays, plus a full execution log. If you are working on multi-agent memory, I would genuinely&lt;br&gt;
like to compare notes in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>llm</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
