Skip to content

OpenSIN-Code/Code-Swarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Code-Swarm — Multi-Agent AI Orchestration System

Status: v0.4.0 Beta | Updated: 2026-05-03 | PR #25: Open — awaiting acceptance gates

📊 Executive Summary

Code-Swarm is a multi-agent orchestration system for software engineering. It combines LangGraph (state management), Simone-MCP (AST-level code operations), and Supabase (persistent storage) into a unified platform for AI-driven development.

Key Metrics

Metric Value Status
API Response Time (p99) <500ms
Uptime Target 99.9%
Concurrent Users 1000+
Data Persistence PostgreSQL (Supabase)
WebSocket Connections 100+ per instance
Rate Limits 100 req/min standard
Security JWT + RBAC + bcrypt

🎯 What's Included

Core Infrastructure

  • FastAPI REST API — 8 endpoints with rate limiting
  • gRPC Service — High-performance agent communication
  • WebSocket Streaming — Real-time status updates with backpressure
  • PostgreSQL + Supabase — Managed database with auth
  • Redis Cache — Session/response caching
  • Prometheus Metrics — System monitoring & alerting
  • Sentry Integration — Error tracking & analysis

Agent System

  • 5 Agent Personas — Zeus, Atlas, Iris, Prometheus, Hermes
  • LangGraph Pipeline — Stateful workflow orchestration
  • Simone-MCP Integration — AST-level code operations
  • Tool Extensions — Find symbols, replace bodies, inject code
  • Memory Layer — Hybrid vector DB (Qdrant + Neo4j optional)

Developer Experience

  • Rich CLI — Beautiful tables, colors, progress bars
  • API Documentation — Swagger/OpenAPI at /docs
  • Comprehensive Guides — MkDocs with 1,200+ lines
  • Docker Support — Container-ready out of box
  • Kubernetes-Ready — Helm chart included

🚀 Quick Start

1. Installation

git clone https://github.com/OpenSIN-Code/Code-Swarm.git
cd Code-Swarm
pip install -e .

2. Configure Environment

cp .env.example .env
# Edit .env with your Supabase URL, Simone-MCP URL, etc.

3. Start Servers

# Terminal 1: API
code-swarm api --host 0.0.0.0 --port 8000

# Terminal 2: gRPC (optional)
python api/grpc_server.py

4. Create Your First Task

# Via CLI
code-swarm create-agent --name solver --role backend

code-swarm create-task --title "Fix login bug" --priority 8 --assign solver

# Via cURL
curl -X POST http://localhost:8000/tasks \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Build API endpoint",
    "assigned_to": "solver",
    "priority": 8
  }'

5. Monitor in Real-Time

# Watch WebSocket updates
wscat -c "ws://localhost:8000/ws/tasks/task_1?token=YOUR_JWT"

# View metrics
curl http://localhost:8000/metrics

📦 Architecture

┌──────────────────────────────────────────────────────────────┐
│                        FastAPI Gateway                        │
│  (REST 8 endpoints + WebSocket + Rate Limiting)               │
├──────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌──────────────┐  ┌────────────────┐       │
│  │ Auth Layer  │  │ RBAC Manager │  │ Metrics/Health │       │
│  └─────────────┘  └──────────────┘  └────────────────┘       │
├──────────────────────────────────────────────────────────────┤
│                   LangGraph Pipeline                          │
│  Orchestrates multi-agent workflows with memory              │
├──────────────────────────────────────────────────────────────┤
│ ┌─────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────────┐ │
│ │  Zeus   │ │ Atlas  │ │  Iris  │ │Promeheus││   Hermes  │ │
│ │(Arch)   │ │(Backend)│ │Frontend││(Planning)│(Coord)    │ │
│ └────────┬┘ └───┬────┘ └───┬────┘ └────┬───┘ └────┬──────┘ │
│          └──────┴───────────┴─────────┬─────────────┘       │
│                                       │                      │
│                              Simone-MCP Bridge               │
│                      (AST-level code operations)             │
├──────────────────────────────────────────────────────────────┤
│               Supabase PostgreSQL + Auth + Realtime           │
│  (Agents, Tasks, Users, Execution Logs, Audit Trail)        │
└──────────────────────────────────────────────────────────────┘

📖 Documentation

Documentation at /docs:

Or generate MkDocs locally:

pip install mkdocs mkdocs-material
mkdocs serve
# Visit http://localhost:8000

🔐 Security

  • JWT Authentication — Supabase-managed
  • RBAC — Role-based access control
  • Rate Limiting — 10-100 req/min per endpoint
  • bcrypt Hashing — Password security
  • No Hardcoded Secrets — All env-vars
  • CORS Protected — Configured origins only
  • WebSocket Auth — Token required on connect
  • Audit Logging — All operations logged

🧪 Testing

# Run all tests
pytest tests/ -v

# Run specific test suite
pytest tests/unit/test_core.py -v
pytest tests/integration/ -v
pytest tests/e2e/ -v

# Coverage
pytest --cov=code_swarm tests/

Current Coverage: 65% (Auth tests skipped pending bcrypt fix)

🚢 Deployment

Vercel (Recommended)

vercel --prod

See Deployment Guide for full setup.

Docker

docker build -t code-swarm .
docker run -p 8000:8000 -e DATABASE_URL=... code-swarm

Kubernetes

helm install code-swarm ./k8s/helm

📊 Monitoring

  • Metrics: Prometheus at /metrics
  • Health: GET /health
  • WebSocket Stats: GET /ws/stats
  • Logs: Structured JSON logging to stdout

🛣️ Roadmap (P2 & Beyond)

Feature Status Target
Self-Improvement RLHF Loop 🔴 TODO Q3 2026
SWE-bench Benchmarking 🔴 TODO Q2 2026
Hybrid Memory (Qdrant + Neo4j) 🔴 TODO Q3 2026
Frontend Dashboard 🔴 TODO Q3 2026
Model Fine-Tuning 🔴 TODO Q4 2026

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md.

📄 License

Apache 2.0 — See LICENSE

🙋 Support


Built with ❤️ by OpenSIN Code

Last Updated: 2026-05-03
Status: v0.4.0 Beta — PR #25 acceptance gates in progress

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors