Magic

Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.

5Kstars
Apache-2.0 (modified, multi-tenant SaaS restriction)

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
71/100Good
Development Activity80
Maintenance52
Community72
Maturity40
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture78
Code Quality75
Innovation72
Learning Curve90

Magic is an open-source, enterprise-grade AI agent platform built by Dtyq that bundles a generalist AI agent (Super Magic), a visual workflow engine, an internal messaging (IM) system, and an online collaborative office suite into a single self-hostable product. It’s positioned as infrastructure for running an AI workforce inside an organization — every employee gets a personal AI assistant that can call on specialized “Expert Agents” for departments like legal, finance, sales, and customer support, with digital-employee knowledge staying inside the org instead of walking out the door when staff leave.

Where most personal-AI-assistant tooling hits a wall at enterprise scale, Magic adds the governance layer that’s usually missing: per-department and per-user daily budget caps for LLM spend, a human-in-the-loop approval gate before an agent can perform high-risk actions like deleting files or sending email, tenant-isolated sandbox containers with a dedicated network proxy so a running agent’s data never crosses organizational boundaries, and a mandatory plugin security review before third-party skills can be published. Output isn’t limited to chat text either — a built-in rendering framework turns agent runs directly into finished PPTs, dashboards, reports, and spreadsheets.

Under the hood, Magic is a polyglot monorepo: a Hyperf/Swow-based PHP backend (magic-service) handles chat, workflow, and knowledge-base APIs; a Python service (super-magic) runs the actual agent reasoning loop and tool execution inside sandboxed containers; a Go CLI drives self-hosted cluster deployment end to end (curl -fsSL https://getmagicrew.sh | bash); and a React/Vite frontend (magic-web) ships both an open-source and an enterprise edition from the same codebase. It also advertises compatibility with existing agent-skill ecosystems — both the Anthropic Skills format and OpenClaw skills.

What You Get

  • A personal AI assistant every employee can connect to calendars, email, internal systems, and specialist Expert Agents
  • A visual workflow engine (magic-flow) for building and running automations without hand-writing orchestration code
  • Built-in team messaging (IM) with WeCom, DingTalk, and Lark integrations for progress reporting
  • A rendering framework that turns agent output into finished PPTs, dashboards, reports, and spreadsheets instead of raw chat text
  • A one-command self-hosted deployment script (getmagicrew.sh) that provisions the full cluster
  • Per-department and per-user LLM budget controls with a human approval gate for high-risk agent actions

Common Use Cases

  • Solo founders and one-person teams standing up marketing, legal, and finance functions as agents instead of hiring
  • Enterprises consolidating fragmented ERP/CRM access into reusable “digital employee” agents shared across departments
  • Customer support teams running 24/7 multilingual first-response agents with human escalation for edge cases
  • Finance and ops teams generating live dashboards and reports on demand instead of waiting on a reporting cycle
  • Legal teams routing outbound contracts through a review agent before they reach a client

Under The Hood

Architecture Magic is a polyglot monorepo that separates four concerns into independent services: a Hyperf (Swow coroutine runtime) PHP backend (backend/magic-service) organized in DDD-style layers (app/Domain, app/Application, app/Infrastructure, app/Interfaces) that owns chat/IM, agent orchestration, knowledge base, and MCP integration; a Python agent-execution service (backend/super-magic) built on a custom agentlang framework with declarative .agent definition files for reasoning and tool-use loops, run inside isolated sandbox containers (backend/sandbox-components); a Go CLI (cli/, with deployer/kube/cluster packages) that owns the one-command self-hosted deployment lifecycle; and a React/Vite frontend (frontend/magic-web) split into an open-source src tree and an enterprise-only enterprise/src tree gated by an EDITION flag, alongside a magic-flow visual workflow editor package. The backend also vendors a family of first-party PHP packages (api-response, async-event, cloudfile, flow-expr-engine, rule-engine-core, task-scheduler) that magic-service composes together, so a change to a core abstraction like the flow expression engine ripples through both the vendored package and its Composer consumer.

Tech Stack The API layer runs PHP 8.4+ on Hyperf 3.1 with the Swow coroutine engine, MySQL via hyperf/database, Redis, RabbitMQ (hyperf/amqp), and protobuf tooling for cross-service calls; agent orchestration is Python (Typer CLI, asyncio, python-dotenv) with its own agentlang package and requirements split across runtime and dev dependencies; the CLI is Go using a Cobra-style command layout plus a Kubernetes-facing kube/cluster/deployer layer, implying deployments run on a lightweight cluster; the frontend is TypeScript/React on Vite with a pnpm workspace of dedicated packages (magic-flow, magic-ui, upload-sdk, user-selector), managed via corepack. Docker Compose/Dockerfiles exist per-service, and a shell script wraps everything into a single self-hosting bootstrap flow.

Code Quality Each language carries its own dedicated toolchain: PHPStan level 5 for the PHP backend, with a curated ignore-list for Hyperf’s magic-method-heavy ORM patterns; ESLint plus Vitest for the frontend, with tests colocated in tests directories next to source; Ruff for the Python super-magic service, which also carries an extensive tests/unit and tests/tools suite exercising individual agent tools; and broad _test.go coverage across the Go CLI’s deployer and cluster packages. GitHub Actions builds each subsystem independently, so CI enforces per-service correctness rather than one monolithic pipeline.

What Makes It Unique Magic’s differentiation isn’t the agent loop itself but the enterprise operating model wrapped around it: per-department, per-user, and per-agent spending caps, a mandatory human-approval gate before an agent can execute a high-risk action, tenant-isolated sandbox containers with a dedicated network proxy so agent-fetched data never crosses tenant boundaries, and a “digital employee” marketplace pattern where internal API integrations are packaged once and reused org-wide. It layers this on top of existing agent-skill ecosystems rather than replacing them, explicitly targeting compatibility with both the Anthropic Skills format and OpenClaw skills. This governance-first framing is less common among open-source agent platforms, most of which focus on the reasoning loop or workflow builder rather than the surrounding cost and risk controls.

Self-Hosting

Licensing Model Magic is source-available under a modified Apache License 2.0 — free for commercial use, including as a backend for other applications, but operating a multi-tenant SaaS built on Magic’s source code requires a separate commercial license from Dtyq.

Self-Hosting Restrictions

  • Multi-tenant SaaS operation of the self-hosted source is prohibited without a commercial license from Magic
  • Product logos, trademarks, and copyright notices in the console/applications may not be removed or altered

Enterprise Features

  • Enhanced management capabilities and admin controls
  • Private deployment support with dedicated model integration
  • Deep custom integration with internal enterprise systems

Cloud vs Self-Hosted A hosted cloud version is offered directly (letsmagic.cn for China, magicrew.ai internationally) as a zero-configuration alternative to self-hosting; feature parity between cloud and self-hosted beyond the Enterprise Edition additions above is not documented in the repo.

License Key Required No license key is required for standard self-hosted or commercial use; a commercial license is only required for multi-tenant SaaS resale, arranged directly with Dtyq.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search