Transport Bindings
Overview
The Akashik Protocol is transport-agnostic. Operations MAY be carried over any communication layer as long as the message envelope and operation contracts are respected. This specification defines bindings for three common transports.
Native SDK
Direct API calls in the host language. Lowest latency, full feature support, no serialization overhead.
A native binding does not need to construct the message envelope or the Appendix C JSON shapes internally — those are wire-format requirements for transports that serialize to JSON, such as the HTTP and MCP bindings below. A native binding satisfies the protocol by meeting the same behavioral contracts (mandatory intent, immutable committed units, confidence carried-not-consulted, and so on) through whatever function signatures are idiomatic to its host language.
The following example matches the public API of @akashikprotocol/core v0.3.0, the reference TypeScript implementation, at Level 1:
import { createField } from '@akashikprotocol/core';
const field = createField();
await field.register({ id: 'researcher', role: 'researcher' });
const unit = await field.write({
entry: { topic: 'market-size', finding: 'Market growing at 23% CAGR' },
intent: 'Validate market size assumption for go-to-market strategy',
agent: 'researcher',
});
const context = await field.attune({ agent: 'strategist', topic: 'market-size' });
// reckon: attune + mechanical conflict detection in one call
const result = await field.reckon({ agent: 'strategist', topic: 'market-size' });
console.log(result.conflicts); // conflicts surfaced; resolution is the agent's call
Operation mapping:
| Spec operation | SDK method(s) | Notes |
|---|---|---|
REGISTER | field.register() | Idempotent on a repeated id — a second call returns the existing session unchanged rather than erroring. |
DEREGISTER | field.deregister() | Idempotent on an unknown id. |
RECORD (committed) | field.write() | intent is accepted as a plain string and mapped onto intent.purpose; intent.task_id and intent.question are left unset. |
RECORD (draft) | field.draft() + field.commit() | field.discard() withdraws a draft without committing it. |
RECORD with a retracts relation | field.retract() | Author-only, per RECORD. |
RECORD with a supersedes relation | field.supersede() | Open to any agent; resolves through an existing supersession chain to the latest link before applying. |
ATTUNE | field.attune() | |
ATTUNE + DETECT (list mode) combined | field.reckon() | Returns { entries, conflicts } in one call — the mechanical detection from DETECT run over the same scoped set attune() would return. |
REPLAY | field.replay() | Query fields (entry_id, topic, agent, sinceSeq, untilSeq, followChain) are a valid native-language encoding of target_type/target_id/depth. |
There is no bare READ operation in this specification; a native binding MAY expose one (the reference SDK's field.read()) as an implementation convenience for direct, unranked queries. It carries no protocol obligations beyond the visibility rules ordinary reads already respect.
Characteristics:
- Full feature parity with the specification
- Supports push-based SUBSCRIBE (WebSocket/SSE)
- Supports REPLAY and COMPACT
- Recommended for production deployments
MCP Server Binding
Exposes Akashik operations as Model Context Protocol tools, enabling any MCP-compatible agent to use the protocol without a custom SDK.
Tool Mapping
| MCP Tool | Maps To | Conformance |
|---|---|---|
akashik_register | REGISTER | 0+ |
akashik_record | RECORD | 0+ |
akashik_attune | ATTUNE | 0+ |
akashik_detect | DETECT | 1+ |
akashik_merge | MERGE | 2+ |
akashik_replay | REPLAY | 1+ |
akashik_compact | COMPACT | 2+ |
since_epoch.HTTP REST Binding
A stateless HTTP API for interoperability with any language or platform.
Endpoints
POST /v1/register → REGISTER
POST /v1/deregister → DEREGISTER
POST /v1/record → RECORD
POST /v1/attune → ATTUNE
POST /v1/detect → DETECT
POST /v1/merge → MERGE
POST /v1/replay → REPLAY
POST /v1/compact → COMPACT
POST /v1/subscribe → SUBSCRIBE (returns WebSocket URL for push)
GET /v1/field/status → Field overview and capabilities
GET /v1/agents → List of registered agents
GET /v1/conflicts → Active (unresolved) conflicts
Requirements
All request and response bodies MUST use Content-Type: application/json and conform to the JSON Schema definitions.
HTTP status codes:
| HTTP Status | Meaning |
|---|---|
200 OK | Operation succeeded |
400 Bad Request | Validation error (e.g., MISSING_INTENT) |
401 Unauthorized | Agent not authenticated (Level 2+) |
403 Forbidden | Insufficient authority for this operation |
404 Not Found | Referenced entity does not exist |
409 Conflict | State machine violation (INVALID_TRANSITION) |
500 Internal Server Error | INTERNAL_ERROR |
507 Insufficient Storage | STORAGE_FULL |
WebSocket Push (SUBSCRIBE)
When an agent calls POST /v1/subscribe, the response includes a WebSocket URL:
{
"status": "ok",
"subscription_id": "sub-xyz",
"websocket_url": "wss://field.example.com/v1/ws/sub-xyz"
}
The agent connects to this URL and receives push notification JSON objects as they are emitted by the Field.