### Harness Setup and Dependency Installation Source: https://github.com/mystenlabs/memwal/blob/dev/services/server/benchmarks/README.md Sets up a Python virtual environment, installs necessary benchmark dependencies, and copies the example configuration file. Edit `config.yaml` to set delegate key, account ID, and judge API key. ```bash cd services/server/benchmarks python3 -m venv .venv && source .venv/bin/activate pip install datasets huggingface_hub openai httpx pynacl numpy pyyaml tabulate tqdm pytest cp config.example.yaml config.yaml # edit config.yaml: delegate_key, account_id, judge.api_key (OpenRouter/OpenAI) ``` -------------------------------- ### Install Dependencies and Run Development Server Source: https://github.com/mystenlabs/memwal/blob/dev/apps/noter/README.md Installs project dependencies, sets up environment variables, generates database tables, and starts the development server. ```bash pnpm install cp .env.example .env # Edit .env with your values pnpm db:push pnpm dev ``` -------------------------------- ### Install Dependencies and Start Docs Server Source: https://github.com/mystenlabs/memwal/blob/dev/docs/contributing/run-docs-locally.md Installs project dependencies and starts the local development server for the documentation site using pnpm. Ensure Node.js 20 LTS is used, as newer versions may cause Mintlify to fail. ```bash npx -p node@20 -c 'node -v' pnpm install pnpm dev:docs ``` -------------------------------- ### Install Dependencies, Migrate Database, and Run Development Server Source: https://github.com/mystenlabs/memwal/blob/dev/apps/chatbot/README.md Installs project dependencies, applies database migrations, and starts the local development server. Ensure your .env.local file is configured with necessary environment variables. ```bash pnpm install pnpm db:migrate # Setup database or apply latest database changes pnpm dev ``` -------------------------------- ### Local Infrastructure Setup Source: https://github.com/mystenlabs/memwal/blob/dev/services/server/benchmarks/README.md Starts the necessary Docker containers for Postgres and Redis, which are required for the server to boot. ```bash docker compose -f services/server/docker-compose.yml up -d ``` -------------------------------- ### Benchmark Harness Setup Source: https://github.com/mystenlabs/memwal/blob/dev/services/server/benchmarks/README.md Sets up a Python virtual environment, installs necessary dependencies, and configures the benchmark harness. Ensure you have Python 3.9+ installed. Edit `config.yaml` with your delegate key, account ID, and OpenRouter API key. ```bash cd services/server/benchmarks # Create venv (Python 3.9+) python3 -m venv .venv source .venv/bin/activate # Install deps directly (don't use pip install -e on Python 3.9) pip install datasets huggingface_hub openai httpx pynacl numpy pyyaml tabulate tqdm pytest # Configure cp config.example.yaml config.yaml # Edit config.yaml: delegate_key, account_id, OpenRouter API key ``` -------------------------------- ### Install memwal SDK Source: https://github.com/mystenlabs/memwal/blob/dev/docs/python-sdk/quick-start.md Install the core memwal Python SDK using pip. This is the recommended starting point for most users. ```bash pip install memwal ``` -------------------------------- ### Configure and Run Relayer Source: https://github.com/mystenlabs/memwal/blob/dev/docs/contributing/run-repo-locally.md Configure the relayer service by copying the example environment file and editing it with your credentials. Then, install sidecar dependencies and run the relayer using Cargo. ```bash # Configure environment cp services/server/.env.example services/server/.env # Edit .env with your credentials # Install sidecar dependencies cd services/server/scripts && npm ci && cd .. # Run the relayer cargo run ``` -------------------------------- ### Synchronous Quick Start with MemWalSync Source: https://github.com/mystenlabs/memwal/blob/dev/packages/python-sdk-memwal/README.md Provides a synchronous example for remembering and recalling data using the MemWalSync client. This version is suitable for applications where asynchronous operations are not required. ```python import os from memwal import MemWalSync, RecallParams client = MemWalSync.create( key=os.environ["MEMWAL_PRIVATE_KEY"], account_id=os.environ["MEMWAL_ACCOUNT_ID"], server_url=os.environ.get("MEMWAL_SERVER_URL", "https://relayer.memory.walrus.xyz"), ) result = client.remember_and_wait("I'm allergic to peanuts") matches = client.recall(RecallParams(query="food allergies")) client.close() ``` -------------------------------- ### Install memwal with all integrations Source: https://github.com/mystenlabs/memwal/blob/dev/docs/python-sdk/quick-start.md Install the memwal SDK with all available integrations. This includes LangChain, OpenAI, and any other optional dependencies. ```bash pip install memwal[all] ``` -------------------------------- ### Start Local Services Source: https://github.com/mystenlabs/memwal/blob/dev/README.md Start specific services for local development using pnpm. ```bash pnpm dev:app pnpm dev:noter pnpm dev:chatbot pnpm dev:researcher ``` -------------------------------- ### Install MemWal SDK with bun Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install the main Walrus Memory SDK package using bun. ```bash bun add @mysten-incubation/memwal ``` -------------------------------- ### Install manual client flow packages with bun Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install packages required for the manual client flow using bun. ```bash bun add @mysten/sui @mysten/seal @mysten/walrus ``` -------------------------------- ### Install Repository Dependencies Source: https://github.com/mystenlabs/memwal/blob/dev/README.md Install all project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Start Server in Benchmark Mode Source: https://github.com/mystenlabs/memwal/blob/dev/services/server/benchmarks/README.md Starts the server after configuring it for benchmark mode. Wait for the confirmation log message indicating that `BENCHMARK_MODE=true` is active and the `PlaintextEngine` is being used. ```bash cd services/server && cargo run ``` -------------------------------- ### Install manual client flow packages with npm Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install packages required for the manual client flow using npm. ```bash npm install @mysten/sui @mysten/seal @mysten/walrus ``` -------------------------------- ### Install Walrus Memory SDK Source: https://github.com/mystenlabs/memwal/blob/dev/README.md Install the main Walrus Memory package using pnpm. ```bash pnpm add @mysten-incubation/memwal ``` -------------------------------- ### Install manual client flow packages with yarn Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install packages required for the manual client flow using yarn. ```bash yarn add @mysten/sui @mysten/seal @mysten/walrus ``` -------------------------------- ### Install MemWal SDK with npm Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install the main Walrus Memory SDK package using npm. ```bash npm install @mysten-incubation/memwal ``` -------------------------------- ### Install Vercel AI SDK with bun Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install the optional Vercel AI SDK package for AI middleware using bun. ```bash bun add ai ``` -------------------------------- ### Install MemWal SDK with yarn Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install the main Walrus Memory SDK package using yarn. ```bash yarn add @mysten-incubation/memwal ``` -------------------------------- ### MemWal.create(config) Source: https://github.com/mystenlabs/memwal/blob/dev/docs/llms-full.txt Initializes a new MemWal instance with the provided configuration. This is the recommended way to start using the MemWal SDK. ```APIDOC ## MemWal.create(config) ### Description Initializes a new MemWal instance with the provided configuration. This is the recommended way to start using the MemWal SDK. ### Method `create(config: MemWalConfig): MemWal` ### Parameters #### Request Body - **config** (MemWalConfig) - Required - Configuration object for MemWal. - **key** (string) - Required - Ed25519 delegate private key in hex. - **accountId** (string) - Required - MemWalAccount object ID on Sui. - **serverUrl** (string) - Optional - Relayer URL. Defaults to `https://relayer.memory.walrus.xyz`. - **namespace** (string) - Optional - Default namespace for memory isolation. Defaults to `"default"`. ``` -------------------------------- ### Install Peer Dependencies Source: https://github.com/mystenlabs/memwal/blob/dev/README.md Install necessary peer dependencies for Walrus Memory using pnpm. ```bash pnpm add @mysten/sui @mysten/seal @mysten/walrus ai zod ``` -------------------------------- ### Install manual client flow packages with pnpm Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install packages required for the manual client flow using pnpm. ```bash pnpm add @mysten/sui @mysten/seal @mysten/walrus ``` -------------------------------- ### Clone Repo and Install Dependencies Source: https://github.com/mystenlabs/memwal/blob/dev/docs/contributing/run-repo-locally.md Clone the MemWal repository and install all necessary project dependencies using pnpm. ```bash git clone https://github.com/CommandOSSLabs/MemWal.git cd MemWal pnpm install ``` -------------------------------- ### Run the Relayer Source: https://github.com/mystenlabs/memwal/blob/dev/docs/relayer/self-hosting.md Steps to copy environment file, install dependencies, and run the relayer using Cargo. ```bash cp services/server/.env.example services/server/.env cd services/server/scripts npm ci cd .. cargo run ``` -------------------------------- ### Install Vercel AI SDK with npm Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install the optional Vercel AI SDK package for AI middleware using npm. ```bash npm install ai ``` -------------------------------- ### Install Vercel CLI Source: https://github.com/mystenlabs/memwal/blob/dev/apps/chatbot/README.md Installs the Vercel Command Line Interface globally. This is a prerequisite for linking your local instance with Vercel and GitHub accounts. ```bash npm i -g vercel ``` -------------------------------- ### Install memwal with OpenAI integration Source: https://github.com/mystenlabs/memwal/blob/dev/docs/python-sdk/quick-start.md Install the memwal SDK with optional OpenAI integration. This enables memwal to function as middleware for OpenAI SDK usage. ```bash pip install memwal[openai] ``` -------------------------------- ### Install Walrus Memory SDK Source: https://github.com/mystenlabs/memwal/blob/dev/SKILL.md Install the Walrus Memory SDK using pnpm. Optional packages for Vercel AI SDK and manual client integration are also listed. ```bash # Install the SDK pnpm add @mysten-incubation/memwal # Optional: for Vercel AI SDK integration pnpm add ai zod # Optional: for manual client (client-side SEAL encryption) pnpm add @mysten/sui @mysten/seal @mysten/walrus ``` -------------------------------- ### Start Server with Debug Logging and Namespace Source: https://github.com/mystenlabs/memwal/blob/dev/packages/mcp/README.md Manually start the Walrus Memory MCP server with debug logging enabled and a specific namespace. Useful for testing namespace injection. ```sh MEMWAL_MCP_DEBUG=1 npx -y @mysten-incubation/memwal-mcp --namespace demo-ns ``` -------------------------------- ### Install memwal with LangChain integration Source: https://github.com/mystenlabs/memwal/blob/dev/docs/python-sdk/quick-start.md Install the memwal SDK with optional LangChain integration. This allows using memwal as middleware within LangChain applications. ```bash pip install memwal[langchain] ``` -------------------------------- ### Example Benchmark Result Files Source: https://github.com/mystenlabs/memwal/blob/dev/services/server/benchmarks/README.md Provides a concrete example of the JSON artifact filenames produced after a specific LME (longmemeval) run. These filenames help identify specific benchmark runs and configurations. ```text mem57-lme-20260520T144014Z-longmemeval-baseline.json mem57-lme-20260520T144014Z-longmemeval-importance_heavy.json mem57-lme-20260520T144014Z-longmemeval-session_map.json ``` -------------------------------- ### Install MemWal SDK Source: https://github.com/mystenlabs/memwal/blob/dev/docs/llms-full.txt Install the MemWal SDK using pnpm. Optional peer dependencies for Vercel AI SDK middleware or manual client-side encryption are also listed. ```bash pnpm add @mysten-incubation/memwal ``` ```bash # For Vercel AI SDK middleware pnpm add ai zod # For manual client (client-side SEAL encryption) pnpm add @mysten/sui @mysten/seal @mysten/walrus ``` -------------------------------- ### Install and Use Memwal LangChain Middleware Source: https://github.com/mystenlabs/memwal/blob/dev/packages/python-sdk-memwal/notebooks/walrus_memory_python_sdk.ipynb Installs the necessary packages and demonstrates how to wrap a LangChain chat model with Memwal's `with_memwal_langchain` function. This allows for memory management in LangChain applications. Ensure environment variables like OPENAI_API_KEY, MEMWAL_PRIVATE_KEY, MEMWAL_ACCOUNT_ID, WALRUS_MEMORY_NAMESPACE, WALRUS_MEMORY_ENV, OPENAI_MODEL, and OPENAI_BASE_URL are set. ```python if RUN_MIDDLEWARE_DEMO: import subprocess import sys subprocess.check_call([ sys.executable, "-m", "pip", "install", "-q", "-U", "memwal[langchain]", "langchain-openai", ]) from langchain_core.messages import HumanMessage from langchain_openai import ChatOpenAI from memwal import with_memwal_langchain read_secret("OPENAI_API_KEY", "Paste OpenAI API key for LangChain demo (hidden): ") llm_kwargs = {"model": OPENAI_MODEL, "api_key": os.environ["OPENAI_API_KEY"]} if OPENAI_BASE_URL: llm_kwargs["base_url"] = OPENAI_BASE_URL llm = ChatOpenAI(**llm_kwargs) smart_llm = with_memwal_langchain( llm, key=os.environ["MEMWAL_PRIVATE_KEY"], account_id=os.environ["MEMWAL_ACCOUNT_ID"], namespace=WALRUS_MEMORY_NAMESPACE, env=WALRUS_MEMORY_ENV, max_memories=5, min_relevance=0.2, ) response = await smart_llm.ainvoke([ HumanMessage(content="Summarize the customer's support context in one sentence.") ]) print(response.content) else: print("LangChain middleware demo skipped. Set RUN_MIDDLEWARE_DEMO=true to run it.") ``` -------------------------------- ### Build the Project Source: https://github.com/mystenlabs/memwal/blob/dev/apps/noter/README.md Run this command to build the project for deployment. ```bash pnpm build ``` -------------------------------- ### Verify MemWal Connection and Tools Source: https://github.com/mystenlabs/memwal/blob/dev/docs/mcp/claude-code.md Verify that MemWal is connected and its tools are available in Claude Code. This check confirms the installation and setup. ```bash /mcp → "memwal" should be Connected ``` -------------------------------- ### Initialize and Use MemWal SDK Source: https://github.com/mystenlabs/memwal/blob/dev/docs/fundamentals/architecture/core-components.md Demonstrates how to create an instance of the MemWal SDK with configuration and perform a 'remember' operation. Ensure environment variables for private key, account ID, and server URL are set. ```typescript const memwal = MemWal.create({ key: process.env.MEMWAL_PRIVATE_KEY!, accountId: process.env.MEMWAL_ACCOUNT_ID!, serverUrl: process.env.MEMWAL_SERVER_URL, namespace: "my-app", }); const job = await memwal.remember("User prefers dark mode."); await memwal.waitForRememberJob(job.job_id); ``` -------------------------------- ### Memwal SDK Quick Start Source: https://github.com/mystenlabs/memwal/blob/dev/packages/sdk/README.md Initialize the Memwal client and perform memory operations like remembering and recalling. Ensure environment variables for key, account ID, and server URL are set. ```typescript import { MemWal } from "@mysten-incubation/memwal"; const memwal = MemWal.create({ key: process.env.MEMWAL_PRIVATE_KEY!, accountId: process.env.MEMWAL_ACCOUNT_ID!, serverUrl: process.env.MEMWAL_SERVER_URL ?? "https://relayer.memory.walrus.xyz", namespace: "demo", }); await memwal.rememberAndWait( "User prefers dark mode and uses TypeScript.", undefined, { timeoutMs: 30_000 }, ); const memories = await memwal.recall({ query: "What are the user's preferences?", topK: 10, maxDistance: 0.7, }); await memwal.restore("demo"); ``` -------------------------------- ### Setup and Use OpenAI Middleware with Memwal Source: https://github.com/mystenlabs/memwal/blob/dev/packages/python-sdk-memwal/notebooks/walrus_memory_python_sdk.ipynb Installs optional dependencies and configures an OpenAI client wrapped with Memwal middleware. This middleware injects relevant Walrus Memory context into chat prompts and can save the latest user message. Requires API keys and specific environment variables to be set. ```python if RUN_MIDDLEWARE_DEMO: import subprocess import sys subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "-U", "memwal[openai]", "openai"]) from openai import AsyncOpenAI from memwal import with_memwal_openai read_secret("OPENAI_API_KEY", "Paste OpenAI API key for middleware demo (hidden): ") openai_kwargs = {"api_key": os.environ["OPENAI_API_KEY"]} if OPENAI_BASE_URL: openai_kwargs["base_url"] = OPENAI_BASE_URL openai_client = AsyncOpenAI(**openai_kwargs) smart_openai = with_memwal_openai( openai_client, key=os.environ["MEMWAL_PRIVATE_KEY"], account_id=os.environ["MEMWAL_ACCOUNT_ID"], namespace=WALRUS_MEMORY_NAMESPACE, env=WALRUS_MEMORY_ENV, max_memories=5, min_relevance=0.2, ) response = await smart_openai.chat.completions.create( model=OPENAI_MODEL, messages=[ { "role": "user", "content": "Use my support memory: what TV issue and appointment window should the agent remember?", } ], max_tokens=160, ) print(response.choices[0].message.content) else: print("OpenAI middleware demo skipped. Set RUN_MIDDLEWARE_DEMO=true to run it.") ``` -------------------------------- ### Async MemWal Client Example Source: https://github.com/mystenlabs/memwal/blob/dev/docs/python-sdk/usage.md Demonstrates the basic usage of the asynchronous MemWal client, including creating a client instance, remembering data, recalling data with parameters, and closing the client. Use this for async-native applications. ```python from memwal import MemWal, RecallParams memwal = MemWal.create(key="...", account_id="0x...", env="prod") done = await memwal.remember_and_wait("User prefers dark mode.") result = await memwal.recall(RecallParams(query="preferences")) await memwal.close() ``` -------------------------------- ### Install Codex hooks for MemWal plugin Source: https://github.com/mystenlabs/memwal/blob/dev/packages/mcp/TESTING.md Steps to install MemWal plugin hooks for Codex. This involves degitting the plugin and running an installation script. Ensure the installation script is run from a persistent directory. ```bash npx degit MystenLabs/MemWal/packages/mcp/plugin /tmp/memwal-plugin node /tmp/memwal-plugin/scripts/install_codex_hooks.mjs ``` -------------------------------- ### MemWalManual Client Setup Source: https://github.com/mystenlabs/memwal/blob/dev/docs/sdk/usage/memwal-manual.md Initialize the MemWalManual client with necessary configuration including private keys, server URLs, API keys, and package details. ```typescript import { MemWalManual } from "@mysten-incubation/memwal/manual"; const manual = MemWalManual.create({ key: "", serverUrl: "https://your-relayer-url.com", suiPrivateKey: "", // OR walletSigner embeddingApiKey: "", packageId: "", accountId: "", namespace: "chatbot-prod", }); ``` -------------------------------- ### Install Walrus Memory Python SDK Source: https://github.com/mystenlabs/memwal/blob/dev/packages/python-sdk-memwal/README.md Install the memwal package using pip. Optional integrations for LangChain, OpenAI, or all packages can be installed using bracket notation. ```bash pip install memwal ``` ```bash pip install memwal[langchain] # LangChain support pip install memwal[openai] # OpenAI SDK support pip install memwal[all] # Everything ``` -------------------------------- ### Install Claude Code plugin from marketplace Source: https://github.com/mystenlabs/memwal/blob/dev/packages/mcp/TESTING.md Commands to add and install the MemWal plugin for Claude Code. After installation, restart Claude Code and potentially log in against the dev relayer for testing. ```bash /plugin marketplace add MystenLabs/MemWal /plugin install memwal@memwal-plugins ``` -------------------------------- ### Download Benchmark Dataset Source: https://github.com/mystenlabs/memwal/blob/dev/services/server/benchmarks/README.md Downloads the specified dataset (e.g., 'locomo') for use in the benchmarks. This is a one-time setup step per benchmark dataset. ```bash python run.py download locomo ``` -------------------------------- ### Install MemWal Python Package Source: https://github.com/mystenlabs/memwal/blob/dev/docs/sdk/overview.md Install the memwal Python package and optional middleware for LangChain and OpenAI. ```bash pip install memwal pip install memwal[langchain] # LangChain middleware pip install memwal[openai] # OpenAI SDK middleware pip install memwal[all] # everything ``` -------------------------------- ### Run Local Docs Development Server Source: https://github.com/mystenlabs/memwal/blob/dev/docs/contributing/docs-workflow.md Starts a local development server to preview documentation changes. Ensure this is run before making significant documentation updates. ```shell pnpm dev:docs ``` -------------------------------- ### Build Documentation Site Source: https://github.com/mystenlabs/memwal/blob/dev/docs/contributing/docs-workflow.md Builds the static documentation site. This command should be run to ensure the documentation is correctly generated before shipping. ```shell pnpm build:docs ``` -------------------------------- ### Install OpenClaw MemWal Plugin Source: https://github.com/mystenlabs/memwal/blob/dev/README.md Install the OpenClaw memory plugin for Walrus Memory using the openclaw CLI. ```bash openclaw plugins install @mysten-incubation/oc-memwal ``` -------------------------------- ### Install MemWal Plugin in Claude Code Source: https://github.com/mystenlabs/memwal/blob/dev/docs/mcp/claude-code.md Install the MemWal plugin after adding its marketplace. This enables automatic memory features. ```bash /plugin install memwal@memwal-plugins ``` -------------------------------- ### Using MemWal as an Async Context Manager Source: https://github.com/mystenlabs/memwal/blob/dev/packages/python-sdk-memwal/README.md Demonstrates how to use the MemWal SDK with an asynchronous context manager. This ensures that the client is properly initialized and closed, simplifying resource management. ```python import os from memwal import MemWal async with MemWal.create( key=os.environ["MEMWAL_PRIVATE_KEY"], account_id=os.environ["MEMWAL_ACCOUNT_ID"], ) as memwal: await memwal.remember_and_wait("I prefer dark mode") ``` -------------------------------- ### Async Quick Start with MemWal Source: https://github.com/mystenlabs/memwal/blob/dev/packages/python-sdk-memwal/README.md Demonstrates asynchronous operations for storing memories, recalling information, and analyzing conversations using the MemWal SDK. It includes waiting for background jobs to complete and closing the client connection. ```python import asyncio import os from memwal import MemWal, RecallParams async def main(): memwal = MemWal.create( key=os.environ["MEMWAL_PRIVATE_KEY"], account_id=os.environ["MEMWAL_ACCOUNT_ID"], server_url=os.environ.get("MEMWAL_SERVER_URL", "https://relayer.memory.walrus.xyz"), ) # Store a memory and wait until the background job is searchable result = await memwal.remember_and_wait("I'm allergic to peanuts") print(result.blob_id) # Recall memories matches = await memwal.recall(RecallParams(query="food allergies", limit=10, max_distance=0.7)) for memory in matches.results: print(f"{memory.text} (relevance: {1 - memory.distance:.2f})") # Analyze conversation for facts and wait until extracted facts are searchable analysis = await memwal.analyze_and_wait("I love coffee and live in Tokyo") for fact in analysis.facts: print(fact.text) await memwal.close() asyncio.run(main()) ``` -------------------------------- ### Initialize MemWal SDK Source: https://github.com/mystenlabs/memwal/blob/dev/SKILL.md Initialize the MemWal SDK with private key, account ID, server URL, and a namespace. Ensure environment variables are set for credentials. ```typescript import { MemWal } from "@mysten-incubation/memwal"; const memwal = MemWal.create({ key: process.env.MEMWAL_PRIVATE_KEY!, accountId: process.env.MEMWAL_ACCOUNT_ID!, serverUrl: process.env.MEMWAL_SERVER_URL ?? "https://relayer.memory.walrus.xyz", namespace: "my-app", }); ``` -------------------------------- ### Run Development Servers Source: https://github.com/mystenlabs/memwal/blob/dev/docs/contributing/run-repo-locally.md Start development servers for different parts of the monorepo. Choose the command based on the component you need to run. ```bash # Docs site (Mintlify) pnpm dev:docs # Demo apps (pick one) pnpm dev:app # Playground dashboard pnpm dev:noter # Note-taking app pnpm dev:chatbot # AI chatbot pnpm dev:researcher # Research assistant # SDK in watch mode (recompiles on changes) pnpm dev:sdk ``` -------------------------------- ### First Memory with MemWal SDK Source: https://github.com/mystenlabs/memwal/blob/dev/docs/llms-full.txt Demonstrates how to initialize the MemWal SDK and store/retrieve a memory. Ensure you have a delegate key, account ID, and relayer URL. ```typescript import { MemWal } from "@mysten-incubation/memwal"; const memwal = MemWal.create({ key: "", accountId: "", serverUrl: "https://relayer.memory.walrus.xyz", 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); ``` -------------------------------- ### Start Local Postgres Database Source: https://github.com/mystenlabs/memwal/blob/dev/apps/status/README.md Use this command to start the local Postgres history database using Docker Compose. ```sh docker compose -f apps/status/docker-compose.yml up -d postgres ``` -------------------------------- ### Initialize MemWal Client Source: https://github.com/mystenlabs/memwal/blob/dev/docs/sdk/usage/memwal.md Create an instance of the MemWal client with your private key, account ID, server URL, and namespace. Ensure you replace placeholder values with your actual credentials. ```typescript import { MemWal } from "@mysten-incubation/memwal"; const memwal = MemWal.create({ key: "", accountId: "", serverUrl: "https://your-relayer-url.com", namespace: "chatbot-prod", }); ``` -------------------------------- ### Committee Key Server Configuration Example Source: https://github.com/mystenlabs/memwal/blob/dev/docs/relayer/self-hosting.md Example of how to configure committee key servers using SEAL_SERVER_CONFIGS. This requires an aggregatorUrl. ```env SEAL_SERVER_CONFIGS=[{"objectId":"0x...","weight":1,"aggregatorUrl":"https://seal-aggregator.example.com"}] ``` -------------------------------- ### Install withMemWal Dependencies with yarn Source: https://github.com/mystenlabs/memwal/blob/dev/docs/sdk/quick-start.md Install dependencies for the withMemWal client using yarn. This client is for use with the Vercel AI SDK. ```bash yarn add ai zod ``` -------------------------------- ### Install withMemWal Dependencies with pnpm Source: https://github.com/mystenlabs/memwal/blob/dev/docs/sdk/quick-start.md Install dependencies for the withMemWal client using pnpm. This client is for use with the Vercel AI SDK. ```bash pnpm add ai zod ``` -------------------------------- ### Initialize MemWal Client and Perform Memory Operations Source: https://github.com/mystenlabs/memwal/blob/dev/docs/examples/example-apps.md Demonstrates creating a MemWal client and performing remember, recall, and analyze operations. This is useful for a full getting-started flow. ```typescript const memwal = MemWal.create({ key: delegateKey, accountId: accountObjectId, serverUrl, namespace, }); const job = await memwal.remember(rememberText); await memwal.waitForRememberJob(job.job_id); await memwal.recall({ query: recallQuery, limit: 5 }); await memwal.analyze(analyzeText); ``` -------------------------------- ### Install withMemWal Dependencies with npm Source: https://github.com/mystenlabs/memwal/blob/dev/docs/sdk/quick-start.md Install dependencies for the withMemWal client using npm. This client is for use with the Vercel AI SDK. ```bash npm install ai zod ``` -------------------------------- ### Copy Nautilus Configuration Templates Source: https://github.com/mystenlabs/memwal/blob/dev/docs/relayer/nautilus-tee.md Copy the example configuration files for Nautilus and runtime environment before making edits. These files serve as templates for your service's configuration. ```bash cp services/server/deploy/nautilus/nautilus.toml.example .nautilus.toml cp services/server/deploy/nautilus/runtime.env.example .env.nautilus ``` -------------------------------- ### Install Vercel AI SDK with yarn Source: https://github.com/mystenlabs/memwal/blob/dev/docs/getting-started/quick-start.md Install the optional Vercel AI SDK package for AI middleware using yarn. ```bash yarn add ai ``` -------------------------------- ### Build the SDK Source: https://github.com/mystenlabs/memwal/blob/dev/README.md Compile the SDK, which is a prerequisite for other applications in the repository. ```bash pnpm build:sdk ``` -------------------------------- ### Create MemWal Client Instance Source: https://github.com/mystenlabs/memwal/blob/dev/docs/python-sdk/usage/memwal.md Instantiate the MemWal client for asynchronous operations. Configure with your private key, account ID, environment (or server URL), and a default namespace. For synchronous operations, use `MemWalSync.create(...)` with the same arguments. ```python from memwal import MemWal, RecallParams memwal = MemWal.create( key="", account_id="", env="prod", # or server_url="https://your-relayer-url.com" namespace="chatbot-prod", ) ```