跪拜 Guibai
← All articles
Artificial Intelligence · Agent · LLM

Multi-Agent Teams: Shared Memory vs. Process-Style Isolation

By 泯泷 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Choosing the wrong coordination model will either drown agents in accumulated context or scatter their work across unreadable logs. Mapping agent roles to OS processes and file-permission layers gives a concrete way to reason about isolation, handoffs, and fault containment in production AI workflows.

Summary

Two coordination models dominate multi-agent designs: shared memory and independent processes. Shared memory works like a relay: the next agent inherits the full work log, so no detail is lost, but the log grows until it buries the one who takes over. To keep a handoff consistent, you can replace the entire role specification when permissions or boundaries change, or consult a behavior manual on demand when only knowledge, workflow, or style differ.

Independent processes mirror an operating system: each agent has private memory, and creation, cancellation, and inspection map to fork, kill, and ps. This model isolates failures and runs truly parallel, but it requires a communication contract up front, and debugging means piecing together logs from several departments. Both models ground in a layered file cabinet: private drawers for scratch work, a public desktop with locks for shared artifacts, read-only external drives, and a system tool cabinet. Agents exchange paths, not content, which keeps context light.

The command pipe needs messaging, progress checkpoints, graceful shutdown with child cleanup, and dynamic resource allocation. No model wins outright: shared memory is coherent but thickens, isolation is clean but pays in coordination effort. Choosing which one fits the task's failure pattern is the hard part.

Takeaways
— Shared memory preserves full history but accumulates context until it obscures new work.
— Swap the entire role specification when permissions or hard boundaries change; use a behavior manual for knowledge, process, or style differences.
— Independent agents behave like OS processes: create, cancel, and inspect via fork, kill, and ps, with private memory per agent.
— File-system layers separate private scratch, a locked public desktop, read-only external storage, and a read-only system tool cabinet.
— Agents pass path references, not full content, between memory layers.
— The command channel must support messaging, progress checks, graceful shutdown with child cleanup, and resource allocation.
Conclusions

The OS analogy transfers directly: agent lifetimes and isolation can be managed with the same tools as processes, so decades of systems programming experience apply.

The choice between a full role-spec swap and a behavior manual is a cost-risk tradeoff: re-initialization is expensive but tightens permissions, while manuals are cheap but loosen control.

Passing paths instead of content keeps agent context bounded, avoiding the gradual bloat that kills shared-memory systems.

Multi-agent failures are often communication design problems rather than model quality problems; the article treats them as process and pipe issues.

Concepts & terms
Role specification
A complete definition of an agent's responsibilities, tools, and permissions. Replacing it resets the agent's scope but requires expensive re-initialization.
Behavior manual
A reference document consulted on demand, preserving the role while supplying situational rules at a lower cost and with looser tool permissions.
Public desktop
A shared file area where agents place artifacts for collaboration. It is prone to collisions and therefore uses locks.
From the discussion
Featured comments
咬代码的兽

I deeply relate to the part about working separately relying on communication. Previously I had two agents each write half of a document, and the interface descriptions didn't match. Later I made it a rule to sync context once before starting and it stabilized. I've seen several Chinese practical retrospectives on multi-agent collaboration on ai345, and it's convenient to look up by scenario.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