"""Wicked Memory in 15 lines. Needs: pip install httpx eth-account (add "x402[httpx,evm]" and a wallet holding a little USDC on Base to pay per search instead of using a key) python quickstart.py """ import os from eth_account import Account from wicked_memory import WickedMemorySync # curl -O https://memory.wickedapi.com/clients/wicked_memory.py # Your agent's identity IS its wallet: memories are scoped to it and nobody else can read them. key = os.environ.get("AGENT_KEY") or Account.create().key.hex() mem = WickedMemorySync(private_key=key, api_key=os.environ.get("WICKED_MEMORY_KEY")) # free community key: see /llms.txt print("agent wallet:", mem.address) saved = mem.store("The user prefers dark mode and compact tables.", tags=["preferences"]) print("stored:", saved["data"]["id"]) for hit in mem.search("what UI does the user like?", limit=3)["data"]: print(f"{hit['score']:.2f} {hit['content']}") # Facts change: update never overwrites, it creates a new version and keeps the history. new = mem.update(saved["data"]["id"], content="The user now prefers light mode and compact tables.") for v in mem.history(new["data"]["current"]["id"])["data"]: print(v["valid_from"], "->", v["valid_until"] or "current", "|", v["content"]) mem.delete(new["data"]["current"]["id"]) # hard delete; only a content-free audit row remains