Purpose-built agents for different ICP blockchain use cases
The ICP Agent Kit provides four specialized agents, each optimized for specific use cases. These agents have access to all tools but provide focused expertise and context-aware responses.
const generalAgent = agent.createAgent('general');// Ask about capabilitiesconst capabilities = generalAgent.getCapabilities();console.log(capabilities);// Mixed operationsawait generalAgent.chat("Check my balance and list my canisters");await generalAgent.chat("Create an identity and deploy a canister");await generalAgent.chat("Help me understand cycles management");
// Information gatheringUser: "What can you help me with?"Agent: "I can help with token operations, canister management, cycles monitoring, and identity management..."// Multi-domain taskUser: "I need to set up a new project"Agent: "I'll help you set up a new project. Let's start by: 1. Creating a dedicated identity 2. Setting up a canister with cycles 3. Preparing for token operations..."
const devAgent = agent.createAgent('developer');// Development queriesawait devAgent.chat("What's the best practice for canister upgrades?");await devAgent.chat("Help me deploy my WASM module");await devAgent.chat("I'm getting an error during deployment");// Get suggestionsconst suggestions = devAgent.getSuggestions();// Returns developer-focused suggestions
// Deployment workflowUser: "I need to deploy my dapp"Agent: "I'll help you deploy your dapp. For development, I recommend: - Using 5T cycles for initial deployment - Setting up proper controller permissions - Testing with small cycles amounts first Let's start by creating a canister..."// Debugging helpUser: "My canister deployment failed"Agent: "Let me help debug the deployment. Common issues include: - Insufficient cycles (need at least 1T) - WASM module size (max 2MB without chunking) - Controller permissions Let's check your canister status first..."
const defiAgent = agent.createAgent('defi');// Token operationsawait defiAgent.chat("I want to transfer tokens efficiently");await defiAgent.chat("Help me manage my token portfolio");await defiAgent.chat("What are the current transfer fees?");// Get DeFi suggestionsconst suggestions = defiAgent.getSuggestions();// Returns finance-focused suggestions
// Transfer guidanceUser: "I need to send ICP to multiple recipients"Agent: "I'll help you with batch transfers. For multiple recipients: - Each transfer has a 0.0001 ICP fee - I'll validate all addresses first - You can include custom memos Who are the recipients and amounts?"// Portfolio checkUser: "Show me all my token balances"Agent: "I'll check your complete token portfolio: - ICP balance: 25.5 ICP - ICRC-1 tokens: Checking registered tokens... - Total portfolio value: ..."
The Governance Agent is specialized for governance operations, including DAO management and proposal analysis.
Fully Implemented: Governance agent is operational with AI-powered proposal analysis and vote casting capabilities, as demonstrated in the DAO voting sample application.
const govAgent = agent.createAgent('governance');// AI-powered proposal analysisconst analysis = await govAgent.chat( "Analyze governance proposal PROP-2024-007 for community fund allocation");// Returns: Detailed analysis with recommendation and confidence score// Vote casting with AI reasoningconst vote = await govAgent.chat( "Cast YES vote on proposal PROP-2024-007 based on analysis");// Returns: Vote confirmation with cryptographic proof// Governance metricsconst metrics = await govAgent.chat( "Show current DAO voting statistics and participation rates");// Returns: Real-time governance analytics and insights// DAO management operationsconst management = await govAgent.chat( "Create new proposal for protocol upgrade with proper documentation");// Returns: Structured proposal creation with validation
See it in Action: Try the DAO Voting System sample application to see the Governance Agent working with real proposal analysis and vote casting.
You can create and use multiple agents in the same session:
Copy
// Start with general explorationconst general = agent.createAgent('general');await general.chat("What do I need to know about ICP?");// Switch to developmentconst dev = agent.createAgent('developer');await dev.chat("Now help me deploy a canister");// Move to financeconst defi = agent.createAgent('defi');await defi.chat("After deployment, help me manage tokens");
Each agent maintains its own conversation context:
Copy
const devAgent = agent.createAgent('developer');// First conversationawait devAgent.chat("I'm building a social dapp");await devAgent.chat("What canister architecture do you recommend?");// Agent remembers you're building a social dapp// Clear context for new conversationdevAgent.clearContext();await devAgent.chat("I need help with a DeFi project");// Fresh context, no memory of social dapp