Create Your First Agent

Create Your First Agent

Deploy your own Starknet agent in minutes! This guide will walk you through setting up and running your first agent, whether you want it to operate autonomously or interact through chat.

[VIDEO PLACEHOLDER]

Getting Started

Follow these steps to create and deploy your first Starknet agent:

1. Environment Setup

First, create a .env file in your project root with the following variables:

# Starknet configuration (mandatory)
STARKNET_PUBLIC_ADDRESS="YOUR_STARKNET_PUBLIC_ADDRESS"
STARKNET_PRIVATE_KEY="YOUR_STARKNET_PRIVATE_KEY"
STARKNET_RPC_URL="YOUR_STARKNET_RPC_URL"

# AI Provider configuration (mandatory)
AI_PROVIDER_API_KEY="YOUR_AI_PROVIDER_API_KEY"
AI_MODEL="YOUR_AI_MODEL"
AI_PROVIDER="YOUR_AI_PROVIDER"

# NestJS server configuration
SERVER_API_KEY="YOUR_SERVER_API_KEY"
SERVER_PORT="YOUR_SERVER_PORT"

# Agent additional configuration
DISCORD_BOT_TOKEN?="YOUR_DISCORD_BOT_TOKEN"
DISCORD_CHANNEL_ID?="YOUR_DISCORD_CHANNEL_ID"

You can retrieve the above values the following way:

VariableDescription
STARKNET_PUBLIC_ADDRESSYour Starknet wallet address (from Argent X (opens in a new tab) or Braavos (opens in a new tab))
STARKNET_PRIVATE_KEYYour wallet's private key (export from wallet settings)
STARKNET_RPC_URLEndpoint from an RPC provider (opens in a new tab)
AI_PROVIDER_API_KEYAPI key from your chosen provider (e.g., Anthropic (opens in a new tab))
AI_PROVIDERModel provider name (e.g., "anthropic")
AI_MODELSpecific model identifier (e.g., "claude-3-5-sonnet-latest")
⚠️

Never commit your private keys or API keys to version control. Make sure to add .env to your .gitignore file.

2. Agent Configuration

Your agent's personality and capabilities can be configured in the ./config/agents directory. You can either:

  • Use a pre-built template
  • Create a custom configuration

For detailed configuration options, check out our Agent Customization Guide.

For this tutorial, we'll use the default configuration to get started quickly.

3. Install Dependencies

Install all required packages using pnpm:

pnpm install

4. Launch Your Agent

Start your agent by running:

pnpm run local

You'll be prompted to choose between two operation modes:

  • Chat Mode: Interact with your agent through a command-line interface
  • Autonomous Mode: Let your agent operate independently based on its configuration

Next Steps

Now that your agent is up and running, explore these advanced features:

Monitor your agent's activities and ensure it has sufficient funds for any transactions it needs to perform.