
Skill
walrus-memory
integrate persistent memory with Walrus
Description
Walrus Memory (MemWal) — persistent, portable, encrypted memory for AI agents. Use when the user needs to give an AI agent persistent memory across sessions and apps, integrate the @mysten-incubation/memwal TypeScript SDK or Python memwal SDK, set up the Walrus Memory MCP server for Cursor/Claude/Codex, configure remember/recall/analyze/restore operations, manage memory spaces and namespaces, set up delegate keys and accounts, self-host the relayer, or use withMemWal AI middleware (Vercel AI SDK, LangChain, OpenAI SDK). Also use when the user asks about MemWal, Walrus Memory, agent memory, memory spaces, or the memwal-mcp package.
SKILL.md
Walrus Memory
Source constraint: All information in this skill is sourced from the Walrus Memory documentation and the MystenLabs/MemWal repository. When extending this skill, only pull from these sources.
Walrus Memory gives AI agents persistent, portable memory built on Walrus (decentralized storage) and Sui (onchain access control). Memories are Seal-encrypted, stored as blobs on Walrus, and searchable via vector embeddings. The owner controls who can read and write, with delegate keys enabling shared agent access.
Common integration mistakes:
- Forgetting to generate an account ID and delegate key. You need both before the SDK works. Generate them at memory.walrus.xyz.
- Not awaiting async remember jobs.
remember()returns immediately with a job ID. The upload runs in the background. UsewaitForRememberJob()orrememberAndWait()to confirm storage. - Omitting the namespace. Without it, everything goes to
"default". Set a namespace per product surface to isolate memories. - Using the wrong relayer URL. Production (mainnet) is
https://relayer.memory.walrus.xyz. Staging (testnet) ishttps://relayer-staging.memory.walrus.xyz.
Reference files
ts-sdk — TypeScript SDK Reference
Path: ts-sdk.mdLoad when: writing TypeScript code with @mysten-incubation/memwal, using MemWal, MemWalManual, or withMemWal, calling remember/recall/analyze/restore, or debugging SDK errors.
Covers: Installation, three entry points (MemWal, MemWalManual, withMemWal), configuration, full API (remember, rememberAndWait, rememberBulk, recall with RecallParams, analyze, restore, health), lower-level methods, account management, AI middleware integration with Vercel AI SDK.
python-sdk — Python SDK Reference
Path: python-sdk.mdLoad when: writing Python code with the memwal PyPI package, using MemWal, MemWalSync, or with_memwal_langchain/with_memwal_openai middleware.
Covers: Installation, async vs sync clients, env presets (prod/staging), RecallParams, ask method, LangChain and OpenAI middleware, Colab notebook.
mcp — MCP Server Reference
Path: mcp.mdLoad when: setting up Walrus Memory in Cursor, Claude Desktop, Claude Code, Codex, or another MCP client. Also when configuring the memwal-mcp package, debugging login/auth issues, or using Streamable HTTP transport.
Covers: Installation via npx, login flow, client configs (Cursor, Claude Desktop, Claude Code, Codex), six MCP tools, auth-required mode, default namespace, environment switching, Streamable HTTP setup.
Related skills
| Topic | Skill | Load when |
|---|---|---|
| Walrus blob storage | walrus-overview | Understanding Walrus itself |
| Seal encryption | walrus-data-security | How Seal encryption works under the hood |
| Sui Move contracts | sui-move | Understanding the MemWal Move module |
| Troubleshooting | walrus-troubleshooting | General Walrus error messages |
Routing guide
| Task | Load |
|---|---|
| Integrate memory in a TypeScript app | ts-sdk.md |
| Integrate memory in a Python app | python-sdk.md |
| Set up MCP for Cursor / Claude / Codex | mcp.md |
| Understand what Walrus Memory is | Skill Content below |
| Choose an integration path | Skill Content below |
| Manage accounts and delegate keys | ts-sdk.md (account management section) |
| Self-host the relayer | Skill Content below + relayer docs |
| Use AI middleware (Vercel AI SDK) | ts-sdk.md (withMemWal section) |
| Use AI middleware (LangChain / OpenAI) | python-sdk.md |
Skill Content
Key concepts
- Memory space. The isolated unit of storage, uniquely defined by
owner address + namespace + app ID (package ID). Memories in one space never mix with another. Use namespaces to separate concerns (for example,personal,work,research). - Four core operations.
- Remember — store a memory with semantic embedding. Async: returns a job ID immediately.
- Recall — search for memories by natural language query. Returns matches ranked by cosine distance.
- Analyze — extract structured facts from text using an LLM. Each fact is stored as a separate memory.
- Ask — recall + LLM reasoning. Query your memories and get an AI-generated answer.
- Owner and delegates. The owner is the Sui wallet that created the account. Delegates are Ed25519 keypairs granted access by the owner. Delegates can store, recall, and decrypt, but cannot manage keys or transfer ownership. Access is enforced by a Move smart contract on Sui.
- Encryption. All memory content is Seal-encrypted before reaching Walrus. Only the owner and authorized delegates can decrypt. The relayer handles encryption by default, or you can use the manual client flow for full client-side control.
- Relayer. A backend service (Rust + TypeScript sidecar) that handles embedding, encryption, Walrus upload, and vector search behind a REST API. The managed relayer is provided by Walrus Foundation. You can also self-host.
- Restore. If the vector database is lost, the restore flow rebuilds it from Walrus by rediscovering blobs on-chain, decrypting, re-embedding, and re-indexing. Walrus is the permanent source of truth.
Architecture
Your App → SDK → Relayer → { Seal encrypt, Walrus upload, pgvector index }
← { pgvector search, Walrus download, Seal decrypt }
Six components:
- SDK (TypeScript or Python) — signs requests, calls relayer
- Relayer (Rust + TS sidecar) — embedding, encryption, storage, search
- Smart contract (
memwal::accounton Sui) — ownership, delegate keys, Seal access - Indexer — syncs contract events to PostgreSQL for fast lookups
- Walrus — decentralized storage for encrypted blobs
- PostgreSQL + pgvector — vector embeddings for semantic search
Choose your integration path
| Path | When to use |
|---|---|
| MemWal (default SDK) | Most teams. Relayer handles everything. |
| MemWalManual | You need client-side encryption. Relayer never sees plaintext. |
| withMemWal (AI middleware) | You use Vercel AI SDK and want auto-recall + auto-save. |
| Python SDK | Python apps. Same relayer, same auth, mirrors TypeScript API. |
| MCP server | Give Cursor/Claude/Codex memory via MCP tools. No custom code. |
| Self-hosted relayer | Full control of the trust boundary. Your infra, your credentials. |
Account setup
- Go to memory.walrus.xyz (mainnet) or staging.memory.walrus.xyz (testnet)
- Connect your Sui wallet
- Create a Walrus Memory account (one per Sui address)
- Generate a delegate key (Ed25519 keypair)
- Use the
key(private key hex) andaccountId(Sui object ID) in the SDK
Relayer endpoints
| Network | Relayer URL | Dashboard |
|---|---|---|
| Production (Mainnet) | https://relayer.memory.walrus.xyz | https://memory.walrus.xyz |
| Staging (Testnet) | https://relayer-staging.memory.walrus.xyz | https://staging.memory.walrus.xyz |
Contract IDs
| Network | Package ID | Registry ID |
|---|---|---|
| Mainnet | 0xcee7a6fd8de52ce645c38332bde23d4a30fd9426bc4681409733dd50958a24c6 | 0x0da982cefa26864ae834a8a0504b904233d49e20fcc17c373c8bed99c75a7edd |
| Testnet | 0xcf6ad755a1cdff7217865c796778fabe5aa399cb0cf2eba986f4b582047229c6 | 0xe80f2feec1c139616a86c9f71210152e2a7ca552b20841f2e192f99f75864437 |
Rate limits (managed relayer)
| Scope | Limit |
|---|---|
| Per account (burst) | 60 points/minute |
| Per account (sustained) | 500 points/hour |
| Per delegate key | 30 points/minute |
| Storage quota | 1 GB per account |
Point costs: analyze = 10, remember = 5, restore / remember/manual = 3, ask = 2, recall = 1.
Rules
- Generate account ID and delegate key first. The SDK will not work without them. Use the dashboard at
memory.walrus.xyz. - Set a namespace explicitly. Without one, all memories go to
"default". Separate by product surface, environment, or domain. remember()is async. It returns a job ID immediately. UserememberAndWait()or poll withwaitForRememberJob()to confirm storage.- Use the correct relayer URL for your network. Mainnet:
relayer.memory.walrus.xyz. Testnet:relayer-staging.memory.walrus.xyz. - Delegate keys are not wallets. They are Ed25519 keypairs authorized by the owner. They can store and recall but cannot manage the account.
- All content is encrypted. The relayer encrypts with Seal by default. Use
MemWalManualif you need the relayer to never see plaintext. - Walrus is the source of truth. If the database is lost,
restore()rebuilds it from Walrus. The database is an operational cache. - Max 20 delegate keys per account.
Common mistakes
- Calling
recallimmediately afterrememberwithout waiting. The remember job is async. Wait for it to complete before recalling, or the memory will not appear in results. - Using
rememberfor many small facts from a paragraph. Useanalyzeinstead. It extracts individual facts and stores each one separately for more precise recall. - Hardcoding the relayer URL without matching the network. Mainnet accounts do not work on the staging relayer and vice versa.
- Not closing the Python client. Call
await memwal.close()when done to clean up the HTTP client. - Running MCP login in a non-interactive shell. The
logincommand opens a browser. Run it in a real terminal with TTY, not inside an IDE's embedded terminal. - Expecting
restore()to process all blobs at once. It has a configurablelimit(default: 10). Call it multiple times to restore a large memory space.
More skills from the walrus-skills repository
View all 11 skillswalrus-blob-lifecycle
manage Walrus blob lifecycles
Jul 16StorageSuiWeb3walrus-cli
manage Walrus blobs via CLI
Jul 16CLIStorageSuiwalrus-data-security
encrypt and store data on Walrus
Jul 16Access ControlEncryptionSecurityStorage +1walrus-http-api
store and read Walrus blobs via HTTP
Jul 16REST APIStorageSuiWeb3walrus-move-integration
integrate Walrus blobs in Sui Move
Jul 16Smart ContractsStorageSuiwalrus-overview
provide overview of Walrus storage
Jul 16DocumentationStorageSui
More from Sui (Mysten Labs)
View publishermove-bytecode-comprehension
analyze and disassemble Move bytecode
sui
Jul 16Code AnalysisEngineeringSuiofficial-sui-skills
access official Sui development resources
sui
Jul 16DocumentationSuisui-and-move-tools
disassemble Sui Move bytecode
sui
Jul 16Code AnalysisEngineeringSuisui-move-security-review
audit Sui Move smart contracts
sui
Jul 16Code ReviewSecuritySmart ContractsSuimemwal
integrate Walrus Memory SDK
MemWal
Jul 16AgentsMemorySDKaccessing-data
read data from the Sui network
skills
Jul 16Data AnalysisSuiWeb3