# @x12i/memorix-sdk

> Memorix Capability SDK — invoke pipelines, implement workers, and agent MCP helpers (via @x12i/memorix-client).

Latest version **1.4.0** (published 2026-09-28) · exellix-license license · 0 weekly downloads

## Install

```sh
npm install @x12i/memorix-sdk
pnpm add @x12i/memorix-sdk
yarn add @x12i/memorix-sdk
bun add @x12i/memorix-sdk
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2026-09-28 |
| First published | 2026-07-29 |
| Weekly downloads | 0 |
| License | exellix-license |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 4 |
| Unpacked size | 57.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | x12i |
| Keywords | x12i, memorix, sdk, pipelines, worker |

## Links

- npm: https://www.npmjs.com/package/@x12i/memorix-sdk
- Repository: https://github.com/x12i/memorix-mono-repo
- Homepage: https://github.com/x12i/memorix-mono-repo#readme
- Issues: https://github.com/x12i/memorix-mono-repo/issues
- npm.io page: https://npm.io/package/@x12i/memorix-sdk

## Dependencies (4)

- [@x12i/core-service](https://npm.io/package/@x12i/core-service.md) ^1.0.0
- [@x12i/memorix-client](https://npm.io/package/@x12i/memorix-client.md) ^3.9.0
- [@x12i/memorix-metadata](https://npm.io/package/@x12i/memorix-metadata.md) ^3.0.3
- [@x12i/memorix-pipeline](https://npm.io/package/@x12i/memorix-pipeline.md) ^3.0.2

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2026-09-28
- 1.3.1 — 2026-09-23
- 1.3.0 — 2026-09-23
- 1.2.3 — 2026-09-23
- 1.2.1 — 2026-09-14
- 1.2.0 — 2026-09-14
- 1.1.0 — 2026-08-02
- 1.0.1 — 2026-07-29
- 1.0.0 — 2026-07-29

## README

# `@x12i/memorix-sdk` — Memorix Capability SDK

**Build multi-step work on Memorix and implement the capabilities it invokes.**

The SDK is the primary developer entry point. Canonical content writes go through `@x12i/memorix-client` `explore.writeContent` (re-exported here), which calls `POST /api/data/content`. Call `ensureMetadata({ pack })` once at process start before the first write.

```bash
npm install @x12i/memorix-sdk@^1.2.3
```

```text
@x12i/memorix-sdk
 ├─ /client     re-exports @x12i/memorix-client (Explore, publications, pipelines, checkpoints, commitPage, getConnection, …)
 ├─ /worker     defineCapability + createMemorixWorker (@x12i/core-service)
 ├─ /authoring  validate/compile pack + pipeline metadata
 └─ /testing    recorded adapters + envelope helpers
```

`@x12i/memorix-client` remains the canonical HTTP foundation underneath `/client`.

For **provider connectors** (source pull / push workflows), use [`@x12i/memorix-connector-sdk`](../memorix-connector-sdk/README.md) — `defineConnector`, workflow steps, and checkpoint-aware `collectStream`.

## Product → pipelines

```ts
import { createMemorixClient } from "@x12i/memorix-sdk/client";

const mx = createMemorixClient({
  baseUrl: "http://127.0.0.1:5100",
  orgId: "sandbox1",
  agentIds: ["opx"],
  caller: "my-app",
});

await mx.ensureMetadata({ pack: myAgentPack }); // once per process start

await mx.explore.writeContent({
  objectType: "people",
  contentType: "raw",
  precondition: "absent",
  record: {
    recordId: "E-10",
    data: { displayName: "Ada" },
    concept: {
      title: "Ada",
      identifiers: { primary: { kind: "recordId", value: "E-10", issuer: "my-app" } },
    },
  },
});

const run = await mx.pipelines.start("knowx-associate", {
  recordId: "PB-2",
});
const completed = await mx.pipelines.wait(run.runId);
const arts = await mx.pipelines.listArtifacts(run.runId);
```

## Called service worker

```ts
import {
  defineCapability,
  createMemorixWorker,
} from "@x12i/memorix-sdk/worker";

const capability = defineCapability({
  serviceId: "knowx-associate",
  operation: "associate",
  capabilities: ["analyze"],
  memorixAccess: ["explore"],
  handler: async (request, context) => {
    const existing = await context.memorix!.explore.listContent({
      objectType: "people",
      contentType: "knowx",
    });
    return { drafts: [{ inputs: request.inputs, existing }] };
  },
});

const worker = createMemorixWorker({ service: capability, port: 0 });
await worker.start();
```

Workers receive a versioned `CapabilityInvocation` (`memorix-capability/1`) with scope, execution metadata, inputs, and an optional `memorix` callback context (including a server-issued grant).

`memorixAccess` may include `"explore"` | `"checkpoints"` | `"raw"`. Callback clients **cannot** call `memory.pull` (operator-only).

## Authoring

```ts
import {
  validatePack,
  compilePipeline,
} from "@x12i/memorix-sdk/authoring";

const compiled = compilePipeline(definition);
// Installation remains an explicit memorix-service operation.
```

## Boundaries

| In SDK | Not in SDK |
|--------|------------|
| Pipeline start/wait/cancel/retry | DAG execution engine |
| Worker HTTP host (`core-service`) | Mongo / db-router |
| Pack validation | Run ledger implementation |
| Callback Explore / raw / checkpoints / `commitPage` | Canonical write ports; operator Memory pull |

`memorix-service` remains the orchestration and persistence plane.

## Docs

- Hub: [https://docs.memorix.x12i.com](https://docs.memorix.x12i.com) · npm `@x12i/memorix-docs`
- Books: Services, Pipelines, Runtime Data Client · use case `bi-dir-callable-service`

---
_Source: https://npm.io/package/@x12i/memorix-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
