Skip to main content

Quick Start

The Walrus Memory SDK gives your agents portable memory that works across apps, sessions, and workflows. Store, recall, and analyze context, fully under your control. It exposes three entry points:

Entry pointImportWhen to use
MemWal@mysten-incubation/memwalRecommended default for most integrations, relayer handles embeddings, Seal, and storage
MemWalManual@mysten-incubation/memwal/manualYou need client-managed embeddings and local Seal operations
withMemWal@mysten-incubation/memwal/aiYou already use the Vercel AI SDK and want memory as middleware

Installation

$ npm install @mysten-incubation/memwal

For MemWalManual, you also need the optional peer dependencies:

$ npm install @mysten/sui @mysten/seal @mysten/walrus

For withMemWal, you also need:

$ npm install ai zod

Configuration

Before wiring the SDK into your app:

  • These hosted endpoints are provided by Walrus Foundation.
  • Generate a Walrus Memory account ID and delegate private key for your client using the hosted endpoint:
    • Production (Mainnet): https://memory.walrus.xyz
    • Staging (Testnet): https://staging.memory.walrus.xyz
  • Choose a relayer:
    • Use the hosted relayer at https://relayer.memory.walrus.xyz (Mainnet) or https://relayer-staging.memory.walrus.xyz (Testnet)
    • Or deploy your own relayer with access to a wallet funded with WAL and SUI

MemWal.create takes a config object with the following fields:

PropertyTypeRequiredDescription
keystringYesEd25519 private key in hex
accountIdstringYesMemWalAccount object ID on Sui
serverUrlstringNoRelayer URL, use https://relayer.memory.walrus.xyz (Mainnet) or https://relayer-staging.memory.walrus.xyz (Testnet) for the managed relayer
namespacestringNoDefault namespace, falls back to "default"

First memory

import { MemWal } from "@mysten-incubation/memwal";

const memwal = MemWal.create({
key: "<your-ed25519-private-key>",
accountId: "<your-memwal-account-id>",
serverUrl: "https://your-relayer-url.com",
namespace: "demo",
});

await memwal.health();
const job = await memwal.remember("I live in Hanoi and prefer dark mode.");
await memwal.waitForRememberJob(job.job_id);

const result = await memwal.recall({ query: "What do we know about this user?" });
console.log(result.results);

Next steps

  • Usage, all three clients in detail, namespace rules, and restore
  • API Reference, full method signatures and config fields