AI Agents

AI agent frameworks compared for onchain builders

Compare ElizaOS, LangChain, CrewAI, and Virtuals for building onchain AI agents on Base. Real trade-offs for wallet-holding, transaction-executing agents.

14 minUpdated 2026-03-03

Pick the wrong framework, lose two weeks rebuilding. We've built with all of these and talked to dozens of teams shipping agents on Base.

Your agent holds a wallet. It signs transactions with real money. The failure mode isn't "bad UX" — it's "drained wallet." Framework choice matters here more than anywhere else in AI.

The comparison matrix

ElizaOSLangChainCrewAIVirtualsAutoGPT
LanguageTypeScriptPython/JSPythonPlatformPython
Crypto-nativeBuilt for itYou build itYou build itBuilt for itNot designed for it
Wallet integrationBuilt-inDIY (web3.py)DIY (web3.py)Built-inPlugin-based
Multi-agentLimitedVia LangGraphCore featurePlatform-levelSingle agent
Social connectorsX, Discord, TelegramDIYDIYPlatform feedsLimited
Learning curveMediumHighMediumLowLow
Production-readyYesYesGrowingYesNo
Best forSocial crypto agentsCustom DeFi toolingMulti-agent teamsAgent token launchesPrototyping

ElizaOS: the crypto-native choice

What it is

ElizaOS emerged from the ai16z ecosystem as an open-source framework specifically for crypto-native AI agents. Ships with blockchain primitives: wallet management, token-aware memory, and social platform connectors.

Architecture

typescript
import { AgentBuilder } from '@elizaos/core';
import { basePlugin } from '@elizaos/plugin-base';
import { twitterPlugin } from '@elizaos/plugin-twitter';

const agent = new AgentBuilder()
  .withPlugin(basePlugin)
  .withPlugin(twitterPlugin)
  .withCharacter({
    name: "Base Alpha",
    bio: "Tracks DeFi opportunities on Base and shares insights",
    lore: [
      "Has been monitoring Base DeFi since mainnet launch",
      "Specializes in yield farming and liquidity analysis"
    ],
    settings: {
      chains: ["base"],
      rpcUrl: process.env.BASE_RPC_URL,
      walletSecretSalt: process.env.WALLET_SALT,
    },
    messageExamples: [
      [
        { user: "user", content: "What's the best yield on Base right now?" },
        { user: "Base Alpha", content: "Moonwell USDC is sitting at 8.2% APY. Aerodrome's USDC-ETH pool is higher at ~15% but you're taking IL risk. Depends on your appetite." }
      ]
    ]
  })
  .build();

await agent.start();

Strengths

  • Zero-to-agent in hours: Character files, wallet, and social presence without building from scratch
  • Plugin ecosystem: Growing library of crypto-specific plugins (DEX, lending, bridges)
  • Character system: Rich personality definition makes social agents feel natural
  • Active crypto community: Bugs get fixed fast, crypto-specific features ship regularly

Weaknesses

  • TypeScript only: Friction for Python-native teams
  • Opinionated architecture: Hard to deviate from the framework's patterns
  • Young project: Breaking changes still happen between versions
  • Multi-agent is limited: Not designed for agent-to-agent coordination

When to use ElizaOS

Use it when building a social agent (X/Discord/Telegram presence), when you need wallet + social out of the box, when speed to launch matters more than architectural flexibility.

Skip it for complex multi-agent orchestration, Python-heavy teams, or deep customization of reasoning loops.

LangChain: maximum control

What it is

LangChain is the most popular general-purpose agent framework. It doesn't have crypto features built in — you build them. What it gives you is the most flexible toolkit for wiring LLMs to tools, memory, and reasoning.

Architecture

python
from langchain.agents import AgentExecutor, create_openai_tools_agent
from langchain_openai import ChatOpenAI
from langchain.tools import StructuredTool
from langchain_core.prompts import ChatPromptTemplate
from web3 import Web3
from pydantic import BaseModel, Field

w3 = Web3(Web3.HTTPProvider("https://mainnet.base.org"))

class SwapParams(BaseModel):
    token_in: str = Field(description="Address of token to sell")
    token_out: str = Field(description="Address of token to buy")
    amount: float = Field(description="Amount in human-readable units")

def execute_swap(token_in: str, token_out: str, amount: float) -> str:
    """Execute a token swap on Uniswap V3 on Base."""
    return f"Swapped {amount} of {token_in} for {token_out}. Tx: 0x..."

