Build Blazing-Fast, Secure
Blockchain-Enabled AI Agents in Rust.

Version Rust License Crates Tools

riglr extends the rig framework with production-ready blockchain capabilities. With 23 specialized crates, 50+ verified blockchain tools, and the innovative SignerContext pattern for secure multi-tenant operations, riglr seamlessly adds cross-chain automation to rig agents.

Active Development: This project is under heavy development with frequent updates. APIs may change. Watch the repo for updates!
use riglr_solana_tools::{GetJupiterQuote, PerformJupiterSwap, DeployPumpToken};
use riglr_web_tools::{GetTokenInfo, AnalyzeCryptoSentiment};
use riglr_graph_memory::GraphMemory;
use rig::agent::AgentBuilder;

// Multi-chain trading agent with graph memory
let trading_agent = AgentBuilder::new(model)
    .preamble("Expert DeFi trader with cross-chain capabilities")
    .tool(GetJupiterQuote)      // Routes through 30+ Solana DEXs
    .tool(PerformJupiterSwap)   // Optimal swap execution
    .tool(GetTokenInfo)         // Real-time market data from DexScreener
    .dynamic_context(GraphMemory::new().await?) // Neo4j knowledge graph
    .build();

// Pump.fun token launcher with sentiment analysis  
let meme_launcher = AgentBuilder::new(model)
    .preamble("Analyzes social sentiment and launches trending tokens")
    .tool(AnalyzeCryptoSentiment)  // Twitter/X sentiment via LunarCrush
    .tool(DeployPumpToken)         // Full token deployment on Pump.fun
    .build();

// Example: AI-driven token analysis and potential launch
let sentiment = trading_agent
    .prompt("Analyze current sentiment for dog-themed memecoins")
    .await?;

// SignerContext automatically isolates user operations
// No manual key management - production-ready security

The Unfair Advantage for Building Blockchain-Enabled AI

Building AI agents that can safely and reliably interact with blockchains is hard. riglr provides the foundational toolkit to do it right.

1

A Library, Not a Framework

Alternatives give you a restrictive application. riglr gives you a powerful, unopinionated library.

Our core philosophy is to empower, not constrain. riglr is architected as a collection of modular crates. Need only Solana tools? Just import riglr-solana-tools. Building an EVM-only agent? Use riglr-evm-tools. This modularity ensures your application remains lean, flexible, and free from the technical debt of monolithic frameworks.

2

Production-Grade Security & Concurrency by Design

Stop worrying about private key management and race conditions. Start building secure, multi-tenant services from day one.

riglr is built around the SignerContext, a battle-tested pattern for secure, multi-tenant blockchain operations. It uses thread-local storage to ensure that every user request is handled in a cryptographically isolated context. This makes building complex, concurrent applications that handle multiple user wallets simultaneously not just possible, but simple and safe.

3

Native rig Integration, Not Reinvention

riglr extends the rig framework, it doesn't replace it. Leverage the full power of rig's reasoning, not a custom-built alternative.

We believe in the power of the rig agent model. riglr is designed to be a pure extension, providing the blockchain tools and context that rig agents need to operate. We don't reinvent the reasoning loop or the agent lifecycle. This means your riglr-powered agent benefits directly from every improvement and feature added to the core rig framework.

4

Unmatched Developer Experience

Write business logic, not boilerplate. The #[tool] macro is your superpower.

Defining a new blockchain tool in riglr is as simple as writing a single async function. Our powerful #[tool] macro handles everything else: automatic Tool trait implementation, JSON schema generation, structured error handling, and seamless SignerContext access.

Built for rig: Seamless Framework Extension

riglr is designed from the ground up to extend rig's powerful agent framework with blockchain superpowers

rig provides the brain

LLM orchestration, agent framework, and reasoning capabilities

use rig::agent::AgentBuilder;
use riglr_solana_tools::{TransferSol, GetSolBalance};
use riglr_evm_tools::{UniswapV3Swap};

// rig's AgentBuilder + riglr's blockchain tools
let defi_agent = AgentBuilder::new(model)
    .preamble("You are a DeFi expert")
    .tool(TransferSol)      // riglr adds Solana
    .tool(GetSolBalance)    // riglr adds queries
    .tool(UniswapV3Swap)    // riglr adds EVM
    .build();

