Technical Innovation
Traditional AI Memory Problems
Vector Database Costs:- Pinecone: $70/month for 10M vectors
- Weaviate: $25/month for basic plans
- ChromaDB: $0.20/hour for cloud hosting
- Annual cost: $300-840 per agent system
- Cache invalidation across deployments
- Local storage conflicts between clients
- Memory loss during container restarts
- Inconsistent state between frontend and backend
- Database connection limits
- Vector search performance degradation
- Complex backup and recovery procedures
- Vendor lock-in risks
haus²⁵ On-Chain Solution
Cost Reduction:- IPFS storage: $0.10/GB via Pinata (one-time)
- SEI transactions: ~$0.001 per metadata update
- Total cost: sub-$5/year for 1000 events
- Savings: 100x cost reduction vs traditional vector storage
- Immutable blockchain storage as single source of truth
- Content-addressed IPFS ensures data integrity
- Persistent across all deployments eliminates cache issues
- Universal access from any client or service
- No database connection limits
- Decentralized storage improves global access
- Built-in redundancy through IPFS network
- No vendor lock-in with open protocols
Implementation Architecture
Memory Agent Structure
Core Components: SEI blockchain client with proxy account, Pinata JWT authentication, IPFS gateway configuration. Initializes with planner proxy private key and global whitelist permissions via createWalletClient with seiTestnet and publicActions extension.Iteration Storage Pattern
Data Structure: CurationIteration interface with aspect type, iteration number, original/proposed values, AI rationale, confidence score, timestamp, and source. EventMetadata extends standard NFT metadata with iterations object, status tracking, and curation scope identification. Data Structure:Storage Flow
Key Implementation Details
Iteration Numbering System
Iteration #0: Original creator input automatically stored when first iteration is added with source ‘creator’. Iteration #1: Initial AI plan generated by planner supervisor during /plan endpoint with source ‘ai_plan’. Iteration #2+: Feedback-driven refinements generated via /iterate endpoint with source ‘feedback’ and user feedback included.Metadata Updates via EventManager
Smart Contract Integration: EventManager updateMetadata function with onlyAuthorized modifier, _setTokenURI call, and MetadataUpdated event emission. MemoryAgent uses writeContract with global whitelist permission and transaction receipt confirmation.IPFS Storage Optimization
Upload Pattern: JSON metadata conversion to Blob, FormData construction with file and pinataMetadata (name, keyvalues, cidVersion), POST to Pinata pinning API with Bearer token authentication, returns IPFS hash with ipfs:// prefix.Advanced Features
Iteration Lifecycle Management
Adding Iterations: Retrieves current metadata, initializes iterations structure if needed, stores original creator data as iteration #0, adds new iteration with timestamp and source classification, uploads to Pinata and updates on-chain. Retrieving Iterations: Fetches event metadata and returns iterations for specified aspect or empty object if none exist.Plan Acceptance and Cleanup
Selective Implementation: Retrieves current metadata, applies selected iterations to main metadata fields (title→name, description, banner→image, pricing/schedule→attributes), sets status to ‘accepted’, removes iterations object, uploads final metadata and returns URI.Performance Characteristics
Latency Analysis
Operation Times:- Read metadata: 200-500ms (IPFS gateway)
- Add iteration: 2-4 seconds (IPFS upload + blockchain tx)
- Accept plan: 3-6 seconds (metadata compilation + storage)
Cost Analysis
Per-Event Costs:- IPFS storage: 0.0001)
- SEI transactions: ~$0.001 per update (5-10 updates per event)
- Total per event: $0.005-0.01 for complete curation lifecycle
| Method | Setup Cost | Per-Event Cost | Annual Cost (1000 events) |
|---|---|---|---|
| Pinecone | $70/month | $0.10 | $840 |
| Weaviate | $25/month | $0.05 | $350 |
| ChromaDB | $144/month | $0.20 | $1728 |
| haus²⁵ On-Chain | $0 | $0.01 | $10 |
Related Documentation
- Shared Agents - How Memory Agent integrates with other agents
- System Overview - Overall architecture context
- Delegation and Proxy Patterns - Blockchain permission system