Akashik Protocol
Reference

createField

Create a new Field — the shared memory surface agents read from and write to.

Signature

import { createField } from '@akashikprotocol/core'

function createField(options?: FieldOptions): Field

type FieldOptions = {
  minIntentLength?: number  // default: 10
}

Options

OptionTypeDefaultDescription
minIntentLengthnumber10Minimum character count for any intent string, after trimming. Setting to 0 is legal but logs a warning on first write.

Returns

A Field instance. All methods on the instance return Promises — the async signature is stable across future storage adapters.

The Field is in-memory

In v0.2, the Field is an in-memory store. All state is lost when the process exits. Persistent storage is planned for v0.3.

Examples

// Default — 10-character minimum intent
const field = createField()

// Custom intent floor
const field = createField({ minIntentLength: 20 })

// No minimum (not recommended — intent quality matters for relevance scoring)
const field = createField({ minIntentLength: 0 })

Notes

  • A single Field can serve an entire application. Use multiple Fields only if you need hard isolation between distinct agent populations.
  • All methods on the returned Field are async. The promise resolves once the operation is complete in the in-memory store.