snak

snak

Starknet Agent Kit is a toolkit for creating AI agents powered by Starknet.

Stars: 82

Visit
 screenshot

The starknet-agent-kit is a toolkit designed for creating AI agents that can interact with the Starknet blockchain. It provides support for multiple AI providers such as Anthropic, OpenAI, Google Gemini, and Ollama. The kit includes an NPM package and a NestJS server with a web interface. Users can run the server in different modes like Chat Mode for conversations, checking balances, executing transfers, and managing accounts, as well as Autonomous Mode for automated monitoring. Additionally, the kit offers a library mode for more advanced usage, allowing users to interact with the StarknetAgent class for executing specific actions. The kit aims to simplify the process of integrating AI capabilities with blockchain interactions.

README:

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:

# 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"

Usage

Server Mode

Run the server:

pnpm run start

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.STARKNET_RPC_URL }),
  accountPrivateKey: process.env.STARKNET_PRIVATE_KEY,
  accountPublicKey: process.env.STARKNET_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

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for snak

Similar Open Source Tools

For similar tasks

For similar jobs