Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .env.enterprise.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
OPENSWARM_ENTERPRISE=true
ENVIRONMENT=development
PORT=8080
DATABASE_URL=postgresql+psycopg://openswarm:openswarm@postgres:5432/openswarm_enterprise
REDIS_URL=redis://redis:6379/0
ENTERPRISE_SECRET_KEY=replace-with-a-long-random-string
# Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
ENTERPRISE_ENCRYPTION_KEY=replace-with-a-fernet-key
ACCESS_TOKEN_MINUTES=480
CORS_ORIGINS=http://localhost:8080
RATE_LIMIT_PER_MINUTE=120
MAX_REQUEST_BYTES=10000000

OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GOOGLE_API_KEY=
FAL_KEY=
SEARCH_API_KEY=
COMPOSIO_API_KEY=

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ cover/
local_settings.py
db.sqlite3
db.sqlite3-journal
*.db
*.db-journal

# Flask stuff:
instance/
Expand Down Expand Up @@ -183,4 +185,4 @@ cython_debug/

.agency_swarm/
third_party/
.claude/
.claude/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

</div>

> **Enterprise edition:** this fork adds a multi-tenant dashboard, REST API, RBAC, durable runs, encrypted provider keys, audit logs, usage records, and Docker deployment. See [docs/enterprise.md](docs/enterprise.md).

**The fully open-source multi-agent system that does everything Claude Code can't.**

Create polished slide decks, research reports, data visualizations, documents, images, and videos — all from a single prompt in your terminal. No platform, no UI, no setup hassles.
Expand Down Expand Up @@ -160,3 +162,4 @@ python server.py # Runs on localhost:8080
MIT — see [LICENSE](LICENSE).

**Built with ❤️ by the team behind [Agency Swarm](https://github.com/VRSEN/agency-swarm)**
<!-- Enterprise edition note: see docs/enterprise.md for the multi-tenant dashboard, REST API, RBAC, durable runs, encrypted secrets, audit logs, and Docker deployment added in this fork. -->
57 changes: 57 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,60 @@ services:
volumes:
- ./mnt:/app/mnt
- ./uploads:/app/uploads

enterprise-api:
profiles:
- enterprise
build: .
command: python -u server.py
ports:
- "8080:8080"
env_file:
- .env.enterprise
environment:
OPENSWARM_ENTERPRISE: "true"
DATABASE_URL: postgresql+psycopg://openswarm:openswarm@postgres:5432/openswarm_enterprise
REDIS_URL: redis://redis:6379/0
depends_on:
- postgres
- redis
volumes:
- ./mnt:/app/mnt
- ./uploads:/app/uploads

enterprise-worker:
profiles:
- enterprise
build: .
command: python -u -m enterprise.worker
env_file:
- .env.enterprise
environment:
OPENSWARM_ENTERPRISE: "true"
DATABASE_URL: postgresql+psycopg://openswarm:openswarm@postgres:5432/openswarm_enterprise
REDIS_URL: redis://redis:6379/0
depends_on:
- postgres
- redis
volumes:
- ./mnt:/app/mnt
- ./uploads:/app/uploads

postgres:
profiles:
- enterprise
image: postgres:16
environment:
POSTGRES_DB: openswarm_enterprise
POSTGRES_USER: openswarm
POSTGRES_PASSWORD: openswarm
volumes:
- postgres-data:/var/lib/postgresql/data

redis:
profiles:
- enterprise
image: redis:7-alpine

volumes:
postgres-data:
44 changes: 44 additions & 0 deletions docs/enterprise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# OpenSwarm Enterprise

OpenSwarm Enterprise adds a multi-tenant control plane around the existing terminal-first OpenSwarm agents. The original `python swarm.py` CLI still starts the Agency Swarm TUI, and `python server.py` still starts the legacy Agency Swarm FastAPI integration unless `OPENSWARM_ENTERPRISE=true` is set.

## Architecture

- `enterprise/main.py` creates the enterprise FastAPI app, OpenAPI docs, dashboard routes, security headers, CORS, request-size limits, and rate limiting.
- `enterprise/models.py` defines organizations, users, workspaces, agent configs, durable swarm runs, agent tasks, artifacts, encrypted provider keys, integration metadata, audit events, and usage records.
- `enterprise/api.py` exposes the enterprise REST API.
- `enterprise/orchestration.py` persists run lifecycle state and provides the adapter point for executing the live Agency Swarm workflow from a worker.
- `enterprise/templates` and `enterprise/static` provide the web dashboard without adding a separate frontend build system.

## Local Development

```powershell
pip install -r requirements.txt -r requirements-dev.txt
Copy-Item .env.enterprise.example .env.enterprise
$env:OPENSWARM_ENTERPRISE = "true"
$env:ENTERPRISE_ENCRYPTION_KEY = python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
python scripts/migrate.py
python scripts/seed_enterprise.py
python server.py
```

Open `http://localhost:8080/login` and sign in with `admin@openswarm.local` / `ChangeMe123!`.

## Docker

```bash
cp .env.enterprise.example .env.enterprise
docker compose --profile enterprise up --build enterprise-api enterprise-worker postgres redis
```

## API

OpenAPI is available at `/api/docs`.

Important endpoints include `POST /api/auth/login`, `GET /api/me`, `GET /api/agents`, `POST /api/workspaces`, `POST /api/runs`, `GET /api/runs/{run_id}/stream`, `GET /api/artifacts/{artifact_id}`, `POST /api/integrations/secrets`, `GET /api/audit`, `GET /healthz`, and `GET /metrics`.

## Security Notes

Provider keys are encrypted with `ENTERPRISE_ENCRYPTION_KEY` and only masked values are returned by the API. Use a stable Fernet key in production, rotate it through a managed secret store, and never leave the example value in place.

All API queries are scoped by `organization_id`. RBAC uses owner, admin, manager, member, and viewer roles.
2 changes: 2 additions & 0 deletions enterprise/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""Enterprise edition package for OpenSwarm."""

15 changes: 15 additions & 0 deletions enterprise/agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ENTERPRISE_AGENTS = [
{
"key": "orchestrator",
"name": "Orchestrator",
"description": "Coordinates requests across the specialist OpenSwarm agents.",
},
{"key": "virtual_assistant", "name": "Virtual Assistant", "description": "Messaging, scheduling, task work, and Composio-powered tools."},
{"key": "deep_research", "name": "Deep Research", "description": "Evidence-based research with citations and balanced analysis."},
{"key": "data_analyst", "name": "Data Analyst", "description": "Structured data analysis, charts, and statistical modeling."},
{"key": "slides_agent", "name": "Slides Agent", "description": "HTML slide generation and PPTX export."},
{"key": "docs_agent", "name": "Docs Agent", "description": "Formatted Word and PDF document generation."},
{"key": "image_generation_agent", "name": "Image Generation Agent", "description": "Image generation and editing through configured providers."},
{"key": "video_generation_agent", "name": "Video Generation Agent", "description": "Video generation, editing, subtitles, and media composition."},
]

Loading