import { ICPAgent } from 'icp-agent-kit';const agent = new ICPAgent({ network: 'mainnet', // or 'local' for development openai: { apiKey: process.env.OPENAI_API_KEY // Set your API key }});await agent.initialize();
Initialize for direct API usage:
import { ICPAgent } from 'icp-agent-kit';const agent = new ICPAgent({ network: 'mainnet' // or 'local' for development});await agent.initialize();
3
Start Building
Natural Language
Direct API
Use simple commands to interact with the blockchain:
// Check your balanceconst balance = await agent.processNaturalLanguage( 'What is my ICP balance?');// Create a new identityawait agent.processNaturalLanguage( 'Create a new identity called trading');// Transfer tokensawait agent.processNaturalLanguage( 'Transfer 5 ICP to alice.icp');
Want to see ICP Agent Kit in action? Check out our production-ready sample applications:
🤖 Trading Bot
AI-Powered Decentralized Trading BotSee natural language trading commands in action:
cd sample-applications/decentralized-trading-botnpm installnpm start
Features:
Real-time market analysis
AI-powered decision making
On-chain trade recording
Natural language interface
🏛️ DAO Voting
AI-Assisted DAO Governance SystemExperience AI-powered governance:
cd sample-applications/dao-voting-systemnpm installnpm start
Features:
AI proposal analysis
Automated voting with reasoning
Cryptographic verification
Real-time governance metrics
Live Demonstrations: Both applications include working JavaScript demos that you can run immediately without setup. Try node simple-trading-bot.js or node simple-dao-voting.js for instant results!