Keeno Corp.

Learned Shared Memory in Agent Swarms

A follow-up to SSM-like Memory in Agent Swarms.

Over the course of November, we have been trying to teach a team of AI agents to use the information that its members learned separately by transmitting that data to an SSM-style shared state for multi-agent collaboration. Each agent sees only its own part of a task. Sometimes the agent asked a question is the one missing the answer. Can a teammate leave enough information in a shared memory for it to answer correctly?

In our original experiment, we started with three agents tracking who was working on which file. Suppose one agent learned that a teammate had taken src/api.py, and was doing work on it. We trained Qwen agents to correctly identify which files were taken by only being told through the shared state.

Our newer model, “P4”, services memory for four agents. The data it trained on was based on a research scenario for a museum. Each agent acts as a researcher - one researcher reads a biography for a museum and learns that its subject was born in Lagos. Another reads a biography for a library and learns that its subject was born in Bozeman. The other two agents have to answer the museum and library questions.

P4: four agents, one shared board

Museum researcherreads a biography: born in Lagos
Library researcherreads a biography: born in Bozeman
Shared boardwritten in small steps as they read
Museum requesteranswers Lagos
Library requesteranswers Bozeman
Each researcher sees only its own biography. The requesters see neither, only the board.

Both models update memory in small steps as they read. In the file experiment, we supplied the filing rule. In P4, we give the agents a common space and train them on whether their answers are right. They have to learn how to record a city together with enough of its context that the museum question brings back Lagos and the library question brings back Bozeman.

What each design demonstrated

The file model answered 94% of multiple-choice coordination questions correctly across three training runs. Reading the full status file yielded 99.9%, and removing shared memory yielded 38%. A single token per file preserved much of what the agents needed to decide who held a file or which file was free.

File model: multiple-choice coordination questions answered correctly

No shared memory

38%

Shared memory, one token per file

94%

Full status file

99.9%
Shared memory averaged across three training runs.

In one P4 development episode, the museum researcher has a biography of Krzysztof Soszynski, born in Stalowa Wola. The library researcher has a biography of Bertha Gifford, born in Morse Mill. Both requesters see excerpts naming both people. To get both cities right, the team has to preserve both facts and retrieve each under the right assignment.

After 5,000 updates, P4 answered 394 of 512 development questions correctly. Both requesters were right in 158 of 256 episodes. A blank board gave zero correct answers. When we replayed each requester with the competing researcher’s writes removed, both answers were right in 192 of 256 episodes. Those 34 extra successes show the trade-off in giving up the file roster. The new model can learn where to find a fact, and even when both facts reach memory, it can still have trouble keeping their uses apart.

P4 after 5,000 updates: episodes with both requesters right

Blank board

0 / 256

P4

158 / 256

P4, competing researcher’s writes removed

192 / 256
Removing the other researcher’s writes adds 34 episodes: both facts reach the board, but they can interfere.

Shared memory outperformed full text on Gemma models

We gave frozen Gemma the text from all four agents, two worked examples from training, and the question for one requester at a time. We counted its first line as the answer so it could get credit for the right city even if it kept writing. P4 used the same base model with its trained memory interface, and we scored its full answer.

Both systems answered the same 252 episodes on a passage check we ran throughout training. P4 got 418 of 504 individual answers right (82.9%), and the text baseline got 179 (35.5%). Getting both cities right in the same episode was harder. P4 did that in 170 of 252 episodes (67.5%), and text did it in 6 (2.4%). In 150 episodes, text gave both requesters the same answer. When we blanked P4’s board on these questions, it got zero of 504 right.

Same 252 episodes: P4 against frozen Gemma reading every agent’s text

Individual answers right

P4

82.9%

Frozen Gemma, all text

35.5%

P4, blank board

0%

Both cities right

P4

67.5%

Frozen Gemma, all text

2.4%
Individual answers: 418 and 179 of 504. Both right: 170 and 6 of 252 episodes. Gemma got two worked examples; its first line counted as the answer.

This comparison tells us how one trained P4 system outperformed against a frozen model prompted with examples. We will follow up with more detail on how our shared state architecture has changed, and given us this boon in results.

For research and partnerships: [email protected]