Files
open-multi-agent/docs/shared-memory.md
T
Jack Chen caef4b31f1 feat(memory): ship FileStore, a zero-dependency durable MemoryStore (#347)
Zero-dependency, filesystem-backed MemoryStore with atomic fsync+rename
writes, so checkpoint/resume survives a process restart out of the box.
Node built-ins only; recommended as the checkpoint store while shared
memory stays in RAM. Includes load-time hardening that rejects non-object
metadata.

Closes #338
2026-07-01 18:27:03 +08:00

1.2 KiB

Shared Memory

Teams can share a namespaced key-value store so later agents see earlier agents' findings. Enable it with a boolean for the default in-process store:

const team = orchestrator.createTeam('research-team', {
  name: 'research-team',
  agents: [researcher, writer],
  sharedMemory: true,
})

For durable persistence without writing any storage code, pass the bundled FileStore — a zero-dependency, filesystem-backed MemoryStore with atomic writes (see Checkpoint & resume). For cross-process or infrastructure backends (Redis, Postgres, Engram, etc.), implement the MemoryStore interface yourself and pass it via sharedMemoryStore. Keys are still namespaced as <agentName>/<key> before reaching the store:

import type { MemoryStore } from '@open-multi-agent/core'

class RedisStore implements MemoryStore { /* get/set/list/delete/clear */ }

const team = orchestrator.createTeam('durable-team', {
  name: 'durable-team',
  agents: [researcher, writer],
  sharedMemoryStore: new RedisStore(),
})

When both are provided, sharedMemoryStore wins. SDK-only: the CLI cannot pass runtime objects.