swap_tool = StructuredTool.from_function(
    func=execute_swap,
    name="swap_tokens",
    description="Swap tokens on Uniswap V3 on Base",
    args_schema=SwapParams
)

prompt = ChatPromptTemplate.from_messages([
    ("system", """You are a DeFi agent operating on Base. You can check yields 
    and execute swaps. Always check current rates before making trades. 
    Never swap more than $100 in a single transaction."""),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}")
])

llm = ChatOpenAI(model="gpt-4o", temperature=0)
agent = create_openai_tools_agent(llm, [swap_tool], prompt)
executor = AgentExecutor(agent=agent, tools=[swap_tool])

LangGraph for complex flows

When you need stateful, multi-step agent workflows, LangGraph is LangChain's answer:

python
from langgraph.graph import StateGraph, END

workflow = StateGraph(AgentState)
workflow.add_node("research", research_yields)
workflow.add_node("decide", make_allocation_decision)
workflow.add_node("execute", execute_transactions)
workflow.add_node("verify", verify_results)

workflow.add_edge("research", "decide")
workflow.add_conditional_edges("decide", should_execute,
    {"yes": "execute", "no": END})
workflow.add_edge("execute", "verify")
workflow.add_edge("verify", END)

app = workflow.compile()

Strengths

  • Total flexibility: Build exactly what you need
  • Massive ecosystem: Hundreds of integrations, LLM providers, vector stores
  • Best documentation: Most tutorials, examples, and community answers
  • LangGraph: Powerful stateful workflows for complex agent logic

Weaknesses

  • No crypto primitives: You build every blockchain integration yourself
  • Complexity: The flexibility means more decisions and more code
  • Abstraction churn: APIs change frequently
  • Overhead: For simple agents, LangChain adds unnecessary complexity

When to use LangChain

Use it for custom DeFi strategies with complex logic, when you need fine-grained control, or when your Python team already has web3.py experience.

Skip it if you want a quick crypto agent with social presence or don't want to build blockchain integrations from scratch.

CrewAI: multi-agent coordination

What it is

CrewAI is built for multi-agent systems where specialized agents collaborate on complex tasks. Think of it as assembling a team, not building a single bot.

Architecture

python
from crewai import Agent, Task, Crew, Process

market_analyst = Agent(
    role="Base DeFi Analyst",
    goal="Identify the highest risk-adjusted yield opportunities on Base",
    backstory="""Expert DeFi analyst tracking TVL flows, yield trends, 
    and protocol risks across Base. Uses data from DefiLlama, Dune, 
    and Sonarbot to track whale movements.""",
    tools=[defillama_tool, dune_tool, sonarbot_tool],
)

risk_officer = Agent(
    role="Risk Manager",
    goal="Ensure no single position exceeds 20% of portfolio",
    tools=[portfolio_tool, audit_checker_tool],
)

executor = Agent(
    role="Trade Executor",
    goal="Execute approved trades with minimal slippage and gas costs",
    tools=[uniswap_tool, aerodrome_tool, wallet_tool],
)

crew = Crew(
    agents=[market_analyst, risk_officer, executor],
    tasks=[research_task, risk_task, execution_task],
    process=Process.sequential,
)

result = crew.kickoff()

Strengths

  • Natural separation of concerns: Each agent has a clear role
  • Built-in collaboration: Agents can delegate, review, and challenge each other
  • Readable code: The crew/agent/task model maps intuitively to team structures

Weaknesses

  • No crypto primitives: Build blockchain tools yourself
  • LLM cost multiplier: Multiple agents = multiple LLM calls = higher costs
  • Debugging complexity: Tracing failures across multiple agents gets harder

When to use CrewAI

Use it for portfolio management with research/risk/execution pipelines, DAO operations, or complex strategies where separation of concerns improves reliability.

Skip it for simple single-purpose agents or when budget-constrained.

Virtuals Protocol: the agent launchpad

What it is

Virtuals Protocol is not a framework in the traditional sense — it's a platform for launching tokenized AI agents on Base. Over $477M processed through autonomous agents. They handle agent deployment, token creation, and marketplace discovery.

How it differs

Unlike the frameworks above, Virtuals provides the full stack: infrastructure, token economics, and distribution. You don't wire up wallet integrations or DEX connectors — the platform handles it.

