MassGen多智能体系统 是 AI Skill Hub 本期精选AI工具之一。已获得 1.0k 颗 GitHub Star,综合评分 7.8 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
MassGen多智能体系统 是一款基于 Python 开发的开源工具,专注于 多智能体、MCP协议、自主代理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
MassGen多智能体系统 是一款基于 Python 开发的开源工具,专注于 多智能体、MCP协议、自主代理 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install massgen
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install massgen
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/massgen/MassGen
cd MassGen
pip install -e .
# 验证安装
python -c "import massgen; print('安装成功')"
# 命令行使用
massgen --help
# 基本用法
massgen input_file -o output_file
# Python 代码中调用
import massgen
# 示例
result = massgen.process("input")
print(result)
# massgen 配置文件示例(config.yml) app: name: "massgen" debug: false log_level: "INFO" # 运行时指定配置文件 massgen --config config.yml # 或通过环境变量配置 export MASSGEN_API_KEY="your-key" export MASSGEN_OUTPUT_DIR="./output"
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="assets/logo-dark.png"> <source media="(prefers-color-scheme: light)" srcset="assets/logo.png"> <img src="assets/logo.png" alt="MassGen Logo" width="360" /> </picture> </p>
</div>
</div>
<p align="center"> <i>MassGen is a cutting-edge multi-agent system that leverages the power of collaborative AI to solve complex tasks.</i> </p>
<p align="center"> <a href="https://www.youtube.com/watch?v=5JofXWf_Ok8"> <img src="docs/source/_static/images/readme.gif" alt="MassGen example" width="800"> </a> </p>
<p align="center"> <i>Scaling AI with collaborative, continuously improving agents (4x speed)</i> </p>
MassGen is a cutting-edge multi-agent framework that coordinates AI agents to solve complex tasks through redundancy and iterative refinement. Every agent tackles the full problem, observing, critiquing, and building on each other's work across cycles of refinement and restarts. When agents believe there is a strong enough answer, they vote, and the best collectively validated answer wins. This approach to parallel refinement and collective validation lays the groundwork for principled multi-agent scaling, where the system continuously improves its outputs by leveraging diverse agent perspectives and enforcing quality through consensus.
This project started with the "threads of thought" and "iterative refinement" ideas presented in The Myth of Reasoning, and extends the classic "multi-agent conversation" idea in AG2. Here is a video recording of the background context introduction presented at the Berkeley Agentic AI Summit 2025.
<p align="center"> <b>🧩 Use MassGen as a Skill:</b> <code>npx skills add massgen/skills --all</code> — then type invoke the skill in Claude Code, Cursor, Copilot, or 40+ other agents. <a href="https://github.com/massgen/skills">Learn more →</a> </p>
<p align="center"> <b>📚 For Contributors:</b> See <a href="https://massgen.github.io/Handbook/">MassGen Contributor Handbook</a> - Centralized policies and resources for development and research teams </p>
---
| Feature | Description |
|---|---|
| **🤝 Cross-Model/Agent Synergy** | Harness strengths from diverse frontier model-powered agents |
| **⚡ Parallel Processing** | Multiple agents tackle problems simultaneously |
| **👥 Intelligence Sharing** | Agents share and learn from each other's work |
| **🔄 Consensus Building** | Natural convergence through collaborative refinement |
| **🖥️ Live Visualization** | Interactive Textual TUI with timeline, agent cards, and vote tracking (default). Also available: Web UI, Rich display. |
---
🎉 Released: May 22, 2026
What's New in v0.1.89: - 🛰️ Full Antigravity CLI Integration - Hardens the first Antigravity backend with workflow-mode parity, auth checks, and reliable workspace writes. - 🧰 Workspace Project Anchoring - MassGen now passes --add-dir <cwd> and anchors .antigravitycli/ in the workspace so agy writes files where other agents and snapshots can see them. - 🔌 Native Hooks + Prompt Guardrails - Antigravity hooks now use standalone hooks.json with enableJsonHooks, and subagent affordances are hidden when subagents are disabled.
Try v0.1.89 Features:
pip install massgen==0.1.89
curl -fsSL https://antigravity.google/cli/install.sh | bash
uv run massgen --config massgen/configs/features/fast_iteration_gemini_antigravity.yaml "Create an svg of an AI agent coding."
→ See full release history and examples
---
uv run massgen --setup
massgen --setup
massgen --config @examples/tools/mcp/multimcp_gemini \ "Find the best restaurants in Paris and save the recommendations to a file"
**Configuration:**
yaml agents: # Basic MCP Configuration: backend: type: "openai" # Your backend choice model: "gpt-5-mini" # Your model choice
# Add MCP servers here mcp_servers: weather: # Server name (you choose this) type: "stdio" # Communication type command: "npx" # Command to run args: ["-y", "@modelcontextprotocol/server-weather"] # MCP server package
# That's it! The agent can now check weather.
# Multiple MCP Tools Example: backend: type: "gemini" model: "gemini-3.0-pro-preview" mcp_servers: # Web search search: type: "stdio" command: "npx" args: ["-y", "@modelcontextprotocol/server-brave-search"] env: BRAVE_API_KEY: "${BRAVE_API_KEY}" # Set in .env file
# HTTP-based MCP server (streamable-http transport) custodm_api: type: "streamable-http" # For HTTP/SSE servers url: "http://localhost:8080/mcp/sse" # Server endpoint
# Tool configuration (MCP tools are auto-discovered) allowed_tools: # Optional: whitelist specific tools - "mcpweatherget_current_weather" - "mcp__test_server__mcp_echo" - "mcp__test_server__add_numbers"
exclude_tools: # Optional: blacklist specific tools - "mcp__test_server__current_time"
→ [View more MCP examples](massgen/configs/tools/mcp/)
→ For comprehensive MCP integration guide, see [MCP Integration](https://docs.massgen.ai/en/latest/user_guide/mcp_integration.html)
#### **4. File System Operations & Workspace Management**
MassGen provides comprehensive file system support through multiple backends, enabling agents to read, write, and manipulate files in organized workspaces.
**Filesystem Configuration Parameters:**
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `cwd` | string | **Yes** (for file ops) | Working directory for file operations (agent-specific workspace) |
| `snapshot_storage` | string | Yes | Directory for workspace snapshots |
| `agent_temporary_workspace` | string | Yes | Parent directory for temporary workspaces |
**Quick Start Commands:**
bash
massgen --config @examples/basic/multi/gemini_gpt5_claude \ "Give me all the talks on agent frameworks in Berkeley Agentic AI Summit 2025"
**Creative Writing:**bash
massgen --config @examples/tools/code-execution/multi_agent_playwright_automation \ "Browse three issues in https://github.com/Leezekun/MassGen and suggest documentation improvements. Include screenshots and suggestions in a website."
Method 1: PyPI Installation (Recommended - Python 3.11+):
```bash
pip install massgen
uv run massgen --setup
uv run massgen --setup-skills
massgen --setup-skills
agents: - id: "file-agent" backend: type: "claude_code" # Backend with file support cwd: "workspace" # Isolated workspace for file operations
uv run massgen --config @examples/basic/multi/three_agents_default "Your question"
→ See [Installation Guide](https://docs.massgen.ai/en/latest/quickstart/installation.html) for complete setup instructions.
**Method 2: Development Installation** (for contributors):
**Clone the repository**bash git clone https://github.com/Leezekun/MassGen.git cd MassGen
**Install in editable mode with pip**
**Option 1 (recommended): Installing with uv (faster)**
bash uv venv source .venv/bin/activate # Windows: .venv\Scripts\activate uv pip install -e .
uv run massgen --config @examples/basic/multi/three_agents_default "Your question" ```
massgen --config @examples/tools/filesystem/gpt5mini_cc_fs_context_path "Enhance the website with: 1) A dark/light theme toggle with smooth transitions, 2) An interactive feature that helps users engage with the blog content (your choice - could be search, filtering by topic, reading time estimates, social sharing, reactions, etc.), and 3) Visual polish with CSS animations or transitions that make the site feel more modern and responsive. Use vanilla JavaScript and be creative with the implementation details."
**Configuration:**
yaml
```bash
→ Full automation guide with examples: Automation Guide
Topics covered: - Complete automation patterns with error handling - Parallel experiment execution - Performance tips and troubleshooting
uv run massgen --quickstart
The `--setup` command will:
- Configure your API keys (OpenAI, Anthropic, Google, xAI)
- Offer to set up Docker images for code execution
- Offer to install skills (openskills, Anthropic/OpenAI/Vercel collections, Agent Browser skill, Crawl4AI)
The `--quickstart` command will:
- Ask how many agents you want (1-5, default 3)
- Ask which backend/model for each agent
- For GPT-5x models, ask for `reasoning.effort` (`low|medium|high`; Codex GPT-5 models also include `xhigh`)
- Auto-detect Docker availability and configure execution mode
- If Docker mode is selected, show a Skills step where you can choose package(s) (`openskills`-based Anthropic/OpenAI/Vercel/Agent Browser plus Crawl4AI) and install them in-place with live status
- Create a ready-to-use config and launch into interactive TUI mode
**🤖 Use MassGen from Your AI Coding Agent:**
Install the [MassGen skill](https://github.com/massgen/skills) to invoke MassGen directly from Claude Code, OpenAI Codex, GitHub Copilot, Cursor, and [40+ other agents](https://skills.sh) that support the [Agent Skills](https://agentskills.io/home) standard:
bash npx skills add massgen/skills
Then use `/massgen` (Claude Code) or `$massgen` (Codex) to run multi-agent evaluation, planning, spec writing, or any general task. See the [skills docs](https://docs.massgen.ai/en/latest/user_guide/skills.html) for per-agent install options.
**🖥️ Textual TUI (Default Display Mode):**
MassGen launches with an interactive Terminal User Interface (TUI) by default, providing:
- 📊 **Real-time timeline** of all agent activities
- 🎯 **Individual agent status cards** for each team member
- 🗳️ **Vote visualization** and consensus tracking
- 💬 **Multi-turn conversation** management
- ⌨️ **Keyboard controls** for navigation (↑/↓ to scroll, 'q' to cancel)
**Legacy Rich display:**bash massgen --display rich "Your question"
**Alternative: Full Setup Wizard**
For more control, use the full configuration wizard:bash uv run massgen --init
This guides you through use case selection (Research, Code, Q&A, etc.) and advanced configuration options.
**After setup:**bash
uv run ./scripts/init.sh
pip install -e ".[external]"
./scripts/init.sh
Create a .env file in your working directory with your API keys:
```bash
OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... GOOGLE_API_KEY=... XAI_API_KEY=...
CEREBRAS_API_KEY=... TOGETHER_API_KEY=... GROQ_API_KEY=... OPENROUTER_API_KEY=... ```
MassGen automatically loads API keys from .env in your current directory.
→ Complete setup guide with all providers: See API Key Configuration in the docs
Get API keys: - OpenAI | Claude | Gemini | Grok - Azure OpenAI | Cerebras | OpenRouter | More providers...
massgen serve --host 0.0.0.0 --port 4000 --config path/to/config.yaml --default-model gpt-5
**Endpoints**
- `GET /health`
- `POST /v1/chat/completions` (supports `stream: true` SSE and OpenAI-style tool calling)
**cURL examples**
bash
uv run python -m massgen.cli --model claude-sonnet-4-5-20250929 "What is machine learning?" uv run python -m massgen.cli --model gemini-3-pro-preview "Explain quantum computing" uv run python -m massgen.cli --model gpt-5-nano "Summarize the latest AI developments"
**Configuration:**
Use the `agent` field to define a single agent with its backend and settings:
yaml agent: id: "<agent_name>" backend: type: "azure_openai" | "chatcompletion" | "claude" | "claude_code" | "gemini" | "grok" | "openai" | "zai" | "lmstudio" #Type of backend model: "<model_name>" # Model name api_key: "<optional_key>" # API key for backend. Uses env vars by default. system_message: "..." # System Message for Single Agent
→ [See all single agent configs](massgen/configs/basic/single/)
#### **2. Multi-Agent Collaboration (Recommended)**
**Configuration:**
Use the `agents` field to define multiple agents, each with its own backend and config:
**Quick Start Commands:**
bash
uv run python -m massgen.cli \ --backend claude_code \ --model sonnet \ "Create a Flask web app with authentication"
MassGen configurations are organized by features and use cases. See the Configuration Guide for detailed organization and examples.
Quick navigation: - Basic setups: Single agent | Multi-agent - Tool integrations: MCP servers | Web search | Filesystem - Provider examples: OpenAI | Claude | Gemini - Specialized teams: Creative | Research | Development
See MCP server setup guides: Discord MCP | Twitter MCP
For detailed configuration of all supported backends (OpenAI, Claude, Gemini, Grok, etc.), see:
MassGen supports an interactive mode where you can have ongoing conversations with the system:
```bash
uv run python -m massgen.cli \ --config massgen/configs/basic/multi/three_agents_default.yaml ```
Interactive Mode Features: - Multi-turn conversations: Multiple agents collaborate to chat with you in an ongoing conversation - Real-time coordination tracking: Live visualization of agent interactions, votes, and decision-making processes - Real-time feedback: Displays real-time agent and system status with enhanced coordination visualization - Multi-line input: Use """ or ''' to enter multi-line messages - Slash commands: - /help or /h - Show available commands - /status - Display current system status - /config - Open the configuration file - /clear or /reset - Clear conversation history and start fresh - /quit, /exit, or /q - Exit the session (or press Ctrl+C)
Watch the recorded demo:
npm install -g @anthropic-ai/claude-code
Use MassGen programmatically with the familiar LiteLLM/OpenAI interface:
```python from dotenv import load_dotenv load_dotenv() # Load API keys from .env
import litellm from massgen import register_with_litellm
register_with_litellm()
The system currently supports multiple model providers with advanced capabilities:
API-based Models: - OpenAI: GPT-5.2 (recommended default), GPT-5.1, GPT-5 series (GPT-5, GPT-5-mini, GPT-5-nano), GPT-5.1-Codex series, GPT-4.1 series, GPT-4o, o4-mini with reasoning, web search, code interpreter, and computer-use support - Note: We recommend GPT-5.2/5.1/5 over Codex models. Codex models are optimized for shorter system messages and may not work well with MassGen's coordination prompts. - Reasoning: GPT-5.1 and GPT-5.2 default to reasoning: none. MassGen automatically sets reasoning.effort: medium when no reasoning config is provided, matching GPT-5's default behavior. - Azure OpenAI: Any Azure-deployed models (GPT-4, GPT-4o, GPT-35-turbo, etc.) - Claude / Anthropic: Claude Opus 4.5, Claude Haiku 4.5, Claude Sonnet 4.5, Claude Opus 4.1, Claude Sonnet 4 - Advanced tooling: web search, code execution, Files API, programmatic tool calling, tool search with deferred loading - Claude Code: Native Claude Code SDK with server-side session persistence and built-in dev tools - Gemini: Gemini 3 Pro, Gemini 2.5 Flash, Gemini 2.5 Pro with code execution and grounding - Antigravity CLI: Google's agy CLI as a MassGen backend, with hardened workspace isolation, workflow-tool fallback, native hooks, and Gemini-tier server-side model selection - Grok / xAI: Grok-4.1, Grok-4, Grok-3, Grok-3-mini with Grok Live Search - Cerebras AI: Ultra-fast inference for supported models - Together AI, Fireworks AI, Groq: Fast inference for LLaMA, Mistral, Qwen, and other open models - OpenRouter: Multi-model aggregator with dynamic model listing (400+ models) - Kimi / Moonshot: Chinese AI models via OpenAI-compatible API - Nebius AI Studio: Cloud inference platform - POE: Quora AI platform with dynamic model discovery - Qwen / Alibaba: DashScope API for Qwen models - Z AI / Zhipu: GLM-4.5 and related models
Local Model Support: - vLLM & SGLang: Unified inference backend supporting both vLLM and SGLang servers - vLLM (port 8000) and SGLang (port 30000) with OpenAI-compatible API - Support for top_k, repetition_penalty, chat_template_kwargs parameters - SGLang-specific separate_reasoning parameter for thinking models - Mixed server deployments with configuration example: two_qwen_vllm_sglang.yaml
→ For complete model list and configuration details, see Supported Models
MassGen agents can leverage various tools to enhance their problem-solving capabilities:
→ For detailed backend capabilities and tool support matrix, see User Guide - Backends
---
agents: - id: "code-reviewer" backend: type: "claude_code" cwd: "workspace" # Agent's isolated work area
orchestrator: context_paths: - path: "." # Current directory (relative path) permission: "write" # Final agent can create/modify files protected_paths: # Optional: files immune from modification - ".env" - "config.json" - path: "/home/user/my-project/src" # Absolute path example permission: "read" # Agents can analyze your code
→ For LLM agents: See AI_USAGE.md for complete command-line usage guide
MassGen provides automation mode designed for LLM agents and programmatic workflows:
massgen --config @examples/basic/multi/three_agents_default
massgen --config @examples/basic/multi/three_agents_default \ --debug "Your question" ```
MassGen 是一个前沿模型驱动的智能系统,旨在通过多种前沿模型和智能代理的协同工作来实现强大的智能能力。它提供了多种功能,包括跨模型代理协同工作、并行处理、智能信息共享和共识形成等。
MassGen 的主要功能包括: * 跨模型/代理协同工作 * 并行处理 * 智能信息共享 * 共识形成 * 支持多种前沿模型和智能代理
MassGen 的环境依赖和系统要求包括: * Python 3.11+ * OpenAI、Anthropic、Google 和 xAI 的 API 密钥 * Docker 镜像 * 依赖的技能(openskills、Anthropic/OpenAI/Vercel 集合、Agent Browser 技能、Crawl4AI)
MassGen 的安装步骤包括: * 使用 pip 安装 MassGen * 使用 Docker 安装 MassGen * 从源码安装 MassGen * 配置 API 密钥和 Docker 镜像 * 安装依赖的技能
MassGen 的使用教程包括: * 快速启动 * 配置 MCP 和环境变量 * 使用 MassGen 命令行界面 * 使用 MassGen API
MassGen 的配置说明包括: * MCP 配置 * 环境变量配置 * 关键参数配置 * 使用 MassGen API
MassGen 的 API/接口说明包括: * Claude Code CLI * Python API 和 LiteLLM
MassGen 的工作流/模块说明包括: * 支持的模型和工具 * 基本项目集成 * 自动化和 LLM 集成
MassGen 的 FAQ 摘要包括: * 常见问题 * 使用 MassGen 的注意事项 * MassGen 的限制和局限性
aiskill88点评:创新的多智能体框架,MCP协议支持完善,社区活跃度中等。代理协作能力强劲,生态还需扩展完善。
该工具使用 NOASSERTION 协议,商用场景请仔细阅读协议条款,必要时咨询法律意见。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
📄 NOASSERTION — 请查阅原始协议条款了解具体使用限制。
经综合评估,MassGen多智能体系统 在AI工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | MassGen |
| 原始描述 | 开源MCP工具:🚀 MassGen is an open-source multi-agent scaling system that runs in your termin。⭐1.0k · Python |
| Topics | 多智能体MCP协议自主代理协作AI命令行工具 |
| GitHub | https://github.com/massgen/MassGen |
| License | NOASSERTION |
| 语言 | Python |
收录时间:2026-05-20 · 更新时间:2026-05-21 · License:NOASSERTION · AI Skill Hub 不对第三方内容的准确性作法律背书。