Polkadot AI Agent Kit is an open-source library for building autonomous AI agents capable of executing complex operations within the Polkadot ecosystem. It provides a modular framework and high-level APIs to abstract the complexity of on-chain interactions.
This project is organized as a monorepo with the following packages:
| Package | Description | Key Features |
|---|---|---|
packages/common/ |
Shared utilities and type definitions | • Chain configurations and supported networks • TypeScript interfaces and type definitions • Utility functions for chain validation and filtering • Common constants and enums used across packages |
packages/core/ |
Core Polkadot API functionality | • PolkadotApi implementation with multi-chain support • Balance checking and native token transfers • Cross-chain (XCM) transaction handling • Dynamic chain initialization and management • Transaction utilities and signing logic |
packages/llm/ |
LangChain integration for AI agents | • LangChain-compatible tools for blockchain operations • AI agent interfaces and abstractions • Tool definitions for balance checking, transfers, and XCM • Dynamic chain initialization tools for AI agents |
packages/sdk/ |
Main SDK interface | • PolkadotAgentKit - the primary class for developers • High-level API that combines core and LLM functionality • Comprehensive examples and documentation • Integration tests and usage patterns |
Explore real-world implementations:
- Node.js 22+
- pnpm (recommended package manager)
# 1. Clone the repository
git clone https://github.com/elasticlabs-org/polkadot-agent-kit
cd polkadot-agent-kit
# 2. Install all dependencies
pnpm install
# 3. Build all packages
pnpm run build
# 4. Run unit tests across all packages
pnpm run test
# 5. Run end-to-end tests
pnpm run test:e2e
# 6. Run integration tests for testnet agent (requires Ollama)
pnpm run test:integration:testnet
# 7. Run integration tests for mainnet agent (requires Ollama)
pnpm run test:integration:mainnet
We welcome contributions from the community! Please:
- Fork the repository.
- Create a new branch for your feature/bug fix.
- Submit a Pull Request with a detailed description of your changes.
This project is licensed under the MIT License.
