← sources

Gave 3 research agents a shared memory to cut cost. It saved nothing!!

source: reddit (reddit:AI_Agents)published 2026-10-20 15:08ingested 2026-10-21 02:35

retained text

I run a small governed-agent runtime, one YAML file per agent, a policy gate in front of every tool call, a signed trail. Last week a single agent answered sixteen web-research questions for about 8.70 USD on Sonnet 5.5, nearly all of it page fetches. The obvious next move was three agents in parallel, and the obvious worry was three agents fetching the same pages three times.

So I tried shared memory approach. A shared memory where the first reader stores a digest of a page with its URL and a content hash, and the others ask the memory before they touch the web. I also ordered the prompts so the shared part came first, hoping the prefix cache would serve agents two and three at a tenth of the input price.

Three agents, six questions, two each, a 0.35 USD cap per agent, one run per arm.

Arm A, nothing shared, made 16 fetches, wrote 3.8k output tokens and cost 1.11 USD. Arm B, shared prefix and memory, made 13 fetches, 9 recalls and 6 memory writes, wrote 10.6k output tokens and cost 1.09 USD.

Same cost cap, same six answers. I couldn't see benefits with sharing, and the logs show three reasons. Every recall hit an empty memory, because the agents started six milliseconds apart and wrote their digests at the end of their runs. Nobody read another agent's cached prefix, because three simultaneous first requests all miss, and the harness puts the working directory into the system prompt, one directory per agent. And the digests themselves are output tokens, 2.8 times arm A's.

Code, both tables and the two commands are available in Github QuietFlare/mainsheet/bench(link in the comments)

IMO, None of this is runtime-specific. A graph that runs one reader before the fan-out is the same fix as staggering the starts, and a raw API client owns its prompt where a harness does not.

Has anybody had measurable success with shared memory among subagents?

document fetched 2026-10-21 00:18 · canonical https://reddit.com/r/AI_Agents/comments/1xaunyr/gave_3_research_agents_a_shared_memory_to_cut