// Natural language -> Blockchain actions
let result = defi_agent
    .prompt("Send 1 SOL to alice.sol")
    .await?;

An Architecture for Resilience and Scale

riglr isn't just a collection of functions; it's a thoughtfully designed system for building robust blockchain applications.

The SignerContext Pattern

At the heart of riglr is the SignerContext. It provides a secure, thread-local container for the current user's cryptographic signer. This allows your tools to be completely stateless—they simply ask the context for the current signer when they need to perform a transaction.

Modular Crates

riglr is organized into a workspace of independent crates. This design means you only compile and depend on the functionality you need. Building a Solana-only agent? You don't need to pull in any EVM dependencies.

Intelligent Error Handling

Network calls fail. Transactions get reverted. riglr is built for the real world. Our ToolError enum classifies failures into Permanent, Retriable, and RateLimited, allowing intelligent decisions about whether to retry failed operations.

rig Agent riglr-core SignerContext ToolError #[tool] Macro Tool Crates riglr-solana-tools riglr-evm-tools riglr-web-tools Your Application Agent Logic Web Server

SignerContext: Multi-Tenant Security Innovation

The Problem

Traditional blockchain applications struggle with secure multi-tenant operations. Managing multiple user wallets safely while preventing cross-user access is complex and error-prone.

riglr's Solution

The SignerContext pattern uses thread-local storage to ensure cryptographic isolation. Every blockchain operation automatically uses the correct user's credentials without manual key management.

// Tools are completely stateless
#[tool]
async fn transfer_sol(
    to: String,
    amount: f64,
) -> Result {
    // SignerContext automatically provides
    // the correct user's signer
    let signer = get_signer_from_context()?;
    let tx = create_transfer(&signer, &to, amount).await?;
    Ok(tx.signature.to_string())
}

// No manual key management needed!
// Each user request runs in isolated context

Advanced Graph Memory System

Hybrid Vector + Graph Search

  • Neo4j knowledge graph backend
  • Automatic blockchain entity extraction
  • Semantic similarity search
  • rig::VectorStore compatibility

Relationship Modeling

Entities: Wallets, Tokens, Protocols, Transactions, Blocks
Relationships: PERFORMED, INVOLVED, USED, HOLDS
Queries: "Find wallets that traded BONK and also hold SOL"

Production Multi-Agent Architecture

Agent Registry

Discovery and lifecycle management

Task Dispatcher

Load balancing and routing

Inter-Agent Communication

Message passing system

Task Management

Priority queues and tracking

A Comprehensive Toolkit for Blockchain Operations

riglr provides 50+ production-ready tools across multiple blockchains, with new integrations added weekly.

riglr-solana-tools

  • AMMs: Jupiter, Raydium, Meteora, Orca
  • Launchpads: Pump.fun, Moonshot, BonkBot
  • Trading: Swaps, Quotes, Liquidity
  • SOL & SPL Token Transfers
  • Balance & Portfolio Queries

riglr-evm-tools

  • Uniswap V3 Swaps & Quotes
  • ETH & ERC20 Transfers
  • Multi-Chain Support
  • Gas Estimation & Nonce Management

riglr-web-tools

  • DexScreener Market Data
  • Twitter/X Sentiment Analysis
  • Exa Semantic Web Search
  • Crypto News Aggregation

riglr-cross-chain

  • Li.fi Bridge Aggregation
  • Cross-Chain Route Discovery
  • Fee & Time Estimation
  • Secure Transaction Execution

riglr-graph-memory

  • Neo4j Knowledge Graph Backend
  • Hybrid Vector + Graph Search
  • Blockchain Entity Extraction
  • rig::VectorStore Implementation

riglr-hyperliquid-tools

  • Perpetuals Trading on Hyperliquid
  • Market Orders & Limit Orders
  • Position Management
  • Account Info & Portfolio Tracking

riglr-streams & riglr-indexer

  • Real-Time Event Streaming
  • Multi-Protocol Support
  • High-Performance Data Indexing
  • Custom Event Parsing

From 30 Lines to 1: The Power of #[tool]

We believe developers should spend their time on what makes their application unique.

