Snak
Agent Engine для создания мощных и безопасных агентов ИИ на базе Starknet. Доступно как пакет NPM и готовый к использованию бэкэнд.
Быстрый старт
Предпосылки
Кошелек Starknet (рекомендуется: Argent X )
Ключ API поставщика ИИ (Anthropic/OpenAI/Google Gemini/Ollama)
Node.js и pnpm установлены
Установка
git clone https://github.com/kasarlabs/snak.git
cd snak
pnpm installКонфигурация
Создайте файл
.env, скопировав.env.example:
cp .env.example .envЗатем заполните необходимые значения в вашем файле .env :
# --- 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 Model API Keys (mandatory) ---
# Add the API keys for the specific AI providers you use in config/models/default.models.json
# The agent will automatically load the correct key based on the provider name.
# Example for OpenAI:
OPENAI_API_KEY="YOUR_OPENAI_API_KEY" # (e.g., sk-...)
# Example for Anthropic:
ANTHROPIC_API_KEY="YOUR_ANTHROPIC_API_KEY" # (e.g., sk-ant-...)
# Example for Google Gemini:
GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
# Example for DeepSeek:
DEEPSEEK_API_KEY="YOUR_DEEPSEEK_API_KEY"
# Note: You do not need an API key if using a local Ollama model.
# --- General Agent Configuration (mandatory) ---
SERVER_API_KEY="YOUR_SERVER_API_KEY" # A secret key for your agent server API
SERVER_PORT="3001"
# --- PostgreSQL Database Configuration (mandatory) ---
POSTGRES_USER="admin"
POSTGRES_PASSWORD="admin"
POSTGRES_ROOT_DB="postgres" # Database used to create/manage the application database
POSTGRES_HOST="localhost"
POSTGRES_PORT="5454"
# --- LangSmith Tracing (Optional) ---
# Set LANGSMITH_TRACING=true to enable tracing
LANGSMITH_TRACING=false
LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
LANGSMITH_API_KEY="YOUR_LANGSMITH_API_KEY" # (Only needed if LANGSMITH_TRACING=true)
LANGSMITH_PROJECT="Snak" # (Optional project name for LangSmith)
# --- Node Environment ---
NODE_ENV="development" # "development" or "production"Настройка моделей ИИ (необязательно): Файл
config/models/default.models.jsonопределяет модели ИИ по умолчанию, используемые для различных задач (fast,smart,cheap). Вы можете настроить этот файл или создать новые конфигурации моделей (например,my_models.json) и указать их при запуске агента. Структуру см. вconfig/models/example.models.json.Агент использует поле
providerв конфигурации модели, чтобы определить, какой ключ API следует загрузить из файла.env(например, еслиproviderявляетсяopenai, он загружаетOPENAI_API_KEY).Создайте файл конфигурации агента (например,
default.agent.jsonилиmy_agent.json) в каталогеconfig/agents/:
{
"name": "Your Agent name",
"group": "Your Agent group",
"description": "Your AI Agent Description",
"lore": ["Some lore of your AI Agent 1", "Some lore of your AI Agent 1"],
"objectives": [
"first objective that your AI Agent need to follow",
"second objective that your AI Agent need to follow"
],
"knowledge": [
"first knowledge of your AI Agent",
"second knowledge of your AI Agent"
],
"interval": "Your agent interval beetween each transaction of the Agent in ms,",
"chatId": "Your Agent Chat-id for isolating memory",
"maxIterations": "The number of iterations your agent will execute before stopping",
"mode": "The mode of your agent, can be interactive, autonomous or hybrid",
"memory": {
"enabled": "true or false to enable or disable memory",
"shortTermMemorySize": "The number of messages your agent will remember"
},
"plugins": ["Your first plugin", "Your second plugin"],
"mcpServers": {
"nxp_server_example": {
"command": "npx",
"args": ["-y", "@npm_package_example/npx_server_example"],
"env": {
"API_KEY": "YOUR_API_KEY"
}
},
"local_server_example": {
"command": "node",
"args": ["node /path/to/local_server/dist/index.js"]
}
}
}Вы можете просто создать свою собственную конфигурацию агента, используя наш инструмент на snakagent
Related MCP server: Node9-Proxy
Использование
Режим подсказки
Запустите команду:
# start with the default.agent.json
pnpm run start
# start with your custom configuration
pnpm run start --agent="name_of_your_config.json" --models="name_of_your_config.json"Режим сервера
Запустите сервер:
# start with the default.agent.json
pnpm run start:server
# start with your custom configuration
pnpm run start:server --agent="name_of_your_config.json" --models="name_of_your_config.json"Доступные режимы
|Интерактивный режим|Автономный режим| |---|---|---| |Режим подсказки|✅|✅| |Режим сервера|✅|✅|
Внедрите Snak в свой проект
Установить пакет snak
#using npm
npm install @snakagent
# using pnpm
pnpm add @snakagentСоздайте свой экземпляр агента
import { SnakAgent } from 'starknet-agent-kit';
const agent = new SnakAgent({
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',
agentMode: 'interactive',
agentconfig: y,
});
const response = await agent.execute("What's my ETH balance?");Действия
Чтобы узнать больше о действиях, вы можете прочитать этот раздел документа . Комплексный интерфейс в Kit предоставит простой в навигации каталог всех доступных плагинов и их действий, что упрощает обнаружение и использование.
Чтобы добавить действия в своего агента, вы можете легко следовать пошаговому руководству здесь.
Внося вклад
Вклады приветствуются! Не стесняйтесь отправлять запрос на извлечение.
Лицензия
Лицензия MIT — подробности см. в файле LICENSE.
Подробную документацию можно найти на docs.kasar.io
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI trading agents you own: plan, run and read any market from your AI, on Lighter and Hyperliquid.
Build, validate, and deploy multi-agent AI solutions from any AI environment.
Agentic AI runtime: persistent memory, vault, autonomous agents, deep research, DeFi execution.
Build, backtest, and deploy quantitative trading strategies from your AI agent.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI agents to interact with cryptocurrency ecosystems through wallet management, trading operations (swaps, DCA, limit orders), staking, and multi-chain support starting with Solana.37GPL 3.0
- AlicenseNot gradedqualityAmaintenanceThe Execution Security Layer for the Agentic Era. Providing deterministic "Sudo" governance and audit logs for autonomous AI agents.5,041 npm225Apache 2.0
- AlicenseAqualityBmaintenanceDeFi execution and agent-to-agent economy tools for AI agents — swaps, yield, transfers, policy enforcement, trust scoring, A2A jobs, and P\&L across Ethereum, Base, Arbitrum, and Polygon.311Apache 2.0
- AlicenseCqualityDmaintenanceA single source for integrating AI Agents with the Crypto ecosystem, including wallet creation, swaps, transfers, and event-based trades like DCA and stop loss.37GPL 3.0