Follow these steps to build and run a DeFi agent:
1

Get the Code

How you get the code depends on whether you want to simply run the project or contribute to its development. If you want to run Vibekit locally or explore the codebase, you can clone the repository through the command line or your preferred IDE:
git clone https://github.com/EmberAGI/arbitrum-vibekit.git &&
cd arbitrum-vibekit

If you plan to contribute changes to Vibekit, fork the repository on Vibekit’s Github page and clone your fork locally. Replace YOUR_USERNAME with your GitHub username:
git clone https://github.com/YOUR_USERNAME/arbitrum-vibekit.git &&
cd arbitrum-vibekit

For more detailed contribution steps, please see our Contribution Guidelines.
2

Run DeFi Agents

Let’s run the swapping and lending agents. These agents are started by default when the frontend is started. Follow this guide to launch the frontend:

Prerequisites

Make sure you have Docker Desktop with Docker Compose v2.24 or greater installed on your system.
If your are on an M-series Mac, you need to install Docker using the dmg package supplied officially by Docker rather than through Homebrew or other means to avoid build issues.

Configure Environment Variables

Navigate to the typescript directory and create a .env file by copying the example template:
cd typescript &&
cp .env.example .env
Make sure to populate the typescript/.env file with your API keys and configurations.

Start Services with Docker Compose

From the typescript directory, run the following command to build and start the frontend and its associated services (including the lending agent, the swapping agent and the database):
# Ensure you are in the typescript/ directory
docker compose up
If you get a permission denied error, try running the above command with sudo:
sudo docker compose up
If you previously ran docker compose up with an older version of the Vibrekit and encounter frontend errors or database-related errors in the docker service logs, follow these steps:
  1. Clear your browser cache.
  2. Run the following command in your terminal:
    docker compose down && docker volume rm typescript_db_data && docker compose build web --no-cache && docker compose up
    

Access Vibekit’s Web Interface

Open your web browser and navigate to http://localhost:3000. To be able to chat with the agents, you need to connect your wallet first. Click on “Connect Wallet” to get started:Wallet Setup PnAfter setting up your wallet, you can interact with the lending and swapping agents through the chat interface:Chat Interface Pn

Integrating Other Agents

Checkout the templates directory to explore other Vibekit agents. To integrate any other example agents into the frontend, refer to this guide.
3

Build Your Custom DeFi Agent

To build your own agent, we recommend using Vibekit’s Quickstart Agent template. It provides all the necessary boilerplate code so you can start building right away. Follow these steps to integrate and run the Quickstart Agent:

Enable the Quickstart Agent in the Frontend

In the agents-config.ts file, uncomment the agent’s configuration in two places:
...
  {
    id: 'quickstart-agent-template' as const,
    name: 'Quickstart',
    description: 'Quickstart agent',
    suggestedActions: [],
  },
...
...
  ['quickstart-agent-template', 'http://quickstart-agent-template:3007/sse'],
...

Add the Agent to Docker Compose

In the docker compose file, uncomment the service definition for the Quickstart Agent:
---
quickstart-agent-template:
  build:
    context: ./
    dockerfile: templates/quickstart-agent/Dockerfile
  container_name: vibekit-quickstart-agent-template
  env_file:
    - path: .env
      required: true
    - path: templates/quickstart-agent/.env
      required: false
  ports:
    - 3007:3007
  restart: unless-stopped

Configure the Agent’s Environment

Navigate to the agent’s directory and create a local .env file by copying the .env.examplefile. Make sure to populate the .env file with your API keys and configurations:
cd typescript/templates/quickstart-agent && cp .env.example .env

Rebuild and Restart Services

Navigate to the typescript directory, rebuild the web application and restart all services to apply the changes:
cd ../.. && docker compose build web --no-cache && docker compose up
To learn more about Vibekit’s agent configurations, refer to this guide.