Skip to main content

Quick Start

The fastest way to get Walrus Memory running is through the TypeScript SDK.

  • Node.js v22.23.4+ (or v24.22.1+ or v26.12.1+) or Bun v1+

Install the SDK​

pnpm add @mysten-incubation/memwal

Optional packages

For AI middleware with Vercel AI SDK (@mysten-incubation/memwal/ai):

pnpm add ai

For the manual client flow (@mysten-incubation/memwal/manual):

pnpm add @mysten/sui @mysten/seal @mysten/walrus

Generate your account ID and delegate key​

Create a Walrus Memory account ID and delegate private key for your SDK client using one of the hosted endpoints below.

info

Walrus Foundation provides the following endpoints as a public good.

AppURL
Walrus Memory Playgroundmemory.walrus.xyz

For the contract-based setup flow, see Delegate Key Management and Walrus Memory smart contract.

Choose a relayer​

Use a hosted relayer, or deploy your own self-hosted relayer with access to a wallet funded with WAL and SUI:

info

Walrus Foundation provides the following endpoints as a public good.

NetworkRelayer URL
Production (Mainnet)https://relayer.memory.walrus.xyz
Staging (Testnet)https://relayer.dev.memwal.ai

Configure the SDK​

Set up the SDK with your delegate key, account ID, and relayer URL:

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

const memwal = MemWal.create({
// Load your own credentials from the environment; don't hardcode an example ID.
key: process.env.MEMWAL_KEY ?? "<your-ed25519-private-key>",
accountId: process.env.MEMWAL_ACCOUNT_ID ?? "<your-memwal-account-id>",
serverUrl: "https://relayer.memory.walrus.xyz",
namespace: "my-app",
});

The example reads the account ID you generated from the MEMWAL_ACCOUNT_ID environment variable and passes it as accountId. It reads your delegate private key from the MEMWAL_KEY environment variable and passes it as key. The namespace value, my-app in this example, scopes your memories together with the account ID: recall() searches the memories stored under the same account and namespace.

warning

Use the accountId you generated in the previous step. Recall scope is per account and namespace. Reusing an account ID copied from docs or another project puts your memories in a shared space instead of isolating them to you.

Verify your connection​

Run a health check to confirm everything is working:

await memwal.health();

Store and recall your first memory​

The remember() call returns a job. Pass its job_id to waitForRememberJob() to wait until the job finishes, then call recall() to retrieve the memory:

const job = await memwal.remember("User prefers dark mode and works in TypeScript.");
await memwal.waitForRememberJob(job.job_id);

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

Walrus Memory is now running.

If Walrus Memory is useful to you, a star on the GitHub repository helps others find it.