Their Agent Commerce Protocol (ACP), live at app.virtuals.io/acp, takes this further — agents can list services and transact with each other. This is the first real agent-to-agent marketplace, creating a new economic layer where agents pay agents for services.

Best for: Teams that want to launch an agent with a token, get distribution through Virtuals' marketplace, participate in agent-to-agent commerce, and use existing infrastructure instead of building from scratch.

Trade-off: Less control over the underlying architecture. You're building within Virtuals' paradigm.

Why it matters for the comparison

Virtuals represents a different approach to building agents. Instead of "framework + custom code," it's "platform + configuration." For many teams, especially those focused on the agent's intelligence rather than its infrastructure, this is the right choice.

Coinbase AgentKit: the wallet layer

Coinbase's official SDK for giving agents wallets. Not a full framework — it's a wallet layer that plugs into LangChain, CrewAI, ElizaOS, or any framework.

python
from coinbase_agentkit import CdpWalletProvider, CdpAgentkitWrapper
from coinbase_agentkit_langchain import CdpToolkit

wallet = CdpWalletProvider.configure(network_id="base-mainnet")
agentkit = CdpAgentkitWrapper(cdp_wallet_provider=wallet)
toolkit = CdpToolkit.from_cdp_agentkit_wrapper(agentkit)
tools = toolkit.get_tools()

Why it matters: MPC wallets with spending policies, built by the team that built Base. This is probably the safest way to give an agent a wallet today. Compatible with every framework on this list.

Other frameworks worth watching

  • GOAT (Great Onchain Agent Toolkit): Open-source toolkit focused on onchain agent actions. Protocol-agnostic.
  • Rig (Rust): Rust-based agent framework. If you need performance for high-frequency agents or MEV.
  • Zerepy: Lightweight Python framework for crypto social agents. Simpler than ElizaOS.

Decision framework: which should you pick?

Answer these questions:

  1. Does your agent need a social presence (X, Discord, Telegram)? -- ElizaOS. It's built for this.

  2. Do you want to launch an agent with its own token? -- Virtuals Protocol. Purpose-built launchpad.

  3. Do you need multiple agents collaborating? -- CrewAI. Multi-agent is its core strength.

  4. Do you need maximum control over reasoning and tools? -- LangChain + LangGraph.

  5. Are you just prototyping? -- AutoGPT or Zerepy for quick experiments.

  6. Is wallet security your top concern? -- Add Coinbase AgentKit to whatever framework you choose.

The pragmatic combos we see working

  • Social agent: ElizaOS + Coinbase AgentKit
  • DeFi strategy agent: LangChain + LangGraph + Coinbase AgentKit
  • Multi-agent system: CrewAI + custom web3 tools + Safe Smart Wallet
  • Token-launched agent: Virtuals Protocol
  • Social trading agent: Bankr agent skills
  • High-performance: Rig (Rust) + custom everything

Cost comparison

Real costs for running an agent that makes 50 decisions/day:

FrameworkLLM Calls/DecisionMonthly LLM Cost (GPT-4o)Gas (Base)Infra
ElizaOS1-3$15-45$1-5$5-20
LangChain1-5$15-75$1-5$5-20
CrewAI (3 agents)3-15$45-225$1-5$5-20
VirtualsPlatform-managedIncluded in platform fees$1-5Platform

Base's sub-cent gas fees are a genuine advantage. On Ethereum mainnet, gas would dominate costs. On Base, LLM API calls are your primary expense.

What we'd build today

If we were starting a new onchain agent project on Base today:

  1. Framework: LangChain + LangGraph for the reasoning layer (maximum control)
  2. Wallet: Coinbase AgentKit with MPC wallet (best security)
  3. Data: DefiLlama API + direct RPC reads + Sonarbot for whale/smart money signals + Checkr for token insights
  4. Monitoring: Custom logging + Telegram alerts for every transaction
  5. Guardrails: Smart contract wallet with spending limits as the final safety net

If we wanted social distribution, we'd add ElizaOS or Bankr agent skills on top. If we wanted a token economy around the agent, Virtuals.

The framework is 20% of the work. The other 80% is tools, guardrails, monitoring, and the actual strategy logic. Pick any framework from the top three and you'll be fine — what matters is what you build with it.


Ready to build? Start with our step-by-step launch guide or deep-dive into wallet security.