Akashik Protocol
Reference

register / deregister

Establish and remove agent sessions in the Field.

register()

Registers an agent with the Field, establishing a session with a declared role. Registration unlocks role-based relevance scoring in attune() and reckon().

Signature

field.register(input: RegisterInput): Promise<RegisterResult>

type RegisterInput = {
  id: string
  role: string
  capabilities?: string[]
}

type RegisterResult = {
  field_capabilities: string[]
  field_protocol_version: string  // wire envelope version, currently "0.2" — independent of SDK/package version
  session_id?: string
}

Parameters

ParameterRequiredDescription
idUnique agent identifier. Must be non-empty and non-whitespace.
roleThe agent's declared role (e.g. 'researcher', 'strategist'). Used for relevance scoring.
capabilitiesAdvisory list of what the agent can do. The Field records it but does not enforce it.

Behavior

  • Re-registering an existing id replaces the previous session.
  • Registration is not required to call write() or read(), but it enables role-based scoring and the ability to set agent on writes in a way the Field recognises.
  • field_capabilities in the response lists the operations and conformance level the Field supports — the full v0.3 operation set, plus "L0" / "L1" level flags and, if a durable adapter is configured, a "durable" flag.

Errors

CodeWhen
AGENT_REQUIREDid or role is missing, empty, whitespace-only, or not a string
INVALID_ENTRYcapabilities is provided but is not an array of strings

Example

const result = await field.register({
  id: 'researcher',
  role: 'researcher',
  capabilities: ['web-search', 'document-analysis'],
})

console.log(result.field_protocol_version) // '0.2' — envelope version, not the SDK version
console.log(result.field_capabilities)
// ['register', 'deregister', 'write', 'read', 'attune', 'reckon',
//  'draft', 'commit', 'discard', 'retract', 'supersede', 'replay',
//  'L0', 'L1']

deregister()

Removes an agent's session from the Field.

Signature

field.deregister(input: { id: string }): Promise<void>

Behavior

  • Idempotent — deregistering an unknown id succeeds silently.
  • The agent's previously written entries remain in the Field after deregistration. They are not deleted or modified.
  • After deregistration, attune() and reckon() calls from that agent id will no longer benefit from registered role matching.

Example

await field.deregister({ id: 'researcher' })
// No error if 'researcher' was already removed