@mysten/memwal
v0.0.2
Published
MemWal — Privacy-first AI memory SDK with Ed25519 delegate key auth
Readme
@mysten/memwal
Privacy-first AI memory SDK for storing encrypted memories on Walrus and retrieving them with semantic search.
MemWal is currently in beta and actively evolving. While fully usable today, we continue to refine the developer experience and operational guidance. We welcome feedback from early builders as we continue to improve the product.
Documentation
For full documentation, visit docs.memwal.ai.
Install
pnpm add @mysten/memwalPeer dependencies (install as needed):
pnpm add @mysten/sui @mysten/seal @mysten/walrus ai zodQuick Start
import { MemWal } from "@mysten/memwal";
const memwal = MemWal.create({
key: "your-delegate-key-hex",
accountId: "your-memwal-account-id",
serverUrl: "https://your-relayer-url.com",
namespace: "demo",
});
await memwal.remember("User prefers dark mode and uses TypeScript.");
const memories = await memwal.recall("What are the user's preferences?");
await memwal.restore("demo");If you are self-hosting the relayer and do not have an account ID yet, see Self-Hosting for the account creation and delegate key setup flow.
Exports
| Entry | Description |
|---|---|
| @mysten/memwal | Default client (MemWal). The relayer handles embedding, encryption, Walrus upload/download, retrieval, and restore. |
| @mysten/memwal/manual | Manual client flow (MemWalManual). You handle embedding calls and local SEAL operations. The relayer still handles upload relay, registration, search, and restore. |
| @mysten/memwal/ai | Vercel AI SDK integration - wraps MemWal as middleware for use with streamText, generateText, etc. |
How It Works
- Scope - Each memory operation runs inside an
owner + namespaceboundary - Store - The relayer embeds, encrypts, uploads to Walrus, and stores vector metadata in PostgreSQL
- Recall - The relayer searches by owner plus namespace, resolves matching blobs, and returns plaintext results
- Restore - The relayer can incrementally rebuild missing indexed entries for one namespace
License
Apache 2.0 — see LICENSE
