Shared Memory

How workforce members share context and persist information across conversations.

Team Memory Store

Every workforce has a shared memory scope that all members can read from and write to. This enables agents to pass context, share findings, and maintain state across interactions.

Persistent

Memory persists across conversations within the workforce. Data written today is available tomorrow.

Isolated

Each workforce has its own memory scope. Workforce A cannot read or write to Workforce B's memory.

TTL Support

Optional time-to-live for automatic expiration. Perfect for temporary context or session data.

Memory Operations

Members interact with shared memory using two simple operations:

memory_write(key, value)

Store data in the shared memory under a specified key. Overwrites existing values.

memory_write("lead_info", { name: "Acme Corp", contact: "john@acme.com", status: "qualified" })

memory_read(key)

Retrieve data from shared memory. Returns null if the key doesn't exist.

const lead = memory_read("lead_info") // Returns: { name: "Acme Corp", ... }

Sequence Example

Here's how shared memory enables collaboration between a Sales Agent and CEO Agent:

1

Sales Agent qualifies a lead

memory_write("qualified_lead_acme", {...leadData})
Next conversation turn...
2

CEO Agent checks for updates

const lead = memory_read("qualified_lead_acme")
3

CEO reviews and responds

"Great work! I see Acme Corp has been qualified with a $50k deal size. Let me follow up directly."

Limits & Configuration

SettingValueNotes
Max keys per workforce1,000Older keys are automatically pruned when limit is reached
Max value size64 KBPer key-value pair
Default TTL30 daysConfigurable per write operation
Scope isolationWorkforce-levelNo cross-workforce access

Common Patterns

Handoff Context

Pass context when handing off work between agents.

memory_write("handoff_to_support", { customer: "...", issue: "...", history: [...] })
Shared State

Track progress on multi-step workflows.

memory_write("campaign_status", { phase: "content_review", completed: ["research", "draft"], pending: ["design", "launch"] })
Knowledge Accumulation

Build up context over time from multiple sources.

memory_write("competitor_intel", { ...existingData, [newCompetitor]: findings })
Temporary Flags

Set short-lived markers with custom TTL.

memory_write("urgent_review_needed", true, { ttl: "1h" })