OpenClaw Integration

A typed TypeScript client package (@zoidmatter/openclaw) that wraps the ZoidMatter HTTP API and exposes it as an OpenClaw skill for injecting memory context into agent system prompts.

Install

npm install @zoidmatter/openclaw

Node >= 18 required (for globalThis.fetch).

Client Usage

import { ZoidMatterClient } from "@zoidmatter/openclaw";

const client = new ZoidMatterClient({
  baseUrl: "http://localhost:8888",
  bankId: "team-a", // optional - omit for the default bank
});

// Retain a memory
await client.retain("The user prefers dark mode", {
  context: "user preferences",
});

// Recall memories
const results = await client.recall("user preferences", { top_k: 5 });
// => [{ id, name, content, memory_type, score }, ...]

// Check architectural invariants
const invariants = await client.invariantCheck("my-project");

// Reflect on memories
const reflection = await client.reflect("What do I know?", {
  max_tokens: 1024,
});

OpenClaw Skill

// .clawffice/skills/zoidmatter.ts
import zoidmatterSkill from "@zoidmatter/openclaw/skill";
export default zoidmatterSkill;