Skip to content

chevoisiatesalvati/schwarma-orchestrator

Repository files navigation

AgentSwarm Orchestrator

A multi-agent AI prediction platform built on 0G Compute. Multiple specialized agents collaborate to research questions, reach consensus, and optionally execute on-chain actions.

Architecture & workflow (pitch + dev): see docs/WORKFLOW.md.

Quick Start

# Install dependencies
npm install

# Copy and configure environment
cp .env.example .env
# Edit .env with your 0G Compute and Telegram settings

# Start development
npm run dev

Open http://localhost:5173 to access the dashboard.

Telegram Integration

One-command setup

npm run telegram:dev

This starts everything in one terminal:

  • Orchestrator API server
  • ngrok tunnel (for local webhook)
  • Telegram webhook registration

Press Ctrl+C to stop all services.

Manual Telegram setup

If you prefer manual control:

  1. Install ngrok: https://ngrok.com/download
  2. Set TELEGRAM_BOT_TOKEN and VITE_TELEGRAM_BOT_USERNAME in .env
  3. Start the orchestrator: npm run dev
  4. In another terminal: ngrok http 3001
  5. Set webhook:
    curl "https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/setWebhook?url=https://YOUR-NGROK-URL/webhooks/telegram"

Using Telegram

  1. Click "Connect Telegram" in the dashboard → copy the pairing code
  2. DM the code to your bot (@your_bot_username)
  3. Bot confirms connection, then you can:
    • Send any prediction question
    • Toggle agents on/off with inline buttons
    • Choose workflow (Supervisor/Sequential)
    • Run the swarm and get results

Commands

Command Description
npm run dev Start orchestrator + frontend in watch mode
npm run start Start HTTP API server only
npm run telegram:dev Full local dev setup with ngrok + webhook
npm run demo:btc Run BTC $100k prediction demo
npm run demo:custom Run custom YAML agent demo
npm run demo:eth-personas Three-ETH-persona demo

Environment Variables

Variable Description
TELEGRAM_BOT_TOKEN Bot token from @BotFather
VITE_TELEGRAM_BOT_USERNAME Bot username (without @)
OG_COMPUTE_API_KEY 0G Compute API key (or use wallet auth)
OG_COMPUTE_WALLET_PRIVATE_KEY Wallet for SDK auth
OG_CHAIN_RPC 0G JSON-RPC URL
PUBLIC_APPROVAL_BASE_URL For human approval webhooks

See .env.example for the full list.

Architecture

  • Frontend: React + Vite dashboard for agent selection and results display
  • Orchestrator: LangGraph-based multi-agent workflows (sequential or supervisor-routed)
  • LLM Layer: 0G Compute for decentralized inference
  • Consensus: Weighted voting across agent outputs → confidence score → action trigger
  • Actions: Uniswap trades, HTTP calls, notifications

Project Structure

src/
├── agents/           # Agent definitions, runner, tools
├── orchestrator/     # LangGraph workflows
├── llm/              # 0G Compute client & discovery
├── consensus/        # Weighted voting algorithm
├── actions/          # Uniswap, HTTP, notify
├── telegram/         # Bot, pairing, sessions, conversations
├── data/             # Market data providers
└── index.ts          # HTTP API server

frontend/src/
└── App.tsx           # Dashboard UI

scripts/
└── telegram-dev.sh   # One-command dev setup

License

MIT

About

A multi-agent AI prediction platform built on 0G Compute. Multiple specialized agents collaborate to research questions, reach consensus, and optionally execute on-chain actions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors