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

Quick Start#

Get started with MassGen in minutes:

pip install uv
uv venv
uv pip install massgen
uv run massgen

On first run, MassGen will guide you through:

  1. API key setup - Configure OpenAI, Anthropic, Google, or xAI

  2. Optional enhancements - Install Docker images and skills (~5 minutes with Docker, faster without)

  3. Quickstart configuration - Create your agent team with smart defaults

  4. Start chatting - Launch directly into an interactive conversation

Your configuration is saved automatically. Future runs are simple:

# Interactive multi-turn conversation
uv run massgen

# Single query
uv run massgen "Your question here"

# Use a different configuration
uv run massgen --config @examples/providers/gemini/gemini_3_pro

Want to dive deeper? See Installation for detailed setup options and Running MassGen for all the ways to use MassGen.

What is MassGen?#

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.

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.16 (November 24, 2025) - Terminal Evaluation, LiteLLM Cost Tracking & Memory Improvements

Terminal evaluation system with VHS recording for automated session capture as GIF/MP4/WEBM, analyzed by multimodal models (GPT-4.1, Claude) for UI/UX quality, agent performance, and coordination visualization. LiteLLM integration for accurate cost tracking across 500+ models with reasoning tokens (o1/o3) and cached tokens (Claude, OpenAI) support, more accurate than manual pricing tables. Memory archiving system enables persistent multi-turn conversations with improved retrieval and context management. MassGen self-evolution skills (config creator, self-developer, release documenter, model registry maintainer) for autonomous system maintenance. Docker improvements with parallel image pulling and VHS integration.

v0.1.15 (November 21, 2025) - Persona Generation System & Docker Distribution

Automatic persona generation for multi-agent configurations with multiple strategies (complementary, diverse, specialized, adversarial) to increase response diversity. Enhanced Docker distribution via GitHub Container Registry with ARM architecture support. Custom tools now run in isolated Docker containers for security and portability. MassGen pre-installed in Docker images for immediate use. Improved config builder with better model selection and defaults.

v0.1.14 (November 19, 2025) - Parallel Tool Execution, Interactive Quickstart & Gemini 3 Pro

Parallel tool execution system with configurable concurrent tool execution across all backends using asyncio-based scheduling and semaphore limits. Full integration for Google’s Gemini 3 Pro model with native function calling capabilities. Interactive quickstart workflow with streamlined onboarding experience and guided configuration creation. MCP registry client with enhanced server metadata fetching from official registry for better agent understanding.

Quick Start#

Get started with MassGen in minutes. First, ensure you have Python 3.11+ and uv installed, then create a virtual environment with uv and install MassGen via pip.

Install:

uv venv
uv pip install massgen

Step 1: Set up API keys, Docker, and skills:

uv run massgen --setup

This will:

  • Configure your API keys (OpenAI, Anthropic, Google, xAI)

  • Offer to set up Docker images for code execution

  • Offer to install skills (openskills, Anthropic collection)

Step 2: Create a config and start:

uv run massgen --quickstart

This will:

  • Ask how many agents you want (1-5, default 3)

  • Ask which backend/model for each agent

  • Auto-detect Docker and configure execution mode

  • Create a ready-to-use config and launch interactive mode

After setup, you can:

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

# Or start an interactive conversation
uv run massgen

Option 2: Quick single-agent test:

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

Option 3: Multi-agent collaboration:

# Use a built-in configuration
uv run 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#