Blackboard
The blackboard is a shared, in-memory key-value store accessible by all agents. It is intended for coordination data that multiple agents need to read and write concurrently.
Unlike Persistent Memory, the blackboard is:
- Shared across all agents (not per-agent)
- In-memory (lost when
agentdrestarts) - Supports TTL for ephemeral coordination state
Reading
ash bb read <agent-id> my-key
The <agent-id> is the agent making the request (used for capability checks and audit).
Writing
ash bb write <agent-id> my-key '{"status": "ready"}'
# With TTL (expires after 60 seconds)
ash bb write <agent-id> lock '{"holder": "agent-abc"}' --ttl 60
Compare-and-Swap
For safe concurrent coordination:
ash bb cas <agent-id> lock '{"holder": "agent-abc"}' '{"holder": "agent-xyz"}'
CAS succeeds only if the current value equals expected. If the key doesn't exist, use null as the expected value:
ash bb cas <agent-id> lock null '{"holder": "agent-xyz"}'
Deleting
ash bb delete <agent-id> my-key
Listing Keys
ash bb list <agent-id>
# With glob filter
ash bb list <agent-id> --pattern "task.*"
Use Cases
- Work queue coordination - agents claim items from a shared task list using CAS
- Distributed locking - agents acquire a lock via CAS before entering a critical section
- Status broadcasting - one agent writes its status; others read it without direct messaging
- Configuration sharing - a root agent writes config; worker agents read it
Example: Distributed Lock
# Agent A tries to acquire a lock
ash bb cas agent-a lock null '"agent-a"'
# If success (lock was unclaimed), agent-a proceeds
# Agent B tries to acquire the same lock
ash bb cas agent-b lock null '"agent-b"'
# Fails if agent-a holds it (current value is not null)
# Agent A releases the lock
ash bb cas agent-a lock '"agent-a"' null