Skip to content

A toolkit for creating AI agents that can interact with the Starknet blockchain

License

Notifications You must be signed in to change notification settings

KasarLabs/starknet-agent-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starknet Agent Kit Logo

starknet-agent-kit (alpha)

NPM Version License GitHub Stars Node Version

A toolkit for creating AI agents that can interact with the Starknet blockchain. Available as both an NPM package and a ready-to-use NestJS server with a web interface. Supports multiple AI providers including Anthropic, OpenAI, Google Gemini, and Ollama.

Quick Start

Prerequisites

  • Starknet wallet (recommended: Argent X)
  • AI provider API key (Anthropic/OpenAI/Google Gemini/Ollama)
  • Node.js and pnpm installed

Installation

git clone https://github.com/kasarlabs/starknet-agent-kit.git
cd starknet-agent-kit
pnpm install

Configuration

Create a .env file:

# Required Configuration
PRIVATE_KEY="your_wallet_private_key"
PUBLIC_ADDRESS="your_wallet_address"
RPC_URL="your_rpc_endpoint"
AI_PROVIDER_API_KEY="your_ai_api_key"
AI_PROVIDER="anthropic"  # or "openai", "gemini", "ollama"
AI_MODEL="claude-3-5-sonnet-latest"  # or your chosen model
API_KEY="your_api_key_for_endpoints"

Usage

Server Mode

Run the server:

pnpm run local

Available Modes:

  1. Chat Mode: Have conversations with the agent

    • Check balances
    • Execute transfers
    • Manage accounts
  2. Autonomous Mode: Configure automated monitoring Set up in config/agents/config-agent.json:

    {
      "name": "MyAgent",
      "context": "You are a Starknet monitoring agent...",
      "interval": 60000,
      "chat_id": "your_discord_channel_id",
      "allowed_actions": ["get_balance", "get_block_number"],
      "prompt": "Monitor ETH balance and alert if it drops below 1 ETH..."
    }

Library Mode

import { StarknetAgent } from 'starknet-agent-kit';

const agent = new StarknetAgent({
  provider: new RpcProvider({ nodeUrl: process.env.RPC_URL }),
  accountPrivateKey: process.env.PRIVATE_KEY,
  accountPublicKey: process.env.PUBLIC_ADDRESS,
  aiModel: process.env.AI_MODEL,
  aiProvider: process.env.AI_PROVIDER,
  aiProviderApiKey: process.env.AI_PROVIDER_API_KEY,
  signature: 'key',
});

const response = await agent.execute("What's my ETH balance?");

Actions

To learn more about actions you can read this doc section. A comprehensive interface in the Kit will provide an easy-to-navigate catalog of all available plugins and their actions, making discovery and usage simpler.

To add actions to your agent you can easily follow the step-by-steps guide here

Contributing

Contributions are welcome! Feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.


For detailed documentation visit docs.kasar.io

About

A toolkit for creating AI agents that can interact with the Starknet blockchain

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages