SpendMate
Zero-code platform to create AI agents that spend safely with rules and limits.
Problem Statement
An easy way to create AI agents that can spend money safely. Our platform lets anyone without technical skills, build an autonomous agent, fund it, and define clear spending rules and limits. Users maintain full control, transparency, and guardrails, making autonomous money management secure and accessible.
Solution
We are building a non-coding management platform for AI agents with integrated blockchain wallet infrastructure. Below is how our system is architected. On the frontend, we use Next.js. The entire application is written in TypeScript for strict type safety. Our UI/UX layer is built on Radix UI primitives, extended with our custom design system using Tailwind CSS. To maintain type-safe component variants, we rely on class-variance-authority, and we use tailwind-merge for composing dynamic classes. For state management, we use TanStack React Query to handle server state, caching, synchronization, and background updates. We complement that with custom React contexts for modals and organization-level state.Blockchain and AI Agent Integration One of the pillars of our system is the Coinbase Developer Platform (CDP). We have integrated @coinbase/agentkit v0.10.3 with a suite of action providers, including: CDP EVM Wallet Provider for automatic wallet creationWETH, ERC20, and Pyth providers for DeFi-related actionsA custom x402ActionProvider that supports payment protocol flowsAn AgentKit–LangChain bridge for AI model connectivityWe support multi-chain operations, focusing on the Base network (mainnet and Sepolia), using viem and wagmi for Ethereum interactions.Database and Backend Architecture Our backend is powered by PostgreSQL and Drizzle ORM, a choice we made for its strong TypeScript inference and lightweight bundle footprint. Our schema includes: A clients table with CDP wallet mappings, per-agent spending policies, and metadataAn activityEvents table for transaction logging and compliance visibilityHandling for numeric precision aligned with crypto conventions (18- and 6-decimal assets)The API layer is organized as RESTful routes with well-defined TypeScript interfaces. One notable endpoint, /api/agent/create-new, provisions new isolated AgentKit instances and automatically issues new CDP wallets on demand.Authentication and Security Authentication is managed through Privy, using @privy-io/react-auth to support Web3-native login, email-based auth, Google OAuth, and embedded wallet creation. This ensures every user, including those without prior crypto experience, can onboard with a functional wallet. Our policy engine enforces daily spending limits, vendor allowlisting, and converts ETH-denominated policies to Wei using viem’s parseEther to maintain precision.Technical Innovations and Engineering Challenges Bundle Optimization We introduced custom Next.js configuration to resolve GraphQL-related dependencies bundled within @coinbase/agentkit, which Next.js does not support by default.Dynamic Agent Provisioning Each AI agent receives a fully isolated CDP wallet with its own spending policy. This required us to build custom persistence strategies and consistent AgentKit initialization flows.Mock Service Layer We implemented a fallback system inside our CdpService. When CDP credentials are not present (for example, in local development), the service provides mock responses, allowing uninterrupted development.Type-Safe Database Enums Using Drizzle’s $type<>() casting, we maintain strict TypeScript safety across all enum-based fields.Development Tooling Our development workflow uses ESLint, Prettier, Husky, lint-staged, and commitlint for conventions and code quality. The project uses Yarn for consistent, fast dependency management.Summary Our platform bridges familiar Web2 interface patterns, forms, tables, dashboards, with Web3 infrastructure for wallets, transactions, and policy control. The result is a clean, intuitive environment for managing AI agents that interact directly with blockchain ecosystems.