kasarlabs_snak

kasarlabs_snak

by KasarLabs
A toolkit for creating AI agents that interact with the Starknet blockchain, supporting multiple AI providers.

Starknet Agent Kit (Snak)

Starknet Agent Kit Logo

Overview

Starknet Agent Kit (Snak) is a toolkit for creating AI agents that interact with the Starknet blockchain. It is available as both an NPM package and a ready-to-use NestJS server with a web interface. Snak supports multiple AI providers, including Anthropic, OpenAI, Google Gemini, and Ollama, enabling developers to build powerful and secure AI agents.

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/snak.git
cd snak
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
  2. Check balances
  3. Execute transfers
  4. Manage accounts
  5. 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, read the documentation section. The Kit provides an easy-to-navigate catalog of all available plugins and their actions. To add actions to your agent, follow the step-by-step guide.

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

Build powerful and secure AI Agents powered by Starknet.

starkagent.ai

Features & Capabilities

Categories
mcp_server model_context_protocol typescript starknet ai_agents api_integration blockchain

Implementation Details

Stats

0 Views
83 GitHub Stars

Repository Info

KasarLabs Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300