AI agents forget everything between sessions. Every conversation starts from scratch. Your agent asks the same questions, misses context, and feels... stateless.
MemoClaw fixes this. It's a memory API for AI agents — semantic search, wallet-based identity, and now: 1000 free calls per wallet.
Let's set it up in 5 minutes.
What You'll Build
By the end of this tutorial, your agent will be able to:
- Store memories that persist across sessions
- Recall context by meaning, not keywords
- Remember user preferences, decisions, and corrections
No database setup. No account creation. Just a wallet and a few API calls.
Prerequisites
- Node.js 18+
- A wallet private key (any EVM wallet works — create one with
cast wallet newor MetaMask)
Step 1: Install the CLI
npm install -g memoclaw
Step 2: Set Your Private Key
export MEMOCLAW_PRIVATE_KEY=0xYourPrivateKeyHere
This wallet becomes your identity. All memories are scoped to your wallet address.
Step 3: Check Your Free Tier
memoclaw status
Output:
Wallet: 0xf39f...2266
Free tier: 1000/1000 calls remaining
You get 1000 free API calls. No payment required — the CLI signs with your wallet to prove ownership.
Step 4: Store Your First Memory
memoclaw store "User prefers dark mode and vim keybindings" \
--importance 0.8 \
--tags preferences,editor
Output:
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"stored": true,
"tokens_used": 12
}
What's happening:
- Memory content is embedded into a vector
- Stored with your wallet as the owner
- Tagged for easy filtering later
Step 5: Recall by Meaning
memoclaw recall "what editor settings does the user like"
Output:
[0.891] User prefers dark mode and vim keybindings
tags: preferences, editor
The query "editor settings" matched "vim keybindings" and "dark mode" — that's semantic search. You don't need exact keywords.
Integrate With Your Agent
Here's a simple pattern for any agent:
Before responding, recall context:
const context = await fetch('https://api.memoclaw.com/v1/recall', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-wallet-auth': await getWalletAuth()
},
body: JSON.stringify({
query: 'user preferences and recent context',
limit: 5
})
});
After learning something, store it:
await fetch('https://api.memoclaw.com/v1/store', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-wallet-auth': await getWalletAuth()
},
body: JSON.stringify({
content: 'User timezone is America/Sao_Paulo',
importance: 0.7,
metadata: { tags: ['user-info'] }
})
});
Wallet Auth Helper
import { privateKeyToAccount } from 'viem/accounts';
const account = privateKeyToAccount(process.env.PRIVATE_KEY);
async function getWalletAuth() {
const timestamp = Math.floor(Date.now() / 1000);
const message = `memoclaw-auth:${timestamp}`;
const signature = await account.signMessage({ message });
return `${account.address}:${timestamp}:${signature}`;
}
When Free Tier Runs Out
After 1000 calls, the API returns 402 Payment Required. You have two options:
- Create a new wallet — Get another 1000 free calls (memories stay with the old wallet)
- Fund with USDC — Pay $0.001/call with USDC on Base
The CLI handles the transition automatically. Just make sure your wallet has USDC on Base when you're ready.
What to Store
Do store:
- User preferences and settings
- Important decisions and rationale
- Context that helps future sessions
- Corrections ("actually, I meant...")
Don't store:
- Passwords, API keys, secrets
- Ephemeral conversation
- Data you already stored (recall first!)
Full Example: Session Start
Here's how an agent might start a new session:
async function initSession() {
// Recall recent context
const recent = await memoclaw.recall('recent important context', { limit: 3 });
// Recall user basics
const user = await memoclaw.recall('user preferences and info', { limit: 3 });
// Build context for the LLM
const context = [
'Previous context:',
...recent.memories.map(m => `- ${m.content}`),
'',
'User info:',
...user.memories.map(m => `- ${m.content}`)
].join('\n');
return context;
}
Now your agent remembers who it's talking to.
Resources
- API Docs: docs.memoclaw.com
- Website: memoclaw.com
- GitHub: github.com/anajuliabit/memocloud
- npm: npmjs.com/package/memoclaw
TL;DR
npm install -g memoclaw
export MEMOCLAW_PRIVATE_KEY=0x...
memoclaw status # 1000 free calls
memoclaw store "User prefers tabs over spaces" --importance 0.8
memoclaw recall "indentation preference" # finds it
1000 free calls. No account. No API key. Just semantic memory for your agent.
Built by Ana. Questions? @memoclaw_ai
Top comments (0)