❌ Before riglr
// Manual, verbose, and error-prone implementation
pub struct GetSolBalance;

#[async_trait]
impl Tool for GetSolBalance {
    fn name(&self) -> &str { "get_sol_balance" }
    fn description(&self) -> &str { 
        "Get the SOL balance for a wallet." 
    }
    
    fn parameters(&self) -> serde_json::Value {
        json!({
            "type": "object",
            "properties": {
                "address": {
                    "type": "string",
                    "description": "The wallet address."
                }
            },
            "required": ["address"]
        })
    }

    async fn call(&self, params: serde_json::Value) 
        -> Result<serde_json::Value, ToolError> {
        let address = params["address"]
            .as_str()
            .ok_or(...)?
            .to_string();
        // ... actual logic ...
        // ... manual error conversion ...
        // ... manual result serialization ...
    }
}
✅ After riglr
/// Get the SOL balance for a given wallet address.
#[tool]
async fn get_sol_balance(
    /// The Solana wallet address (base58 encoded).
    address: String,
) -> Result<f64, ToolError> {
    // Your logic here. That's it.
    // The macro handles the rest.
    let client = get_client_from_context()?;
    let lamports = client.get_balance(&address).await?;
    Ok(lamports as f64 / 1_000_000_000.0)
}

Real-Time Event Streaming & Indexing

Production-grade event streaming with riglr-streams and high-performance indexing with riglr-indexer

riglr-streams

  • Composable event streams
  • Financial operators for trading data
  • Multi-chain event normalization
  • Health monitoring & resilience

riglr-indexer

  • High-performance data indexing
  • Custom event parsing
  • Multi-protocol support
  • Seamless streams integration

Supported Event Sources

Solana Geyser

Real-time transaction streaming

EVM WebSocket

Multi-chain event monitoring

External APIs

Binance, mempool services

Get Started in 60 Seconds

Use our official CLI to scaffold a production-ready riglr agent instantly.

1

Install create-riglr-app

Our official project generator helps you start with best practices from day one.

cargo install create-riglr-app
2

Create Your Project

Interactive CLI guides you through selecting templates, blockchains, and features.

# Create a new trading bot, web API server, or custom agent
create-riglr-app my-agent

# Or use a specific template directly
create-riglr-app my-bot --template trading-bot
3

Configure & Run

Set your API keys and you're ready to go!

cd my-agent
cp .env.example .env
# Edit .env with your API keys and RPC URLs
cargo run

What You Get Out of the Box

🏗️

Project Structure

Production-ready layout with proper separation of concerns

🔧

Pre-configured Tools

Blockchain tools ready to use based on your selection

🔐

Security Best Practices

SignerContext pattern and secure key management built-in

📝

Example Code

Working examples showing how to use riglr effectively

Manual Setup (Advanced)

Want more control? You can also add riglr to an existing project:

# Add to your Cargo.toml
[dependencies]
rig-core = "0.17.1"
riglr-core = "0.2.0"
riglr-macros = "0.2.0"
riglr-solana-tools = "0.2.0"  # Or riglr-evm-tools, riglr-web-tools, etc.

Latest Updates & Improvements

riglr is evolving rapidly with continuous enhancements and new features

Enhanced Security

Added comprehensive security testing suite with SonarCloud integration, improved authentication patterns, and secure environment variable handling with PrivyConfig updates.

CI/CD Improvements

Streamlined GitHub Actions workflow with Rust caching, automated security scanning with DeepSource, and dependency management through Renovate.

Developer Experience

Updated to Rust 1.82 MSRV, improved error messages, better documentation with mdBook deployment, and enhanced create-riglr-app scaffolding tool.

Multi-Agent Systems

Production-ready riglr-agents crate for building complex multi-agent coordination with dispatch patterns and registry management.

Real-Time Indexing

High-performance riglr-indexer with custom event parsing, multi-protocol support, and seamless integration with riglr-streams for real-time data processing.

New Integrations

Added Hyperliquid perpetuals trading, enhanced cross-chain bridging with Li.Fi, and expanded web tools for market data and sentiment analysis.

Start Building Today

Everything you need to create powerful blockchain-enabled AI agents with riglr.

Read the Docs View Source Code