Overview

Prototype Notice: Somnia Agents is in prototype state and deployed on both Somnia Mainnet (chain ID 5031) and Somnia Testnet (chain ID 50312). Features and APIs may change as development progresses — see the Quickstart for current contract addresses and RPC URLs.

Overview

Vision

Smart contracts revolutionized trustless computation, but they operate in isolation. They cannot fetch external data, call APIs, or perform complex computation. Today's solutions require stitching together multiple systems—Chainlink for price feeds, separate oracle networks for weather data, centralized services for AI—each adding counterparty risk and integration complexity.

What if smart contracts could natively access the internet, run AI models, and perform arbitrary computation—all while maintaining blockchain guarantees of decentralization and auditability?

Somnia Agents extend the Somnia blockchain by enabling Smart Contracts and users to trigger decentralized, auditable compute jobs—including LLM-based tasks—executed across Somnia's decentralized network. By integrating with Somnia's native on-chain reactivity, Agents make it possible to build and run fully featured decentralized applications.

What are Somnia Agents?

Somnia Agents function as decentralized, sandboxed compute containers. This architecture makes them simple to develop, much like familiar serverless platforms such as AWS Lambda or Google Cloud Run, but with the advantages of blockchain auditability, reactivity, and security.

Capabilities

Somnia Agents unlock use cases not possible with traditional EVM Smart Contracts:

  • Acting as Oracles: Querying the internet and reliably bringing external data on-chain — see JSON API Request

  • Outbound Communication: Triggering actions or sending messages to external internet services

  • LLM Invocation: Leveraging on-chain deterministic AI models for autonomous agents — see LLM Inference and LLM Parse Website

How Somnia Agents Work

spinner

Execution

When an Agent is invoked, it runs on a decentralized subset of the Somnia network nodes. Execution is considered valid only when a majority of nodes reach consensus on the result. Each invocation produces an audit receipt, allowing anyone to retrospectively inspect each step in an Agent execution.

Deterministic LLMs

Somnia Agents can invoke large language models (LLMs) that run as part of the validator network. Unlike traditional LLM APIs where outputs vary between calls, Somnia's LLMs use fixed random seeds and controlled temperature parameters to produce deterministic outputs—the same input always yields the same output across all validating nodes.

This determinism enables consensus: when multiple nodes independently run the same LLM inference with identical parameters, they produce identical results, allowing the network to verify and agree on AI-generated outputs.

See LLM Inference for usage details.

Receipts

An execution receipt is a signed manifest of intermediate computation steps taken within the Agent. This is similar to the logs and manifests used by CI build systems.

Important: The final result is what validators reach consensus on. Receipt steps are subjective—they show what one node did to compute the result, which may vary slightly between nodes. This provides transparency without requiring consensus on every intermediate step.

spinner

See Receipts for viewing and understanding receipts.

Payment and Gas

Invoking an Agent requires SOMI (mainnet) or STT (testnet). Users send a deposit when creating a request. The contract splits it into two pots: an operations reserve (minPerAgentDeposit × subcommitteeSize) that funds runner gas refunds, callback gas, and keeper payments; and an agent reward pot (everything above the reserve) that's split equally and paid to every elected subcommittee member at finalisation. Whatever's left after everything settles is rebated to the requester.

See Gas Fees for the full fund-flow diagram and details on sizing deposits.

EVM-Native Schema

Somnia Agents are invoked via HTTP POST requests, where both the input data and returned result are ABI-encoded, just like traditional Ethereum smart contract calls.

The interface and schema of each Agent closely follows the standard Solidity contract ABI. This means you can use familiar web3 tools—such as viem, Ethers.js, or Solidity's own ABI encoders/decoders—to interact with Agents in exactly the same way you would a smart contract.

Key Benefits:

  • Code reuse with existing smart contract tooling

  • Seamless integration with developer workflows

  • Agents feel like native blockchain contracts

  • Enables richer off-chain compute and connectivity

Roadmap

spinner

Agents will roll out in phases:

Phase 1 (Current): A curated set of core Agents is available to the ecosystem, covering common use cases like oracles, AI, and external communication.

Phase 2 (2026): Support for fully custom, user-defined Agents will launch, further expanding Somnia's capabilities.

Use Cases

Oracles

Build on-chain oracles using the JSON API Request agent:

  • Price feeds from cryptocurrency APIs

  • Weather data for parametric insurance

  • Sports scores for prediction markets

  • Any external API data

AI Services

Leverage deterministic AI with LLM Inference and LLM Parse Website:

  • Text generation and analysis

  • Content moderation decisions

  • Dynamic NFT descriptions

  • Intelligent automation

Outbound Communication

  • Webhook triggers from smart contracts

  • Notifications to external systems

  • Off-chain workflow initiation

  • Database synchronization

Data Processing

  • JSON extraction and transformation

  • Web scraping with AI — see LLM Parse Website

  • Data validation and enrichment

  • Format conversion

Key Features

  • EVM-Native: Standard Solidity ABI encoding for seamless integration

  • Decentralized: No central authority or single point of failure

  • Auditable: Every execution produces verifiable receipts

  • Monetizable: Agent Runners earn fees from usage

  • Composable: Agents can be chained together

  • Permissionless: Anyone can invoke agents

  • Deterministic AI: On-chain AI with consensus guarantees

Next Steps

Invoking Agents

Base Agents

Last updated