Skip to content

Architecture

Agent Adapter Runtime is a single self-hosted process that contains everything: the LLM agent brain, the tool surface, persistence, the management dashboard, and the economic plumbing.

One adapter instance = one agent identity = one wallet.

flowchart TB
    service["Target Service<br/>Provider API or MCP Server"]

    subgraph runtime["Agent Adapter Runtime<br/>single self-hosted process"]
        agent["Embedded Agent<br/>Reads platform docs, plans actions,<br/>makes economic decisions, navigates flows,<br/>provider-customizable prompt"]

        subgraph row1[" "]
            registry["Capability Registry<br/>OpenAPI / MCP / Manual"]
            payments["Payment Adapters<br/>x402 / Escrow / MPP / Free"]
            tools["Core Tools<br/>HTTP / Secrets / State / Wallet"]
        end

        subgraph row2[" "]
            jobs["Job Engine<br/>Tracking"]
            persistence["Persistence<br/>SQLite"]
            management["Management API<br/>Dashboard"]
        end

        subgraph row3[" "]
            metrics["Metrics and Billing"]
            drivers["Platform Drivers<br/>Optional plugins"]
        end
    end

    agent -->|"tool calls"| registry
    agent -->|"tool calls"| payments
    agent -->|"tool calls"| tools

    registry -->|"capability calls"| service
    jobs --- persistence
    payments --- management
    tools --- management
    drivers --- agent
    metrics --- jobs

The LLM agent is not a separate process. It runs inside the adapter as an embedded agent loop. When the provider runs agent-adapter run, the agent starts with it.

The agent runs a continuous planning loop:

  1. Check current state (balances, platforms, active jobs, capabilities)
  2. For each registered platform: find tasks, evaluate, bid, execute, deliver
  3. For unregistered platforms: evaluate, register if capabilities match
  4. Housekeeping: heartbeats, credential renewal, state cleanup
  5. Sleep / wait for events, then repeat

Discovers and normalizes capabilities from three sources (OpenAPI, MCP, manual) into a single internal registry. Each capability has a name, schema, pricing, and enabled toggle. See Capabilities.

Pluggable payment protocols that each implement three operations: ensure_secured, settle, and refund. Multiple adapters coexist in one runtime. See Payment Adapters.

Tracks units of economic work through a simple four-state lifecycle: pending → executing → completed | failed. Everything else (bidding, negotiation, escrow) happens outside the job engine, driven by the agent. See Job Model.

Single-file SQLite database. Zero configuration, no external dependencies. Stores wallet info, encrypted secrets, general-purpose state, capability configs, jobs, decision logs, platform registrations, and daily metrics.

HTTP API and web dashboard for the provider to configure capabilities, monitor jobs, edit the agent’s prompt, check wallet balance, and review metrics.

All tools the agent uses follow a namespace convention:

PrefixDomain
net__Network / HTTP
pay_*__Payment adapters
cap__Capability execution
wallet__Wallet operations
secrets__Credential management
state__General persistence
status__Adapter introspection
  • Boring technology - SQLite for storage, standard HTTP for communication, existing Solana libraries for on-chain work. No novel infrastructure.
  • One adapter, one agent - each instance is one economic identity. Multiple personas = multiple instances.
  • Platform drivers are optional - the default path is the agent reading docs and using generic HTTP tools. Drivers are plugins for platforms with complex or brittle flows.