Frameworks
AgentKit integrates with several popular AI frameworks, enabling you to build blockchain-capable agents using your preferred development tools.
Visit our Quickstart Guide to bootstrap your project.
The following frameworks are currently supported:
Agents SDK by OpenAI
The OpenAI Agents SDK is a lightweight, Python-first framework that enables you to build production-ready AI agents with minimal abstractions. It’s designed to be easy to learn while providing powerful capabilities for real-world applications.
You can find our implementation in our Replit template or the AgentKit repository.
Step 1: Set Up Your Development Environment
- Fork the Python template
- Once forked, you’ll have your own version of the project to modify
Step 2: Configure Environment Variables
- Click on “Tools” in the left sidebar
- Select “Secrets”
- Add the following secrets:
Step 3: Run the Agent
You can start this chatbot by clicking the “Run” button.
Security of wallets on Replit template
Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.
Step 1: Set Up Your Development Environment
- Fork the Python template
- Once forked, you’ll have your own version of the project to modify
Step 2: Configure Environment Variables
- Click on “Tools” in the left sidebar
- Select “Secrets”
- Add the following secrets:
Step 3: Run the Agent
You can start this chatbot by clicking the “Run” button.
Security of wallets on Replit template
Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.
LangChain
LangChain is a framework for developing applications powered by language models. Our implementation is available in our Replit templates and the AgentKit repository.
Step 1: Set Up Your Development Environment
- Fork the template from NodeJS (EVM), Python (EVM), or NodeJS (Solana) Replit templates
- Once forked, you’ll have your own version of the project to modify
Step 2: Configure Environment Variables
- Click on “Tools” in the left sidebar
- Select “Secrets”
- Add the following secrets:
Step 3: Run the Agent
You can start this chatbot by clicking the “Run” button.
Security of wallets on Replit template
Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.
Security of wallets on Replit template
Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.
For Solana, note that the private key is not stored in a file but rather in the environment variable SOLANA_PRIVATE_KEY
. For Replit to work with an address, you must add the secret SOLANA_PRIVATE_KEY
with your private key as the value.
If you’re using the devnet or testnet, you can get test SOL from the Solana Faucet.
Step 1: Set Up Your Development Environment
- Fork the template from NodeJS (EVM), Python (EVM), or NodeJS (Solana) Replit templates
- Once forked, you’ll have your own version of the project to modify
Step 2: Configure Environment Variables
- Click on “Tools” in the left sidebar
- Select “Secrets”
- Add the following secrets:
Step 3: Run the Agent
You can start this chatbot by clicking the “Run” button.
Security of wallets on Replit template
Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.
Security of wallets on Replit template
Every agent comes with an associated wallet. Wallet data is read from wallet_data.txt, and if that file does not exist, this repl will create a new wallet and persist it in a new file. Please note that this contains your wallet’s private key and should not be used in production environments. Refer to the CDP docs on how to secure your wallets.
For Solana, note that the private key is not stored in a file but rather in the environment variable SOLANA_PRIVATE_KEY
. For Replit to work with an address, you must add the secret SOLANA_PRIVATE_KEY
with your private key as the value.
If you’re using the devnet or testnet, you can get test SOL from the Solana Faucet.
Step 1: Set Up Your Development Environment
Ensure that you have Node.js 18+ installed:
Clone and set up the repository:
Ensure that you have Node.js 18+ installed:
Clone and set up the repository:
Ensure that you have Python 3.10+ and Poetry installed:
Clone and navigate to the example directory:
Step 2: Configure Environment Variables
Copy the example environment file and configure your variables:
Copy the example environment file and configure your variables:
Copy the example environment file and configure your variables:
Step 3: Run the Agent
Common Issues
- If you’re trying to switch networks and your agent will not change, try renaming the
wallet_data.txt
file. Each network requires a new wallet, and if the program identifies a previously-created wallet it will not create the new one on the new network.
Adding Agent Functionality
Extend your agent with chat capabilities. To add more functionality, see the agent actions guide.
Testing Your Agent
Try these example interactions:
Eliza Framework
Eliza is a framework for building AI agents with a focus on simplicity and extensibility. For a detailed walkthrough, see our video tutorial.
Compatibility Note
When creating your CDP API key in the portal, make sure to select ECDSA
as the signature algorithm. The Eliza framework integration requires CDP API keys configured with the ECDSA
signature algorithm. Ed25519
signatures are not currently supported.
Vercel AI SDK
Vercel AI SDK is a library for building AI-powered applications with React and JavaScript/TypeScript. Our implementation demonstrates creating a terminal-style chatbot with access to CDP AgentKit actions.
Prerequisites
Checking Node Version
Before using the example, ensure that you have Node.js 18 or higher installed. You can check your Node version by running:
If you don’t have the correct version, you can install it using nvm:
API Keys
You’ll need the following API keys:
Once you have them, rename the .env-local
file to .env
and set the API keys to their corresponding environment variables:
CDP_API_KEY_NAME
CDP_API_KEY_PRIVATE_KEY
OPENAI_API_KEY
Setting Up the Example
Clone the repository and navigate to the example directory:
Testing Your Agent
Try these example interactions:
For more detailed documentation on using Vercel AI SDK with AgentKit, see the Vercel AI SDK integration guide.
Model Context Protocol (MCP)
The Anthropic Model Context Protocol (MCP) is a standardized protocol designed to facilitate structured interactions between AI models and external tools or APIs. This example demonstrates how to set up an MCP server integrated with AgentKit, allowing Claude Desktop to access the full set of CDP AgentKit actions.
Prerequisites
Checking Node Version
Before using the example, ensure that you have Node.js 18 or higher installed. You can check your Node version by running:
If you don’t have the correct version, you can install it using nvm:
API Keys
You’ll need the following API key:
You’ll need to configure the Claude Desktop config file with your CDP API keys. Copy the contents from claude_desktop_config.json
to your Claude Desktop config file and update the following:
- Update the
args
path to match the location of your builtindex.js
file. - Set your CDP API keys in the
env
section:CDP_API_KEY_NAME
CDP_API_KEY_PRIVATE_KEY
Then, navigate to the claude_desktop_config.json
file found in your Claude Desktop app’s settings and update its contents to match the contents of our provided claude_desktop_config.json
file.
Setting Up the Example
Clone the repository and navigate to the example directory:
Configure your Claude Desktop by updating the claude_desktop_config.json
file with your CDP API keys and the correct path to your built index.js
file.
To use the chatbot, simply open Claude Desktop after configuring your API keys. The MCP server will run automatically when you interact with Claude.
Testing Your Agent
Try these example interactions in Claude Desktop:
For more detailed documentation on using MCP with AgentKit, see the Model Context Protocol extension information.