Context
Current examples enable sharedMemory: true (examples 02, 03) but the read/write mechanism is invisible to users. No example demonstrates explicit use of SharedMemory.write() / read() / getSummary() or the team.on() event system.
Proposed example: 08-shared-memory.ts
Two agents collaborate through explicit shared memory:
- researcher writes structured findings to SharedMemory
- writer reads from SharedMemory and produces an article
- Print
mem.getSummary() output so users can see what's being shared
- Use
team.on('task:complete', ...) for progress monitoring
APIs to showcase
SharedMemory.write(agentName, key, value)
SharedMemory.read(key)
SharedMemory.getSummary()
team.getSharedMemory()
team.on() event subscriptions
Acceptance criteria
Context
Current examples enable
sharedMemory: true(examples 02, 03) but the read/write mechanism is invisible to users. No example demonstrates explicit use ofSharedMemory.write()/read()/getSummary()or theteam.on()event system.Proposed example:
08-shared-memory.tsTwo agents collaborate through explicit shared memory:
mem.getSummary()output so users can see what's being sharedteam.on('task:complete', ...)for progress monitoringAPIs to showcase
SharedMemory.write(agentName, key, value)SharedMemory.read(key)SharedMemory.getSummary()team.getSharedMemory()team.on()event subscriptionsAcceptance criteria
examples/08-shared-memory.tsnpx tsx examples/08-shared-memory.tsruns successfullynpm run lintpasses