Skip to content

Latest commit

Β 

History

History
184 lines (129 loc) Β· 4.02 KB

File metadata and controls

184 lines (129 loc) Β· 4.02 KB

AI + Blockchain + Rust
Smart Assistant

πŸš€ Next-gen AI assistant for Ethereum blockchain: natural language, RAG, MCP and a beautiful chat UI.


AI Blockchain Assistant is a comprehensive system for interacting with Ethereum using natural language. It features:

  • πŸ€– AI-powered CLI and Desktop Chat UI (Tauri + React)
  • πŸ“š RAG Knowledge Base (Retrieval-Augmented Generation)
  • πŸ”— Blockchain operations (ETH transfers, token swaps, contract queries)
  • 🌐 External API integrations (DefiLlama, Brave Search, 0x)

πŸ“‚ Project Structure

ai-blockchain-assistant/
β”œβ”€β”€ crates/         # All Rust and frontend code
β”‚   β”œβ”€β”€ chatapp/    # Tauri + React chat UI
β”‚   β”œβ”€β”€ mcp-server/ # Main MCP server (Rust)
β”‚   β”œβ”€β”€ rig-client/ # CLI client (Rust)
β”‚   └── shared/     # Shared Rust code
β”œβ”€β”€ data/           # Blockchain docs, ABIs, embeddings for RAG
β”‚   β”œβ”€β”€ docs/       # Markdown, Solidity, Uniswap docs
β”‚   └── embeddings/ # Vector embeddings
β”œβ”€β”€ scripts/        # Shell scripts for setup and running
β”‚   β”œβ”€β”€ populate_rag.sh # Populate RAG with docs
β”‚   β”œβ”€β”€ run_app.sh      # Run the Tauri app
β”‚   └── run_repl.sh     # Run the CLI REPL
└── ...

πŸ—οΈ Architecture

User (CLI/Chat UI)
      ↓
RIG Client (Rust CLI) / Tauri Chat UI (React)
      ↓
MCP Server (Rust, LLM, RAG)
      ↓
Forked Ethereum (Anvil, Foundry)
      ↑
RAG Knowledge Base (Markdown, Solidity, Uniswap)

✨ Features

  • Natural language blockchain commands (ETH, ERC20, Uniswap, etc)
  • RAG-powered answers for blockchain concepts
  • Token swaps, contract queries, and more
  • CLI and beautiful desktop chat UI
  • External API integrations
  • Test accounts and local mainnet fork

⚑ Quick Start

1. Prerequisites

  • Rust & Cargo
  • Node.js & npm (for chat UI)
  • Foundry (auto-installed by scripts)
  • Anthropic API key

2. Setup

Clone and enter the repo:

git clone https://github.com/superdev947/ai-blockchain-assistant.git
cd ai-blockchain-assistant

Set your Anthropic API key:

export ANTHROPIC_API_KEY="your_api_key_here"

(A) Run the CLI REPL

chmod +x scripts/run_repl.sh
./scripts/run_repl.sh

(B) Run the Chat UI (Tauri + React)

cargo install tauri-cli
cd crates/chatapp
npm install

then

chmod +x scripts/run_app.sh
./scripts/run_app.sh

(C) Populate RAG with docs

chmod +x scripts/populate_rag.sh
./scripts/populate_rag.sh

πŸ–₯️ Screenshots

Chat UI Dark
Modern, animated chat interface for your blockchain assistant


πŸ€– Usage Examples

CLI

> send 1 ETH from Alice to Bob
> How much USDC does Alice have?
> Is Uniswap V2 Router (0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D) deployed?
> Swap 10 ETH for USDC on Alice's account
> Explain how Uniswap V2 works
> What are the key functions in the ERC-20 standard?

Chat UI

Type your question or command in the chat window and get instant, AI-powered answers and blockchain actions.


🧠 RAG System

The RAG (Retrieval-Augmented Generation) system enhances the AI assistant with knowledge about:

  • Ethereum basics and concepts
  • Token standards (ERC-20, ERC-721)
  • Uniswap V2 and V3 protocols
  • Smart contract interfaces

πŸ§ͺ Test Accounts

The system uses Anvil's default test accounts:

  • Alice: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
  • Bob: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8

Each account comes with 10,000 ETH for testing.


πŸ› οΈ Scripts

  • scripts/populate_rag.sh β€” Populate the RAG system with blockchain docs
  • scripts/run_app.sh β€” Run the Tauri chat UI
  • scripts/run_repl.sh β€” Run the CLI REPL

🀝 Contributing

Contributions, bug reports, and feature requests are welcome! Please open an issue or submit a pull request.