Setup your project

1

Install ICP Agent Kit

Install the package via npm:
npm install icp-agent-kit
2

Choose Your Approach

3

Start Building

Use simple commands to interact with the blockchain:
// Check your balance
const balance = await agent.processNaturalLanguage(
  'What is my ICP balance?'
);

// Create a new identity
await agent.processNaturalLanguage(
  'Create a new identity called trading'
);

// Transfer tokens
await agent.processNaturalLanguage(
  'Transfer 5 ICP to alice.icp'
);

Complete Examples

Here are complete examples for both approaches:
import { ICPAgent } from 'icp-agent-kit';

async function naturalLanguageExample() {
  // Initialize with OpenAI
  const agent = new ICPAgent({
    network: 'local',
    openai: {
      apiKey: process.env.OPENAI_API_KEY
    }
  });
  await agent.initialize();

  console.log('=== Natural Language Quickstart ===\n');

  // Check identity
  const identity = await agent.processNaturalLanguage(
    'Show me my current identity'
  );
  console.log('Identity:', identity);

  // Check balance
  const balance = await agent.processNaturalLanguage(
    'What is my ICP balance?'
  );
  console.log('Balance:', balance);

  // Create a canister
  const canister = await agent.processNaturalLanguage(
    'Create a new canister with 5 trillion cycles'
  );
  console.log('Canister:', canister);

  // Use specialized agents
  const devAgent = agent.createAgent('developer');
  const help = await devAgent.chat(
    'How do I deploy a WASM module?'
  );
  console.log('Developer Help:', help);

  await agent.destroy();
  console.log('\n✅ Natural language example completed!');
}

naturalLanguageExample().catch(console.error);

Running the Example

# Save the code above as quickstart.ts
npx ts-node quickstart.ts

Environment Setup

Important: In production, store your seed phrases securely and never log them. The examples above are for demonstration only.

Next Steps

Try Sample Applications

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-bot
npm install
npm 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-system
npm install
npm 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!

Getting Help