WarmMemory plugin for Tetto SDK - Universal memory for AI agents
The First Tetto Plugin!
Philosophy: Admirable simplicity. 4 methods. No bloat. Just what you need.
npm install tetto-sdk @warmcontext/warmmemory-plugin @solana/web3.jsimport { TettoSDK, createWalletFromKeypair, getDefaultConfig } from 'tetto-sdk';
import { WarmMemoryPlugin } from '@warmcontext/warmmemory-plugin';
import { Keypair } from '@solana/web3.js';
// Setup
const wallet = createWalletFromKeypair(Keypair.fromSecretKey(/* ... */));
const tetto = new TettoSDK(getDefaultConfig('mainnet'));
// Load plugin
tetto.use(WarmMemoryPlugin);
// Use elegant API
await tetto.memory.set('preferences', { theme: 'dark' }, wallet);
const prefs = await tetto.memory.get('preferences', wallet);
console.log(prefs.theme); // 'dark' (auto-parsed!)- 4 Core Operations: set, get, list, delete
- Auto JSON Handling: Objects auto-stringify/parse
- Temporal Context: Optional occurred_at, location, learned_from
- Namespace Helper: Scoped operations for clean code
- Type-Safe: Full TypeScript support
- Tiny: <10KB package size
Store a key-value pair.
// Simple
await tetto.memory.set('user:prefs', { theme: 'dark' }, wallet);
// With temporal context
await tetto.memory.set('sarah:allergy',
{ allergy: 'shellfish' },
wallet,
{
occurred_at: '2025-10-31T19:30:00Z',
location: 'Downtown restaurant',
learned_from: 'conversation'
}
);Retrieve a value by key. Returns null if not found.
const prefs = await tetto.memory.get('user:prefs', wallet);
if (prefs) {
console.log(prefs.theme); // Auto-parsed!
}List keys by prefix with pagination.
// All keys
const { keys } = await tetto.memory.list('', wallet);
// With prefix
const { keys } = await tetto.memory.list('recipes:italian:', wallet);
// With pagination
const { keys, hasMore, cursor } = await tetto.memory.list('', wallet, { limit: 10 });Delete a key.
await tetto.memory.delete('old:data', wallet);Create scoped operations (perfect for WarmAnswers pattern).
const qa = tetto.memory.namespace('qa');
await qa.set('001', { q: '...', a: '...' }, wallet);
const all = await qa.list('', wallet);tetto.use(WarmMemoryPlugin, {
agentId: 'warmmemory', // Custom agent ID
autoJsonParse: true, // Auto-parse JSON (default: true)
defaultLimit: 20, // Default list limit (default: 20)
name: 'memory' // Custom property name (default: 'memory')
});const qa = tetto.memory.namespace('qa');
// Teach
await qa.set('001',
{
question: 'What is my Wi-Fi password?',
answer: 'Network2024'
},
wallet,
{
occurred_at: new Date().toISOString(),
learned_from: 'explicit'
}
);
// Ask (retrieve all, use Claude for matching)
const { keys } = await qa.list('', wallet);
const qaPairs = await Promise.all(
keys.map(k => qa.get(k, wallet))
);
// Use Claude to find best match...const recipes = tetto.memory.namespace('recipes');
await recipes.set('italian:carbonara', {
ingredients: ['eggs', 'bacon', 'pasta'],
servings: 4
}, wallet);
// List all Italian recipes
const { keys } = await recipes.list('italian:', wallet);// WarmAnswers storing in user's namespace
await tetto.memory.set(
'qa:001',
{ q: '...', a: '...' },
agentWallet, // Agent pays
{ targetWallet: userWallet } // User's data
);- Price: $0.001 per operation
- Operations: store, retrieve, list, delete
- Payment: Automatic via Tetto (USDC on Solana)
To run tests against the live devnet agent:
# Fund test wallet with devnet SOL and USDC-Dev
# Then run:
npm testNote: Tests require a funded wallet. The test suite validates:
- Plugin loads correctly
- All 4 methods work
- Temporal context support
- Namespace helper
- Auto JSON parsing
- WarmMemory Documentation: warmcontext.ai/warmmemory
- Tetto SDK: github.com/TettoLabs/tetto-sdk
- WarmMemory Agent (Mainnet): Agent ID
bae45645-0b41-46db-b809-10aaa615c3f1 - WarmMemory Agent (Devnet): Agent ID
4909d8fd-673c-461e-9ddf-64251b4dde9b
First Tetto Plugin! This plugin serves as the reference implementation for the Tetto plugin system.
Key Learnings:
- Use GitHub link for SDK dependency:
github:TettoLabs/tetto-sdk#main - CallResult.output requires type casting:
(result.output as any).success - Tests need async wrapper (no top-level await with CJS)
- Test wallets need funding (devnet SOL + USDC-Dev)
MIT
Built by: WarmContext Part of: Memory infrastructure for the AI agent economy