Use this file to discover all available pages before exploring further.
The MemWal Python SDK (memwal on PyPI) gives your app persistent, encrypted memory — store, recall, and analyze context across sessions. It mirrors the TypeScript MemWal client: same relayer, same Ed25519 auth, same methods.
Entry point
Import
When to use
MemWal
from memwal import MemWal
Recommended default — async-native, relayer handles embeddings, SEAL, and storage
MemWalSync
from memwal import MemWalSync
Scripts, notebooks, and non-async apps — same API, runs through asyncio.run()
with_memwal_langchain / with_memwal_openai
from memwal import ...
You already use LangChain or the OpenAI SDK and want memory as middleware
remember returns as soon as the relayer accepts the job (~500ms); the upload + on-chain commit run in the background. Use remember_and_wait to block until it is fully persisted.
import asyncioimport osfrom memwal import MemWalasync def main(): memwal = MemWal.create( key=os.environ["MEMWAL_PRIVATE_KEY"], account_id=os.environ["MEMWAL_ACCOUNT_ID"], env="prod", namespace="demo", ) await memwal.health() await memwal.remember_and_wait("I live in Hanoi and prefer dark mode.") result = await memwal.recall("What do we know about this user?") for memory in result.results: print(memory.text, f"(distance: {memory.distance:.3f})") await memwal.close()asyncio.run(main())
Prefer a synchronous style? Swap MemWal for MemWalSync and drop the awaits — see Usage.