# DAO AI Agents Setup Instructions
# AI Agent Local Setup
This guide outlines the steps to set up a local development environment for an AI agent that interacts with Warpcast, the Graph, and EVM.
---
## Prerequisites
1. **Virtual Environment (VM):** Ensure you have Python and a virtual environment tool installed.
2. **Poetry:** Dependency management tool for Python.
3. **API Keys:**
- Coinbase Developer Platform (CDP) https://portal.cdp.coinbase.com/
- OpenAI Pro account https://openai.com/index/openai-api/
- New Warpcast account (new account can be nice)
- NANAR API https://dev.neynar.com/
- The Graph API https://thegraph.com/studio
4. **Base RPC:** Use a service like Infura, or a free/public RPC for EVM interactions.
---
## Setup Steps
### 1. Clone the Repository
```bash
git clone <repository-url>
cd <repository-folder>
```
### 2. Set Up a Virtual Environment
```bash
python3 -m venv venv
source venv/bin/activate # For Linux/Mac
venv\Scripts\activate # For Windows
```
## install poetry
```
pip3 install poetry
```
### 3. Install Dependencies with Poetry
```bash
poetry install
```
This installs libraries for interacting with Coinbase, OpenAI, and other required tools.
### 4. Configure `.env` File
Create a `.env` file and fill in the following keys:
- `CDP_API_KEY_NAME` and `CDP_PRIVATE_KEY`
- `OPENAI_API_KEY`
- `FARCASTER_FID` can get this from the api page https://docs.neynar.com/reference/lookup-user-by-username
- `NANAR_API_KEY`
- `NAYNAR_SIGNER_UUID` need to create this from the naynar dev dashboard
- `GRAPH_KEY`
- `BASE_RPC`
Refer to the documentation of respective services to generate these keys.
these are filled in later
- `TARGET_DAO`
- `TARGET_AGENT_WALLET_ID`
- `TARGET_AGENT_WALLET_ADDRESS`
### 5. Create a Wallet
Run the wallet creation script (in cdpdemo folder) to set up a new base wallet:
```bash
python create_wallet.py
```
This generates a wallet JSON seed file and outputs the wallet id and address. Add these to the `.env` file.
### 6. Fund the Wallet
If interacting on-chain, fund the wallet with a small amount of eth for gas fees.
---
## Running the Agent
### Start the Agent
cd into cdpdemop
```bash
python run.py
```
or to load a character
```bash
python run.py <character file json>
```
Options available:
1. **Chat Mode:** Directly chat with the agent for tasks like generating proposals or interacting with DAOs.
2. **Autonomous Mode:** The agent operates autonomously, performing actions like replying on Warpcast, creating proposals, or notifying about updates.
### Customize Agent Behavior
Modify the `characters` folder to define:
- **Identity and initial prompt** in JSON files.
- **Autonomous thoughts** for periodic actions.
---
## Key Files and Utilities
- **`agent.py`:** Core functions for the agent.
- **`constants.py`:** Contract addresses and configurations.
- **`helpers and utils`:** Includes DAO summoning tools, Warpcast, and Graph utility wrappers.
- **`run.py`:** Handles agent initialization and interval control for autonomous actions.
- **`characters/`:** json files that define initial prompts and auto thoughts for agents
---
## Additional Notes
- **Intervals:** The autonomous mode executes random actions every 5 to 60 minutes by default. This can be adjusted in `run.py`.
- **Memory Management:** The agent references recent actions (e.g., previous casts) to avoid repetitive tasks.
---
For detailed configuration or additional features, refer to the helper files and modify as needed.



