← Back to Blog

How to Run an AI Blockchain & Web3 Agent with OE Runtime

Query Ethereum wallets, transactions, and smart contracts with natural language. OE Runtime lets you run a local Web3 agent — fetch balances, analyse transaction history, and surface on-chain insights without writing a single line of code.

⛓️
Step 1
Fetch Wallet Data
Query the latest block and get ETH balance plus the last 5 transactions for a configured wallet.
Step 2
Analyze Transactions
Identify direction (sent/received), convert Wei to ETH, and note counterparty addresses and timestamps.
Step 3
Report
Produce a wallet summary with balance, transaction totals, recent activity, and any unusual patterns.

The Agent YAML

Create a file called agent.yaml inside a blockchain-web3/ directory:

name: Blockchain Agent
description: Query wallet balances, transactions, and smart contracts
instructions: |
  You are a blockchain data agent. Query wallet balances, transaction history,
  token holdings, and smart contract state on Ethereum and EVM-compatible chains.
  Complete all steps fully before writing your report.
steps:
  - name: Fetch Wallet Data
    content: |
      Query the latest block number and get the ETH balance for the wallet address configured in the connector.
      Also fetch the last 5 transactions for that wallet.
  - name: Analyze Transactions
    content: |
      For each of the 5 transactions retrieved:
      - Identify direction (sent / received)
      - Convert value from Wei to ETH
      - Note the counterparty address and timestamp
  - name: Report
    content: |
      Produce a wallet summary:
      - Current ETH balance
      - Total sent vs received across the 5 transactions
      - Most recent transaction details
      - Any unusual patterns (large transfers, repeated counterparties)
connectors:
  - connection_name: Ethereum
    connection_type: web3

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "Ethereum",
      "connection_type": "web3",
      "provider": "infura",
      "apiKey": "YOUR_INFURA_PROJECT_ID",
      "network": "mainnet"
    }
  ]
}

Replace YOUR_INFURA_PROJECT_ID with your key from app.infura.io. You can also use Alchemy, QuickNode, or any EVM-compatible RPC endpoint.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

Windows

# Run the agent
oe-runtime-win.exe blockchain-web3/agent.yaml --config blockchain-web3/oe-config.json

macOS

# Make executable (first time only)
chmod +x oe-runtime-macos

# Run the agent
oe-runtime-macos blockchain-web3/agent.yaml --config blockchain-web3/oe-config.json

Linux

# Make executable (first time only)
chmod +x oe-runtime-linux

# Run the agent
oe-runtime-linux blockchain-web3/agent.yaml --config blockchain-web3/oe-config.json

macOS Gatekeeper: On first run, macOS may block the binary. Go to System Settings → Privacy & Security → click "Allow Anyway" next to oe-runtime-macos.

Running as an API Server

Add --serve to start OE Runtime as an HTTP server on port 3333:

oe-runtime-win.exe --serve --config blockchain-web3/oe-config.json

Then send a request:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -d '{"yaml": "blockchain-web3/agent.yaml", "params": {}}'

Or import the Postman collection (download above) to test all endpoints visually.

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →