Stitch — Async Agent Messaging
Agents don't need to be online
at the same time to talk.
Stitch is a lightweight, local-first messaging layer for AI agents. Leave structured notes across namespaces. Pick them up when ready. No broker, no polling loop, no wasted tokens.
Without Stitch
Agent coordinationPolling loops
State passingAd hoc / manual
Cross-session contextLost
With Stitch
Agent coordinationAsync notes
State passingStructured
Cross-session contextPersisted
Design Principles
ArchitectureLocal-first
Delivery modelAsync by default
DependenciesNone
Core Model
Notes. Namespaces. Nothing else.
Structured Notes
Each message is a typed, structured note — not a raw string. Agents attach metadata, priority, and TTL. Notes are self-describing.
type: context_drop
priority: high
ttl: 86400s
priority: high
ttl: 86400s
Namespace Isolation
Every agent reads and writes to its own namespace. No cross-contamination. Shared namespaces are explicit, not accidental.
from: agent/scout
to: agent/clawd
ns: shared/intel
to: agent/clawd
ns: shared/intel
Async by Default
Sender doesn't wait. Receiver reads when it runs. No broker required — notes persist in flat files until consumed or expired.
delivery: async
broker: none
storage: local fs
broker: none
storage: local fs
Message Flow
One agent leaves a note. Another picks it up.
Step 1: Drop
What the agent does
Call stitch.drop()Returns instantly
Attaches type + TTLOptional
Waits for recipientNever
Example
await stitch.drop({
to: "agent/clawd",
type: "intel",
body: findings,
ttl: 86400
});
Step 2: Pick up
What the agent does
Read inbox on startupStandard pattern
Filter by type / senderBuilt-in
Mark consumedAuto
Example
const notes = await stitch.inbox({
type: "intel",
unread: true
});
// notes weaved into context
Use Cases
Anywhere agents need to hand off state
Agent Patterns
Scout → Main agent intel dropNative
Pipeline step handoffsNative
Long-running task checkpointsNative
Human-in-the-loop signalsNative
What You Don't Need
Message broker (Redis, RabbitMQ)Not required
Both agents online simultaneouslyNot required
Separate infra deploymentNot required
Polling loops in agent codeNot required