This repository demonstrates the usage of Coinbase Developer Platform (CDP) Agentkit and related tools to build autonomous blockchain agents. These agents can interact with on-chain environments, perform blockchain-specific tasks, and respond intelligently to user requests. The project showcases integrations with LangChain, a powerful AI framework, to enable seamless natural language interactions.
Built with references from this project
- Blockchain Agent: Interact with on-chain environments using CDP's tools.
- Autonomous Mode: Run the agent autonomously with periodic blockchain interactions.
- Customizable Configuration: Modify LLM (Large Language Model) configurations, network settings, and tools.
- Simulated Blockchain Actions: Demonstrate balance checking, transactions, and other common blockchain tasks.
- Memory Persistence: Store conversation history for continuity across interactions.
- Node.js: >=18.x
- NPM or Yarn: Latest version recommended
- Fleek Account
- CDP Account
- xAI Account
- Environment variables:
- VITE_XAI_API_KEY
- VITE_NETWORK_ID
- VITE_CDP_API_KEY_NAME
- VITE_CDP_API_KEY_PRIVATE_KEY
- Clone the repository:
git clone https://github.com/fleek-tools/ai-agent-cdp.git
cd cdp-agent-demo
- Install dependencies:
npm install
- Create an .env file with the required environment variables:
touch .env
Add the following:
VITE_XAI_API_KEY = ***
VITE_NETWORK_ID = ***
VITE_CDP_API_KEY_NAME = ***
VITE_CDP_API_KEY_PRIVATE_KEY = ***
- Run the project:
npm run dev
Modify the following configurations to suit your needs:
const config = {
cdpWalletData: "{...}", // Add wallet data here
networkId: "base-sepolia",
};
Adjust the thought variable in runAutonomousMode for custom agent actions:
const thought = "Perform creative blockchain actions...";
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch: git checkout -b feature-name.
- Commit your changes: git commit -m "Add feature-name".
- Push to the branch: git push origin feature-name.
- Submit a pull request.
Support For questions or issues, please create a GitHub issue.