MassGen: Multi-Agent Scaling System for GenAI#

MassGen Logo MassGen Logo

PyPI GitHub Stars Python 3.11+ License

Follow on X Follow on LinkedIn Join our Discord


Multi-agent scaling through intelligent collaboration

MassGen Demo - Multi-agent collaboration in action MassGen Demo - Multi-agent collaboration in action

MassGen is a cutting-edge multi-agent system that leverages the power of collaborative AI to solve complex tasks. It assigns a task to multiple AI agents who work in parallel, observe each other’s progress, and refine their approaches to converge on the best solution to deliver a comprehensive and high-quality result. The power of this “parallel study group” approach is exemplified by advanced systems like xAI’s Grok Heavy and Google DeepMind’s Gemini Deep Think.

What is MassGen?#

MassGen assigns your task to multiple AI agents who work in parallel, observe each other’s progress, and refine their approaches to converge on the best solution. The system delivers comprehensive, high-quality results by leveraging the collective intelligence of multiple AI models.

How It Works:

  • Work in Parallel - Multiple agents tackle the problem simultaneously, each bringing unique capabilities

  • See Recent Answers - At each step, agents view the most recent answers from other agents

  • Decide Next Action - Each agent chooses to provide a new answer or vote for an existing answer

  • Share Workspaces - When agents provide answers, their workspace is captured so others can review their work

  • Natural Consensus - Coordination continues until all agents vote, then the agent with most votes presents the final answer

Think of it as a “parallel study group” for AI - inspired by advanced systems like xAI’s Grok Heavy and Google DeepMind’s Gemini Deep Think. Agents learn from each other to produce better results than any single agent could achieve alone.

This project extends the classic “multi-agent conversation” idea from AG2 with “threads of thought” and “iterative refinement” concepts presented in The Myth of Reasoning.

Key Features#

🤝 Cross-Model Synergy

Use Claude, Gemini, GPT, Grok, and other models together - each agent can use a different model.

⚡ Parallel Coordination

Multiple agents work simultaneously with voting and consensus detection.

🛠️ MCP Integration

Model Context Protocol support for tools via YAML configuration.

🔗 Framework Interoperability

Integrate external frameworks (AG2, LangGraph, AgentScope, OpenAI, SmolAgent) as tools within MassGen’s coordination.

📊 Live Visualization

Real-time terminal display showing agents’ working processes and coordination.

🔒 File Operation Safety

Read-before-delete enforcement and workspace isolation for secure file operations.

🔄 Multi-Turn Interactive Mode

Continue conversations across multiple turns with full context preservation and session management.

📁 Project Integration

Work directly with your codebase using context paths with granular read/write permissions.

Recent Releases#

v0.1.13 (November 17, 2025) - Code-Based Tools, MCP Registry & Skills Installation

Code-based tools system implementing CodeAct paradigm with significant token usage reduction through importable Python code instead of schema-based tools. MCP server registry with auto-discovery and intelligent tool routing. Comprehensive skills installation system with cross-platform automated installer for openskills CLI, Anthropic skills, and Crawl4AI. NLIP (Natural Language Interface Protocol) integration for advanced tool routing across all backends. TOOL.md documentation standard with YAML frontmatter for all custom tools.

v0.1.12 (November 14, 2025) - System Prompt Refactoring, Semantic Search & Multi-Agent Computer Use

Complete system prompt refactoring with hierarchical structure and XML-based formatting for improved LLM attention management. New Semtools skill for semantic search via embedding-based similarity and Serena skill for symbol-level code understanding via LSP integration. Enhanced multi-agent computer use with Docker integration for Linux desktop automation, VNC visualization, and coordinated Claude (Docker/Linux) + Gemini (Browser) workflows.

v0.1.11 (November 12, 2025) - Skills System, Memory MCP & Rate Limiting

Modular skills framework with automatic discovery and file search capabilities, MCP-based memory management with persistent markdown storage and cross-agent sharing, multi-dimensional rate limiting (RPM, TPM, RPD) with model-specific thresholds, and memory-filesystem integration for advanced workflows.

Quick Start#

Get started with MassGen in minutes:

Install:

pip install massgen

Option 1: Use the setup wizard (recommended for first time):

# Run without arguments to launch the interactive setup wizard
massgen

The wizard will guide you through configuring your API keys and creating your first agent team.

After setup, you can:

# Run a single query with your configured agents
massgen "Your question here"

# Or start an interactive conversation (no prompt needed)
massgen

Option 2: Quick single-agent test:

# No config needed - specify model directly
massgen --model gemini-2.5-flash "What are LLM agents?"

Option 3: Multi-agent collaboration:

# Use a built-in configuration
massgen --config @examples/basic/multi/three_agents_default \
  "What are the pros and cons of renewable energy?"

Watch agents discuss, vote, and converge on the best answer in real-time!

Ready to dive deeper?

Supported Models#

MassGen supports a wide range of AI models across different providers:

API-based Models:

  • Claude (Anthropic): Haiku, Sonnet, Opus series

  • Gemini (Google): Flash, Pro series with MCP support

  • GPT (OpenAI): GPT-4, GPT-5 series

  • Grok (xAI): Grok-3, Grok-4 series

  • Azure OpenAI: Enterprise deployments

  • And many more

Local Models:

  • LM Studio: Run open-weight models locally

  • vLLM & SGLang: Unified inference backend

External Frameworks:

  • AG2 Agents with code execution capabilities

Tip

Choosing the right backend? Different models have different strengths. See the complete Backend Capabilities Matrix in Backend Configuration to understand which features (web search, code execution, file operations, etc.) are available for each model.

Core Concepts#

Simple CLI Interface

Get started with just massgen - install via pip, run the interactive setup wizard, and you’re ready to go.

Multi-Agent Coordination

Multiple agents work in parallel, observe each other’s progress, and reach consensus through natural collaboration with real-time visualization.

Interactive Multi-Turn Mode

Have ongoing conversations with your multi-agent team! Session history is preserved in the .massgen/sessions/ directory, allowing you to continue conversations across multiple sessions with full context preservation.

Flexible Model Support

Use Claude, Gemini, GPT, Grok, and more - each agent can use a different model. Mix and match models for optimal results.

MCP Tool Integration

Extend agent capabilities with Model Context Protocol (MCP) tools. Supports planning mode to prevent irreversible actions during coordination.

Workspace Isolation & File Operations

Each agent gets its own isolated workspace for safe file operations. The .massgen/ directory keeps all MassGen files organized and separate from your project.

Project Integration

Work directly with your existing codebases! Use context paths to grant agents read/write access to specific directories with granular permission control.

Configuration

After using the setup wizard, customize your agent teams via YAML configuration files for advanced scenarios.

Documentation Sections#

Community#

License#

MassGen is licensed under the Apache License 2.0. See the LICENSE file for details.

Indices and tables#