title | sidebar_label |
---|---|
Architecture Explained |
Architecture Explained |
AgentKit is a modular toolkit that allows you to build AI agents that can take actions onchain. It is designed to be:
- Wallet provider agnostic
- Framework agnostic
- Model agnostic
The major components of AgentKit are:
The heart of AgentKit is the "agentkit" package, which provides:
- Common interfaces and classes for "Actions" (small units of functionality)
- Simple configuration layer for API keys and environment variables
- Shared logic for interacting with the CDP Wallet API or any wallet provider
- Exposed interfaces/abstract classes for "Actions" that define:
- Method signatures
- Input schemas
- Operation logic
- To create an agent, you will need to configure AgentKit with API keys and environment variables, and create the AgentKit instance that associates a wallet provider and action providers.
const agentKit = await AgentKit.from({
walletProvider,
actionProviders: [cdp, erc721, pyth, wallet],
});
Built on top of AgentKit Core, these optional packages adapt core actions to specific agent frameworks or workflows. These are primarily what developers will use to build their agents.
These frameworks typically wrap core actions with framework-specific tools, adapt to AI framework plugin interfaces, add "agentic" behaviors for AI model interaction, and handle action discovery and execution.
- cdp-langchain: Deep integration with LangChain Tools (Python and TypeScript)
- farcaster-langchain: Farcaster interaction capabilities
- twitter-langchain: Twitter (X) interaction capabilities
// Integrate with AI framework (e.g., LangChain)
const tools = await getLangChainTools(agentKit);
- Uses Wallet API from Coinbase Developer Platform
- Handles address management, transaction signing, and onchain interactions
TypeScript:
const agentKit = await AgentKit.from({
walletProvider,
actionProviders: [cdp, erc721, pyth, wallet],
});
- Support for alternative wallet providers:
- Hardware wallets
- Browser extension wallets
- Hybrid approaches
- Flexible wallet data import/export for state persistence
Actions are the core unit of functionality in AgentKit.
Each action includes:
- Name: e.g., "transfer", "deploy_token", "farcaster_post_cast"
- Input Schema: Required arguments for the action
- Method: Execution logic, typically interfacing with CDP SDK
- Actions are grouped into logical namespaces:
actions/cdp/defi
: DeFi operationsactions/cdp/social
: Social platform interactions