Skip to content

Logos-Flux/cloudflare-multiagent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Cloudflare Multi-Agent

Status: v0.1.0 public preview — see KNOWN_ISSUES.md for the path to v1.0.0.

Overview

Cloudflare Multi-Agent is a production-ready multi-agent AI platform built on Cloudflare Workers infrastructure. It provides a generic, flexible, and portable platform for AI-powered services that can be consumed by any authenticated application.

Key Features

  • Hierarchical Instance Management: Organization → Instance → Project
  • Provider-Agnostic: Extensible framework for multiple AI providers
  • Production-Ready: Rate limiting, error handling, monitoring, CI/CD

Architecture

Organization (e.g., Acme Corp)
  └── Instance (like a VM - "production", "staging")
      ├── API Keys (shared across projects)
      ├── Rate Limits (shared pool)
      ├── Workers (dedicated deployments)
      │   ├── Image Generation (Ideogram)
      │   └── Text Generation (OpenAI, Anthropic)
      └── Projects (logical groupings)

MVP Scope

In Scope

  • Config Service (D1 database + worker)
  • Image Generation Worker (Ideogram provider)
  • Text Generation Worker (OpenAI, Anthropic)
  • Rate Limiting (Durable Objects)
  • R2 Storage Integration
  • Authentication & Authorization
  • Deployment Automation (GitHub Actions)
  • Testing GUIs & Admin Interface

Out of Scope (Future)

  • Video generation
  • Advanced billing/usage tiers
  • Multi-tenancy (single org for MVP)

Multi-Agent Development Structure

Project Manager (Human)
├── Team Leader 1: Infrastructure (Phase 1 - Sequential)
│   ├── Agent 1.1: Database Schema
│   ├── Agent 1.2: Config Service Worker
│   ├── Agent 1.3: Authentication Middleware
│   └── Agent 1.4: Instance Lookup Logic
├── Team Leaders 2 & 3: Workers + Ops (Phase 2 - Parallel)
│   ├── Team 2: Worker Implementation
│   │   ├── Agent 2.1: Provider Adapter Framework
│   │   ├── Agent 2.2: Rate Limiter (Durable Objects)
│   │   ├── Agent 2.3: R2 Storage Manager
│   │   └── Agent 2.4: Image Generation Worker
│   └── Team 3: Operations
│       ├── Agent 3.1: Error Handling & Retries
│       ├── Agent 3.2: Logging System
│       ├── Agent 3.3: Deployment Scripts
│       └── Agent 3.4: GitHub Actions CI/CD
└── Team Leader 4: Interfaces (Phase 3 - Sequential)
    ├── Agent 4.1: Testing GUI
    ├── Agent 4.2: Admin Interface
    ├── Agent 4.3: Documentation
    └── Agent 4.4: Monitoring Dashboard

Quick Start

Prerequisites

  • Node.js 18+
  • Cloudflare account
  • Wrangler CLI (npm install -g wrangler)

Setup

# Clone repository
git clone https://github.com/Logos-Flux/cloudflare-multiagent.git
cd cloudflare-multiagent

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env with your Cloudflare credentials

# Deploy infrastructure
npm run deploy-instance -- --config instances/production.json

Project Structure

/
├── docs/                    # Documentation and specifications
│   └── specs/              # Shared specs for all agents
├── infrastructure/          # Core infrastructure components
│   ├── database/           # D1 schema and migrations
│   ├── config-service/     # Central config management
│   ├── auth/               # Authentication middleware
│   └── lookup/             # Instance resolution
├── workers/                 # Cloudflare Workers
│   ├── shared/             # Shared utilities
│   │   ├── provider-adapters/
│   │   ├── rate-limiter/
│   │   ├── r2-manager/
│   │   ├── error-handling/
│   │   └── logging/
│   ├── image-gen/          # Image generation worker
│   └── text-gen/           # Text generation worker
├── interfaces/              # User-facing interfaces
│   ├── testing-gui/        # Image generation testing
│   ├── text-testing-gui/   # Text generation testing
│   ├── admin-panel/        # Instance management
│   └── monitoring/         # Dashboard
├── scripts/                 # Deployment automation
├── tests/                   # Test suites
└── prompts/                 # Multi-agent prompts

Development

Running Tests

npm test              # Run all tests
npm run test:watch    # Watch mode
npm run test:coverage # With coverage

Deploying Workers

npm run wrangler:dev    # Local development
npm run wrangler:deploy # Deploy to Cloudflare

Managing Instances

npm run deploy-instance -- --config config.json
npm run deploy-all      # Deploy all instances

Monitoring Progress

Track multi-agent development:

# Watch git commits from all agents
git log --all --oneline --graph

# Count completed agents
git log --all --grep="\[AGENT.*complete" | wc -l

# Check for escalations
git log --all --grep="ESCALATION"

Technical Stack

  • Compute: Cloudflare Workers
  • Database: D1 (SQLite)
  • Storage: R2
  • Cache: KV
  • State: Durable Objects
  • CI/CD: GitHub Actions
  • Language: TypeScript
  • Testing: Vitest

Success Criteria

  • ✅ Config Service deployed and responding
  • ✅ Image Gen Worker functional with Ideogram
  • Text Gen Worker functional with OpenAI & Anthropic
  • ✅ Rate limiting operational
  • ✅ Testing GUIs accessible (image + text)
  • ✅ Admin panel functional with Deployments tracking
  • ✅ 2 instances deployed (production + development)
  • ✅ All tests passing
  • ✅ CI/CD pipeline working
  • ✅ Custom domains configured (example.com)

License

MIT

Contributing

This project is built autonomously by AI agents. Human oversight for:

  • Final approval before production merge
  • Architectural decisions
  • Credential management
  • Monitoring and incident response

Adding New Workers/Services

When creating a new worker or service:

  1. Add it to the Admin Panel Services page - See interfaces/admin-panel/ADDING_SERVICES.md
  2. Follow the PR template - Complete the "New Service Checklist"
  3. Document your API - Include endpoints, examples, and usage instructions
  4. Create a Testing GUI (if user-facing) - Make it easy for others to try your service

This ensures all services are discoverable and properly documented for the team.


Built with Claude Code | Powered by Cloudflare Workers | Autonomous Multi-Agent Development

About

Multi-agent AI platform on Cloudflare Workers — public preview (v0.1.x)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors