Scholar Swarm

AutoGPT for serious research. 5 iNFT agents, real sources, TEE-attested inference, on-chain payout.

Scholar Swarm

Created At

Open Agents

Project Description

Scholar Swarm is a decentralized research economy where five specialist iNFT agents (Planner, two Researchers, Critic, Synthesizer) coordinate to produce verifiable research reports for paying users.

Three mechanisms make our outputs trustworthy where AutoGPT-style agents can't:

  1. Real source fetching. Researchers retrieve web pages via a self-hosted SearXNG instance running on an EU VPS (Tavily MCP also ships as a swappable RetrievalProvider). Every claim carries a URL, no more "I read in some study…".

  2. Critic verification. An independent agent fetches each cited URL and runs a separate attested LLM check: does this excerpt actually support this claim? Per-claim rationale is stored on 0G Storage with the reasonURI committed on-chain.

  3. TEE-attested inference. Every LLM call runs on 0G Compute inside a dstack TEE. The signed attestation proves which model produced what, replayable by any third party.

The economic loop is closed entirely on-chain: a user posts a research bounty on 0G Galileo, agents bid and work, and the Bounty contract itself fires a LayerZero V2 cross-chain message on synthesis. KeeperHub's live workflow on Base Sepolia picks up the DistributeRequested event and pays out USDC to all five agent wallets, no trusted relayer sits in the critical path. End-to-end proven on testnet: 1.0 Circle USDC moved across 5 distinct operator wallets in 0.7 seconds via KH Direct Execution (verifiable at https://sepolia.basescan.org/tx/0xa06717e4495a6df75d1127bd3b61bbc18884c91cca97c04071857589cf00f0b7).

The user gets a research report where every statement traces back to a fetched URL, every inference is cryptographically attested, and every contributor was paid for verified work. The full swarm runs continuously on an EU VPS with a 6-hour cron-driven auto-bounty cadence, the live status badge on scholar-swarm.vercel.app reflects the most recent run.

How it's Made

Two-chain architecture by design. 0G Galileo Testnet (chainId 16602) hosts the agent economy: ERC-7857 iNFTs + ERC-8004 reputation registry unified in AgentNFT, the Bounty state machine, AgentRoyaltyVault (95/5 owner/creator split), and the BountyMessenger LayerZero V2 OApp. Base Sepolia (84532) hosts payment rails: PaymentRouter for USDC escrow and PaymentMessenger as the LZ V2 receiver. 9 unique smart contracts deployed (7 on 0G Galileo, 2 on Base Sepolia), all open source under MIT.

Agent runtimes are TypeScript on top of @scholar-swarm/sdk — a swarm-first agent framework with pluggable Inference / Storage / Messaging / Retrieval / Payment / Reputation provider interfaces. The 0G Compute adapter wraps @0glabs/0g-serving-broker (v0.7.5) for TEE-attested chat completions; the 0G Storage adapter uses @0gfoundation/0g-ts-sdk to commit merkle-rooted JSON blobs; the messaging adapter wraps Gensyn AXL's local HTTP API as an in-process MessagingProvider. Two RetrievalProvider impls — self-hosted SearXNG (live on the EU VPS, primary path) and Tavily MCP (alternative) — ship in @scholar-swarm/mcp-tools.

KeeperHub integrates on three surfaces simultaneously: REST Direct Execution API (the keeper Para wallet is whitelisted on PaymentRouter — we never hold its key), the hosted MCP server at app.keeperhub.com/mcp via @modelcontextprotocol/sdk Streamable HTTP transport (26 tools live), and a persisted workflow on the org (id nepsavmovlyko0luy3rpi) that watches DistributeRequested events and calls PaymentRouter.distribute() through KH's Direct Execution layer for gas estimation, retry, and audit logging.

The non-obvious technical move: Bounty.submitSynthesis is payable. When the synthesizer agent commits the final report root on 0G, the Bounty contract atomically calls BountyMessenger.notifyCompletion{value: lzFee} in the same transaction. The factory transfers ownership of the messenger to itself, so every newly cloned bounty is auto-authorized to send LZ messages at creation time via createBountyWithSettlement. The result: no off-chain coordinator runs the cross-chain payout path, the contract itself is the dispatcher.

The swarm is also continuously deployed: five scholar-axl-{planner,r1,r2,critic,synth}.service systemd units coordinate with five agent runtime services (all Restart=always) on an EU VPS, and a cron at /etc/cron.d/scholar-swarm fires pnpm spike:18:cli every six hours. The most recent successful auto-run is in docs/vps-runs/latest.json; the live frontend reads it and renders a pulsing "VPS swarm live" badge.

Tested with 42 Foundry unit tests (Solidity 0.8.27 + via_ir) and 19 spike scripts (19/19 PASS) covering 0G Compute, 0G Storage, AXL mesh (including a TR-laptop ↔ EU-VPS cross-ISP round-trip), MCP-over-AXL, KH Direct Execution, KH MCP, LayerZero V2 cross-chain, iNFT royalty splits, full Bounty lifecycle, atomic LZ fire on synthesis, multi-process choreography (5 OS processes / 5 AXL nodes / 5 0G Compute ledgers / 5 operator wallets coordinated end-to-end on bounty 20), and a real Circle USDC distribute() across 5 wallets via KH Direct Execution. All proofs in docs/spike-artifacts/.

background image mobile

Join the mailing list

Get the latest news and updates

Scholar Swarm | ETHGlobal