SUBSCRIBE
Purpose
SUBSCRIBE allows agents to register for updates when relevant changes occur in the Field. Level 1 implementations support polling via since_epoch on ATTUNE. Level 2+ implementations support push-based notifications over WebSocket, SSE, or equivalent.
Conformance Level
Level 1+ (polling via ATTUNE since_epoch)
Level 2+ (push-based subscriptions via SUBSCRIBE operation)
Request
{
"action": "subscribe | unsubscribe | list",
"subscription": {
"id": "<string | null>",
"events": ["<SubscriptionEvent>"],
"min_relevance": "<number | null>",
"debounce_ms": "<number | null>"
}
}
| Field | Required | Description |
|---|---|---|
action | ✓ | "subscribe" to register, "unsubscribe" to remove, "list" to enumerate active subscriptions. |
subscription.id | Provided for unsubscribe. Auto-assigned by Field for new subscriptions. | |
subscription.events | ✓ (for subscribe) | Which event types to subscribe to. |
subscription.min_relevance | Minimum relevance score (0.0–1.0) for push notifications. Below this, events are suppressed. | |
subscription.debounce_ms | Minimum delay between notifications for the same entity. Prevents notification floods. |
Subscription Events
SubscriptionEvent = "memory.recorded" | "memory.superseded" | "memory.contested"
| "conflict.detected" | "conflict.resolved"
| "task.state_changed" | "task.assigned" | "task.completed"
| "handoff.incoming"
| "agent.joined" | "agent.failed"
| "session.paused" | "session.ended"
| Event | Description |
|---|---|
memory.recorded | A new memory unit was committed to the Field |
memory.superseded | A memory unit was marked as superseded |
memory.contested | A memory unit is now involved in an unresolved conflict |
conflict.detected | A new conflict was identified |
conflict.resolved | A conflict was resolved via MERGE |
task.state_changed | A task changed state (Coordination Extension) |
agent.joined | A new agent registered with the Field |
agent.failed | An agent transitioned to failed status |
handoff.incoming | A task is being handed off to this agent |
Push Notification Format (Level 2+)
When the Field pushes a notification to a subscribed agent:
{
"subscription_id": "<string>",
"event": "<SubscriptionEvent>",
"epoch": "<number>",
"relevance_score": "<number>",
"summary": "<string>",
"memory_unit_id": "<string | null>",
"conflict_id": "<string | null>",
"requires_action": "<boolean>"
}
Level 1 Polling Alternative
At Level 1, implementations that do not support push notifications MUST support the since_epoch parameter on ATTUNE. An agent polls for updates by calling ATTUNE with since_epoch set to the epoch returned in its last ATTUNE response.
This provides eventual consistency without requiring a persistent connection.
Behavioral Requirements
Level 2+ The Field MUST store active subscriptions and evaluate new memory units and events against all active subscriptions.
Level 2+ If min_relevance is set, the Field MUST only push events whose relevance to the subscribing agent meets or exceeds that threshold.
Level 2+ If debounce_ms is set, the Field MUST NOT send more than one notification for the same entity within that window.
MCP Limitation MCP's request-response model cannot support real-time SUBSCRIBE push notifications. MCP-connected agents MUST use polling via ATTUNE with since_epoch.
Example
Subscribe to conflict and memory events:
{
"protocol": "akashik",
"version": "0.1.0",
"id": "msg-030",
"operation": "SUBSCRIBE",
"agent_id": "strategist-01",
"session_id": null,
"epoch": 30,
"payload": {
"action": "subscribe",
"subscription": {
"events": ["conflict.detected", "memory.recorded"],
"min_relevance": 0.6,
"debounce_ms": 2000
}
}
}
Response:
{
"status": "ok",
"subscription_id": "sub-xyz789"
}