This is a Python chatbot project bootstrapped with create-onchain-agent.
It integrates AgentKit to provide AI-driven interactions with on-chain capabilities.
Before using create-onchain-agent, ensure you have the following installed:
- Python (3.10 - 3.12) – Download here
- Poetry (latest version) – Installation guide
First, install dependencies:
poetry install
Then, configure your environment variables:
mv .env.local .envFinally, run the chatbot:
poetry run python chatbot.py
You can also specify mode and interval non-interactively:
AGENT_MODE=auto AUTO_INTERVAL_SECONDS=15 poetry run python chatbot.pyYou can modify your agent configuration in the chatbot.py file.
Modify the ChatOpenAI instantiation to use the model of your choice.
AgentKit requires a Wallet Provider to interact with blockchain networks.
Action Providers define what your agent can do. You can use built-in providers or create your own.
The demo.py script walks the agent through key Wallet API operations:
- Retrieve the smart wallet address
- Check the wallet's EVM balance
- Generate a new smart wallet account
- Request testnet ETH from the faucet
- (Optional) Send ETH to a destination address
Create a .env file in this directory with the following keys:
# OpenAI
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4o-mini
OPENAI_TEMPERATURE=0.2
# Coinbase Developer Platform (CDP)
CDP_API_KEY_NAME=your_cdp_api_key_name
CDP_API_KEY_PRIVATE_KEY=your_cdp_api_private_key
# Wallet
PRIVATE_KEY=your_ethereum_private_key
NETWORK=base-sepolia
PAYMASTER_URL=
WALLET_DATA_FILE=wallet_data.txt
# Feature toggles
ENABLE_ERC20=1
ENABLE_PYTH=1
# Agent runtime
AGENT_MODE=chat
AGENT_THREAD_ID=Smart Wallet Chatbot
AUTO_INTERVAL_SECONDS=10
# Demo script
DEMO_DEST_ADDRESS=optional_destination_addressInstall dependencies and run:
poetry install
poetry run python demo.pyUse the provided script to launch the interactive chatbot:
poetry run start-agent- Explore the AgentKit README: AgentKit Documentation
- Learn more about available Wallet Providers & Action Providers.
- Experiment with custom Action Providers for your specific use case.
Interested in contributing to AgentKit? Follow the contribution guide:
- Contribution Guide
- Join the discussion on Discord