Akashik Protocol
Specification v0.1.0

Transport Bindings

How Akashik Protocol messages are carried over different communication layers.

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 operationSDK method(s)Notes
REGISTERfield.register()Idempotent on a repeated id — a second call returns the existing session unchanged rather than erroring.
DEREGISTERfield.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 relationfield.retract()Author-only, per RECORD.
RECORD with a supersedes relationfield.supersede()Open to any agent; resolves through an existing supersession chain to the latest link before applying.
ATTUNEfield.attune()
ATTUNE + DETECT (list mode) combinedfield.reckon()Returns { entries, conflicts } in one call — the mechanical detection from DETECT run over the same scoped set attune() would return.
REPLAYfield.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 ToolMaps ToConformance
akashik_registerREGISTER0+
akashik_recordRECORD0+
akashik_attuneATTUNE0+
akashik_detectDETECT1+
akashik_mergeMERGE2+
akashik_replayREPLAY1+
akashik_compactCOMPACT2+
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.

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 StatusMeaning
200 OKOperation succeeded
400 Bad RequestValidation error (e.g., MISSING_INTENT)
401 UnauthorizedAgent not authenticated (Level 2+)
403 ForbiddenInsufficient authority for this operation
404 Not FoundReferenced entity does not exist
409 ConflictState machine violation (INVALID_TRANSITION)
500 Internal Server ErrorINTERNAL_ERROR
507 Insufficient StorageSTORAGE_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.