massgen 0.0.3__py3-none-any.whl → 0.1.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of massgen might be problematic. Click here for more details.

Files changed (268) hide show
  1. massgen/__init__.py +142 -8
  2. massgen/adapters/__init__.py +29 -0
  3. massgen/adapters/ag2_adapter.py +483 -0
  4. massgen/adapters/base.py +183 -0
  5. massgen/adapters/tests/__init__.py +0 -0
  6. massgen/adapters/tests/test_ag2_adapter.py +439 -0
  7. massgen/adapters/tests/test_agent_adapter.py +128 -0
  8. massgen/adapters/utils/__init__.py +2 -0
  9. massgen/adapters/utils/ag2_utils.py +236 -0
  10. massgen/adapters/utils/tests/__init__.py +0 -0
  11. massgen/adapters/utils/tests/test_ag2_utils.py +138 -0
  12. massgen/agent_config.py +329 -55
  13. massgen/api_params_handler/__init__.py +10 -0
  14. massgen/api_params_handler/_api_params_handler_base.py +99 -0
  15. massgen/api_params_handler/_chat_completions_api_params_handler.py +176 -0
  16. massgen/api_params_handler/_claude_api_params_handler.py +113 -0
  17. massgen/api_params_handler/_response_api_params_handler.py +130 -0
  18. massgen/backend/__init__.py +39 -4
  19. massgen/backend/azure_openai.py +385 -0
  20. massgen/backend/base.py +341 -69
  21. massgen/backend/base_with_mcp.py +1102 -0
  22. massgen/backend/capabilities.py +386 -0
  23. massgen/backend/chat_completions.py +577 -130
  24. massgen/backend/claude.py +1033 -537
  25. massgen/backend/claude_code.py +1203 -0
  26. massgen/backend/cli_base.py +209 -0
  27. massgen/backend/docs/BACKEND_ARCHITECTURE.md +126 -0
  28. massgen/backend/{CLAUDE_API_RESEARCH.md → docs/CLAUDE_API_RESEARCH.md} +18 -18
  29. massgen/backend/{GEMINI_API_DOCUMENTATION.md → docs/GEMINI_API_DOCUMENTATION.md} +9 -9
  30. massgen/backend/docs/Gemini MCP Integration Analysis.md +1050 -0
  31. massgen/backend/docs/MCP_IMPLEMENTATION_CLAUDE_BACKEND.md +177 -0
  32. massgen/backend/docs/MCP_INTEGRATION_RESPONSE_BACKEND.md +352 -0
  33. massgen/backend/docs/OPENAI_GPT5_MODELS.md +211 -0
  34. massgen/backend/{OPENAI_RESPONSES_API_FORMAT.md → docs/OPENAI_RESPONSE_API_TOOL_CALLS.md} +3 -3
  35. massgen/backend/docs/OPENAI_response_streaming.md +20654 -0
  36. massgen/backend/docs/inference_backend.md +257 -0
  37. massgen/backend/docs/permissions_and_context_files.md +1085 -0
  38. massgen/backend/external.py +126 -0
  39. massgen/backend/gemini.py +1850 -241
  40. massgen/backend/grok.py +40 -156
  41. massgen/backend/inference.py +156 -0
  42. massgen/backend/lmstudio.py +171 -0
  43. massgen/backend/response.py +1095 -322
  44. massgen/chat_agent.py +131 -113
  45. massgen/cli.py +1504 -287
  46. massgen/config_builder.py +2165 -0
  47. massgen/configs/BACKEND_CONFIGURATION.md +458 -0
  48. massgen/configs/README.md +559 -216
  49. massgen/configs/ag2/ag2_case_study.yaml +27 -0
  50. massgen/configs/ag2/ag2_coder.yaml +34 -0
  51. massgen/configs/ag2/ag2_coder_case_study.yaml +36 -0
  52. massgen/configs/ag2/ag2_gemini.yaml +27 -0
  53. massgen/configs/ag2/ag2_groupchat.yaml +108 -0
  54. massgen/configs/ag2/ag2_groupchat_gpt.yaml +118 -0
  55. massgen/configs/ag2/ag2_single_agent.yaml +21 -0
  56. massgen/configs/basic/multi/fast_timeout_example.yaml +37 -0
  57. massgen/configs/basic/multi/gemini_4o_claude.yaml +31 -0
  58. massgen/configs/basic/multi/gemini_gpt5nano_claude.yaml +36 -0
  59. massgen/configs/{gemini_4o_claude.yaml → basic/multi/geminicode_4o_claude.yaml} +3 -3
  60. massgen/configs/basic/multi/geminicode_gpt5nano_claude.yaml +36 -0
  61. massgen/configs/basic/multi/glm_gemini_claude.yaml +25 -0
  62. massgen/configs/basic/multi/gpt4o_audio_generation.yaml +30 -0
  63. massgen/configs/basic/multi/gpt4o_image_generation.yaml +31 -0
  64. massgen/configs/basic/multi/gpt5nano_glm_qwen.yaml +26 -0
  65. massgen/configs/basic/multi/gpt5nano_image_understanding.yaml +26 -0
  66. massgen/configs/{three_agents_default.yaml → basic/multi/three_agents_default.yaml} +8 -4
  67. massgen/configs/basic/multi/three_agents_opensource.yaml +27 -0
  68. massgen/configs/basic/multi/three_agents_vllm.yaml +20 -0
  69. massgen/configs/basic/multi/two_agents_gemini.yaml +19 -0
  70. massgen/configs/{two_agents.yaml → basic/multi/two_agents_gpt5.yaml} +14 -6
  71. massgen/configs/basic/multi/two_agents_opensource_lmstudio.yaml +31 -0
  72. massgen/configs/basic/multi/two_qwen_vllm_sglang.yaml +28 -0
  73. massgen/configs/{single_agent.yaml → basic/single/single_agent.yaml} +1 -1
  74. massgen/configs/{single_flash2.5.yaml → basic/single/single_flash2.5.yaml} +1 -2
  75. massgen/configs/basic/single/single_gemini2.5pro.yaml +16 -0
  76. massgen/configs/basic/single/single_gpt4o_audio_generation.yaml +22 -0
  77. massgen/configs/basic/single/single_gpt4o_image_generation.yaml +22 -0
  78. massgen/configs/basic/single/single_gpt4o_video_generation.yaml +24 -0
  79. massgen/configs/basic/single/single_gpt5nano.yaml +20 -0
  80. massgen/configs/basic/single/single_gpt5nano_file_search.yaml +18 -0
  81. massgen/configs/basic/single/single_gpt5nano_image_understanding.yaml +17 -0
  82. massgen/configs/basic/single/single_gptoss120b.yaml +15 -0
  83. massgen/configs/basic/single/single_openrouter_audio_understanding.yaml +15 -0
  84. massgen/configs/basic/single/single_qwen_video_understanding.yaml +15 -0
  85. massgen/configs/debug/code_execution/command_filtering_blacklist.yaml +29 -0
  86. massgen/configs/debug/code_execution/command_filtering_whitelist.yaml +28 -0
  87. massgen/configs/debug/code_execution/docker_verification.yaml +29 -0
  88. massgen/configs/debug/skip_coordination_test.yaml +27 -0
  89. massgen/configs/debug/test_sdk_migration.yaml +17 -0
  90. massgen/configs/docs/DISCORD_MCP_SETUP.md +208 -0
  91. massgen/configs/docs/TWITTER_MCP_ENESCINAR_SETUP.md +82 -0
  92. massgen/configs/providers/azure/azure_openai_multi.yaml +21 -0
  93. massgen/configs/providers/azure/azure_openai_single.yaml +19 -0
  94. massgen/configs/providers/claude/claude.yaml +14 -0
  95. massgen/configs/providers/gemini/gemini_gpt5nano.yaml +28 -0
  96. massgen/configs/providers/local/lmstudio.yaml +11 -0
  97. massgen/configs/providers/openai/gpt5.yaml +46 -0
  98. massgen/configs/providers/openai/gpt5_nano.yaml +46 -0
  99. massgen/configs/providers/others/grok_single_agent.yaml +19 -0
  100. massgen/configs/providers/others/zai_coding_team.yaml +108 -0
  101. massgen/configs/providers/others/zai_glm45.yaml +12 -0
  102. massgen/configs/{creative_team.yaml → teams/creative/creative_team.yaml} +16 -6
  103. massgen/configs/{travel_planning.yaml → teams/creative/travel_planning.yaml} +16 -6
  104. massgen/configs/{news_analysis.yaml → teams/research/news_analysis.yaml} +16 -6
  105. massgen/configs/{research_team.yaml → teams/research/research_team.yaml} +15 -7
  106. massgen/configs/{technical_analysis.yaml → teams/research/technical_analysis.yaml} +16 -6
  107. massgen/configs/tools/code-execution/basic_command_execution.yaml +25 -0
  108. massgen/configs/tools/code-execution/code_execution_use_case_simple.yaml +41 -0
  109. massgen/configs/tools/code-execution/docker_claude_code.yaml +32 -0
  110. massgen/configs/tools/code-execution/docker_multi_agent.yaml +32 -0
  111. massgen/configs/tools/code-execution/docker_simple.yaml +29 -0
  112. massgen/configs/tools/code-execution/docker_with_resource_limits.yaml +32 -0
  113. massgen/configs/tools/code-execution/multi_agent_playwright_automation.yaml +57 -0
  114. massgen/configs/tools/filesystem/cc_gpt5_gemini_filesystem.yaml +34 -0
  115. massgen/configs/tools/filesystem/claude_code_context_sharing.yaml +68 -0
  116. massgen/configs/tools/filesystem/claude_code_flash2.5.yaml +43 -0
  117. massgen/configs/tools/filesystem/claude_code_flash2.5_gptoss.yaml +49 -0
  118. massgen/configs/tools/filesystem/claude_code_gpt5nano.yaml +31 -0
  119. massgen/configs/tools/filesystem/claude_code_single.yaml +40 -0
  120. massgen/configs/tools/filesystem/fs_permissions_test.yaml +87 -0
  121. massgen/configs/tools/filesystem/gemini_gemini_workspace_cleanup.yaml +54 -0
  122. massgen/configs/tools/filesystem/gemini_gpt5_filesystem_casestudy.yaml +30 -0
  123. massgen/configs/tools/filesystem/gemini_gpt5nano_file_context_path.yaml +43 -0
  124. massgen/configs/tools/filesystem/gemini_gpt5nano_protected_paths.yaml +45 -0
  125. massgen/configs/tools/filesystem/gpt5mini_cc_fs_context_path.yaml +31 -0
  126. massgen/configs/tools/filesystem/grok4_gpt5_gemini_filesystem.yaml +32 -0
  127. massgen/configs/tools/filesystem/multiturn/grok4_gpt5_claude_code_filesystem_multiturn.yaml +58 -0
  128. massgen/configs/tools/filesystem/multiturn/grok4_gpt5_gemini_filesystem_multiturn.yaml +58 -0
  129. massgen/configs/tools/filesystem/multiturn/two_claude_code_filesystem_multiturn.yaml +47 -0
  130. massgen/configs/tools/filesystem/multiturn/two_gemini_flash_filesystem_multiturn.yaml +48 -0
  131. massgen/configs/tools/mcp/claude_code_discord_mcp_example.yaml +27 -0
  132. massgen/configs/tools/mcp/claude_code_simple_mcp.yaml +35 -0
  133. massgen/configs/tools/mcp/claude_code_twitter_mcp_example.yaml +32 -0
  134. massgen/configs/tools/mcp/claude_mcp_example.yaml +24 -0
  135. massgen/configs/tools/mcp/claude_mcp_test.yaml +27 -0
  136. massgen/configs/tools/mcp/five_agents_travel_mcp_test.yaml +157 -0
  137. massgen/configs/tools/mcp/five_agents_weather_mcp_test.yaml +103 -0
  138. massgen/configs/tools/mcp/gemini_mcp_example.yaml +24 -0
  139. massgen/configs/tools/mcp/gemini_mcp_filesystem_test.yaml +23 -0
  140. massgen/configs/tools/mcp/gemini_mcp_filesystem_test_sharing.yaml +23 -0
  141. massgen/configs/tools/mcp/gemini_mcp_filesystem_test_single_agent.yaml +17 -0
  142. massgen/configs/tools/mcp/gemini_mcp_filesystem_test_with_claude_code.yaml +24 -0
  143. massgen/configs/tools/mcp/gemini_mcp_test.yaml +27 -0
  144. massgen/configs/tools/mcp/gemini_notion_mcp.yaml +52 -0
  145. massgen/configs/tools/mcp/gpt5_nano_mcp_example.yaml +24 -0
  146. massgen/configs/tools/mcp/gpt5_nano_mcp_test.yaml +27 -0
  147. massgen/configs/tools/mcp/gpt5mini_claude_code_discord_mcp_example.yaml +38 -0
  148. massgen/configs/tools/mcp/gpt_oss_mcp_example.yaml +25 -0
  149. massgen/configs/tools/mcp/gpt_oss_mcp_test.yaml +28 -0
  150. massgen/configs/tools/mcp/grok3_mini_mcp_example.yaml +24 -0
  151. massgen/configs/tools/mcp/grok3_mini_mcp_test.yaml +27 -0
  152. massgen/configs/tools/mcp/multimcp_gemini.yaml +111 -0
  153. massgen/configs/tools/mcp/qwen_api_mcp_example.yaml +25 -0
  154. massgen/configs/tools/mcp/qwen_api_mcp_test.yaml +28 -0
  155. massgen/configs/tools/mcp/qwen_local_mcp_example.yaml +24 -0
  156. massgen/configs/tools/mcp/qwen_local_mcp_test.yaml +27 -0
  157. massgen/configs/tools/planning/five_agents_discord_mcp_planning_mode.yaml +140 -0
  158. massgen/configs/tools/planning/five_agents_filesystem_mcp_planning_mode.yaml +151 -0
  159. massgen/configs/tools/planning/five_agents_notion_mcp_planning_mode.yaml +151 -0
  160. massgen/configs/tools/planning/five_agents_twitter_mcp_planning_mode.yaml +155 -0
  161. massgen/configs/tools/planning/gpt5_mini_case_study_mcp_planning_mode.yaml +73 -0
  162. massgen/configs/tools/web-search/claude_streamable_http_test.yaml +43 -0
  163. massgen/configs/tools/web-search/gemini_streamable_http_test.yaml +43 -0
  164. massgen/configs/tools/web-search/gpt5_mini_streamable_http_test.yaml +43 -0
  165. massgen/configs/tools/web-search/gpt_oss_streamable_http_test.yaml +44 -0
  166. massgen/configs/tools/web-search/grok3_mini_streamable_http_test.yaml +43 -0
  167. massgen/configs/tools/web-search/qwen_api_streamable_http_test.yaml +44 -0
  168. massgen/configs/tools/web-search/qwen_local_streamable_http_test.yaml +43 -0
  169. massgen/coordination_tracker.py +708 -0
  170. massgen/docker/README.md +462 -0
  171. massgen/filesystem_manager/__init__.py +21 -0
  172. massgen/filesystem_manager/_base.py +9 -0
  173. massgen/filesystem_manager/_code_execution_server.py +545 -0
  174. massgen/filesystem_manager/_docker_manager.py +477 -0
  175. massgen/filesystem_manager/_file_operation_tracker.py +248 -0
  176. massgen/filesystem_manager/_filesystem_manager.py +813 -0
  177. massgen/filesystem_manager/_path_permission_manager.py +1261 -0
  178. massgen/filesystem_manager/_workspace_tools_server.py +1815 -0
  179. massgen/formatter/__init__.py +10 -0
  180. massgen/formatter/_chat_completions_formatter.py +284 -0
  181. massgen/formatter/_claude_formatter.py +235 -0
  182. massgen/formatter/_formatter_base.py +156 -0
  183. massgen/formatter/_response_formatter.py +263 -0
  184. massgen/frontend/__init__.py +1 -2
  185. massgen/frontend/coordination_ui.py +471 -286
  186. massgen/frontend/displays/base_display.py +56 -11
  187. massgen/frontend/displays/create_coordination_table.py +1956 -0
  188. massgen/frontend/displays/rich_terminal_display.py +1259 -619
  189. massgen/frontend/displays/simple_display.py +9 -4
  190. massgen/frontend/displays/terminal_display.py +27 -68
  191. massgen/logger_config.py +681 -0
  192. massgen/mcp_tools/README.md +232 -0
  193. massgen/mcp_tools/__init__.py +105 -0
  194. massgen/mcp_tools/backend_utils.py +1035 -0
  195. massgen/mcp_tools/circuit_breaker.py +195 -0
  196. massgen/mcp_tools/client.py +894 -0
  197. massgen/mcp_tools/config_validator.py +138 -0
  198. massgen/mcp_tools/docs/circuit_breaker.md +646 -0
  199. massgen/mcp_tools/docs/client.md +950 -0
  200. massgen/mcp_tools/docs/config_validator.md +478 -0
  201. massgen/mcp_tools/docs/exceptions.md +1165 -0
  202. massgen/mcp_tools/docs/security.md +854 -0
  203. massgen/mcp_tools/exceptions.py +338 -0
  204. massgen/mcp_tools/hooks.py +212 -0
  205. massgen/mcp_tools/security.py +780 -0
  206. massgen/message_templates.py +342 -64
  207. massgen/orchestrator.py +1515 -241
  208. massgen/stream_chunk/__init__.py +35 -0
  209. massgen/stream_chunk/base.py +92 -0
  210. massgen/stream_chunk/multimodal.py +237 -0
  211. massgen/stream_chunk/text.py +162 -0
  212. massgen/tests/mcp_test_server.py +150 -0
  213. massgen/tests/multi_turn_conversation_design.md +0 -8
  214. massgen/tests/test_azure_openai_backend.py +156 -0
  215. massgen/tests/test_backend_capabilities.py +262 -0
  216. massgen/tests/test_backend_event_loop_all.py +179 -0
  217. massgen/tests/test_chat_completions_refactor.py +142 -0
  218. massgen/tests/test_claude_backend.py +15 -28
  219. massgen/tests/test_claude_code.py +268 -0
  220. massgen/tests/test_claude_code_context_sharing.py +233 -0
  221. massgen/tests/test_claude_code_orchestrator.py +175 -0
  222. massgen/tests/test_cli_backends.py +180 -0
  223. massgen/tests/test_code_execution.py +679 -0
  224. massgen/tests/test_external_agent_backend.py +134 -0
  225. massgen/tests/test_final_presentation_fallback.py +237 -0
  226. massgen/tests/test_gemini_planning_mode.py +351 -0
  227. massgen/tests/test_grok_backend.py +7 -10
  228. massgen/tests/test_http_mcp_server.py +42 -0
  229. massgen/tests/test_integration_simple.py +198 -0
  230. massgen/tests/test_mcp_blocking.py +125 -0
  231. massgen/tests/test_message_context_building.py +29 -47
  232. massgen/tests/test_orchestrator_final_presentation.py +48 -0
  233. massgen/tests/test_path_permission_manager.py +2087 -0
  234. massgen/tests/test_rich_terminal_display.py +14 -13
  235. massgen/tests/test_timeout.py +133 -0
  236. massgen/tests/test_v3_3agents.py +11 -12
  237. massgen/tests/test_v3_simple.py +8 -13
  238. massgen/tests/test_v3_three_agents.py +11 -18
  239. massgen/tests/test_v3_two_agents.py +8 -13
  240. massgen/token_manager/__init__.py +7 -0
  241. massgen/token_manager/token_manager.py +400 -0
  242. massgen/utils.py +52 -16
  243. massgen/v1/agent.py +45 -91
  244. massgen/v1/agents.py +18 -53
  245. massgen/v1/backends/gemini.py +50 -153
  246. massgen/v1/backends/grok.py +21 -54
  247. massgen/v1/backends/oai.py +39 -111
  248. massgen/v1/cli.py +36 -93
  249. massgen/v1/config.py +8 -12
  250. massgen/v1/logging.py +43 -127
  251. massgen/v1/main.py +18 -32
  252. massgen/v1/orchestrator.py +68 -209
  253. massgen/v1/streaming_display.py +62 -163
  254. massgen/v1/tools.py +8 -12
  255. massgen/v1/types.py +9 -23
  256. massgen/v1/utils.py +5 -23
  257. massgen-0.1.0a1.dist-info/METADATA +1287 -0
  258. massgen-0.1.0a1.dist-info/RECORD +273 -0
  259. massgen-0.1.0a1.dist-info/entry_points.txt +2 -0
  260. massgen/frontend/logging/__init__.py +0 -9
  261. massgen/frontend/logging/realtime_logger.py +0 -197
  262. massgen-0.0.3.dist-info/METADATA +0 -568
  263. massgen-0.0.3.dist-info/RECORD +0 -76
  264. massgen-0.0.3.dist-info/entry_points.txt +0 -2
  265. /massgen/backend/{Function calling openai responses.md → docs/Function calling openai responses.md} +0 -0
  266. {massgen-0.0.3.dist-info → massgen-0.1.0a1.dist-info}/WHEEL +0 -0
  267. {massgen-0.0.3.dist-info → massgen-0.1.0a1.dist-info}/licenses/LICENSE +0 -0
  268. {massgen-0.0.3.dist-info → massgen-0.1.0a1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1287 @@
1
+ Metadata-Version: 2.4
2
+ Name: massgen
3
+ Version: 0.1.0a1
4
+ Summary: Multi-Agent Scaling System - A powerful framework for collaborative AI
5
+ Author-email: MassGen Team <contact@massgen.dev>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/Leezekun/MassGen
8
+ Project-URL: Repository, https://github.com/Leezekun/MassGen
9
+ Project-URL: Bug Reports, https://github.com/Leezekun/MassGen/issues
10
+ Project-URL: Source, https://github.com/Leezekun/MassGen
11
+ Project-URL: Documentation, https://github.com/Leezekun/MassGen/blob/main/README.md
12
+ Keywords: ai,multi-agent,collaboration,orchestration,llm,claude,gemini,gpt,xai
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: datasets==3.2.0
26
+ Requires-Dist: openai==2.2.0
27
+ Requires-Dist: xai-sdk==1.0.0
28
+ Requires-Dist: anthropic>=0.61.0
29
+ Requires-Dist: nest-asyncio==1.6.0
30
+ Requires-Dist: cerebras-cloud-sdk==1.46.0
31
+ Requires-Dist: lmstudio==1.4.1
32
+ Requires-Dist: wcwidth>=0.2.5
33
+ Requires-Dist: google-genai>=1.27.0
34
+ Requires-Dist: python-dotenv>=1.0.0
35
+ Requires-Dist: PyYAML>=6.0
36
+ Requires-Dist: rich==14.1.0
37
+ Requires-Dist: questionary>=2.0.0
38
+ Requires-Dist: requests>=2.31.0
39
+ Requires-Dist: typing-extensions>=4.0.0
40
+ Requires-Dist: claude-agent-sdk>=0.0.22
41
+ Requires-Dist: loguru>=0.7.0
42
+ Requires-Dist: mcp>=1.12.0
43
+ Requires-Dist: aiohttp>=3.8.0
44
+ Requires-Dist: fastmcp>=2.12.3
45
+ Requires-Dist: sphinx-rtd-theme>=3.0.2
46
+ Requires-Dist: sphinx-book-theme>=1.1.4
47
+ Requires-Dist: pillow>=11.3.0
48
+ Requires-Dist: ag2>=0.9.10
49
+ Requires-Dist: pyautogen>=0.10.0
50
+ Requires-Dist: vertexai>=1.71.1
51
+ Provides-Extra: dev
52
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
53
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
54
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
55
+ Requires-Dist: black>=23.0.0; extra == "dev"
56
+ Requires-Dist: isort>=5.12.0; extra == "dev"
57
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
58
+ Requires-Dist: mypy>=1.3.0; extra == "dev"
59
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
60
+ Requires-Dist: bandit>=1.7.0; extra == "dev"
61
+ Requires-Dist: autoflake>=2.1.0; extra == "dev"
62
+ Requires-Dist: pyupgrade>=3.7.0; extra == "dev"
63
+ Provides-Extra: docs
64
+ Requires-Dist: sphinx>=7.0.0; extra == "docs"
65
+ Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "docs"
66
+ Requires-Dist: myst-parser>=2.0.0; extra == "docs"
67
+ Requires-Dist: sphinx-copybutton>=0.5.0; extra == "docs"
68
+ Requires-Dist: sphinx-autobuild>=2021.3.14; extra == "docs"
69
+ Requires-Dist: sphinxcontrib-mermaid>=0.9.0; extra == "docs"
70
+ Requires-Dist: sphinx-autodoc-typehints>=1.24.0; extra == "docs"
71
+ Requires-Dist: sphinx-autoapi>=3.0.0; extra == "docs"
72
+ Requires-Dist: sphinx-design>=0.5.0; extra == "docs"
73
+ Requires-Dist: sphinx-tabs>=3.4.0; extra == "docs"
74
+ Requires-Dist: sphinx-togglebutton>=0.3.0; extra == "docs"
75
+ Requires-Dist: sphinx-inline-tabs>=2023.4.21; extra == "docs"
76
+ Requires-Dist: sphinxcontrib-lunrsearch>=0.4; extra == "docs"
77
+ Provides-Extra: docker
78
+ Requires-Dist: docker>=7.0.0; extra == "docker"
79
+ Provides-Extra: external
80
+ Requires-Dist: ag2>=0.9.10; extra == "external"
81
+ Provides-Extra: all
82
+ Dynamic: license-file
83
+
84
+ <p align="center">
85
+ <img src="assets/logo.png" alt="MassGen Logo" width="360" />
86
+ </p>
87
+
88
+ <p align="center">
89
+ <a href="https://www.python.org/downloads/">
90
+ <img src="https://img.shields.io/badge/python-3.11+-blue.svg" alt="Python 3.11+" style="margin-right: 5px;">
91
+ </a>
92
+ <a href="LICENSE">
93
+ <img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License" style="margin-right: 5px;">
94
+ </a>
95
+ <a href="https://discord.massgen.ai">
96
+ <img src="https://img.shields.io/discord/1153072414184452236?color=7289da&label=chat&logo=discord&style=flat-square" alt="Join our Discord">
97
+ </a>
98
+ </p>
99
+
100
+ <h1 align="center">🚀 MassGen: Multi-Agent Scaling System for GenAI</h1>
101
+
102
+ <p align="center">
103
+ <i>MassGen is a cutting-edge multi-agent system that leverages the power of collaborative AI to solve complex tasks.</i>
104
+ </p>
105
+
106
+ <p align="center">
107
+ <a href="https://www.youtube.com/watch?v=Dp2oldJJImw">
108
+ <img src="assets/massgen-demo.gif" alt="MassGen case study -- Berkeley Agentic AI Summit Question" width="800">
109
+ </a>
110
+ </p>
111
+
112
+ <p align="center">
113
+ <i>Multi-agent scaling through intelligent collaboration in Grok Heavy style</i>
114
+ </p>
115
+
116
+ 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.
117
+
118
+ This project started with the "threads of thought" and "iterative refinement" ideas presented in [The Myth of Reasoning](https://docs.ag2.ai/latest/docs/blog/2025/04/16/Reasoning/), and extends the classic "multi-agent conversation" idea in [AG2](https://github.com/ag2ai/ag2). Here is a [video recording](https://www.youtube.com/watch?v=xM2Uguw1UsQ) of the background context introduction presented at the Berkeley Agentic AI Summit 2025.
119
+
120
+ ---
121
+
122
+ ## 📋 Table of Contents
123
+
124
+ <details open>
125
+ <summary><h3>✨ Key Features</h3></summary>
126
+
127
+ - [Cross-Model/Agent Synergy](#-key-features-1)
128
+ - [Parallel Processing](#-key-features-1)
129
+ - [Intelligence Sharing](#-key-features-1)
130
+ - [Consensus Building](#-key-features-1)
131
+ - [Live Visualization](#-key-features-1)
132
+ </details>
133
+
134
+ <details open>
135
+ <summary><h3>🆕 Latest Features</h3></summary>
136
+
137
+ - [v0.1.0 Features](#-latest-features-v010)
138
+ </details>
139
+
140
+ <details open>
141
+ <summary><h3>🏗️ System Design</h3></summary>
142
+
143
+ - [System Architecture](#%EF%B8%8F-system-design-1)
144
+ - [Parallel Processing](#%EF%B8%8F-system-design-1)
145
+ - [Real-time Collaboration](#%EF%B8%8F-system-design-1)
146
+ - [Convergence Detection](#%EF%B8%8F-system-design-1)
147
+ - [Adaptive Coordination](#%EF%B8%8F-system-design-1)
148
+ </details>
149
+
150
+ <details open>
151
+ <summary><h3>🚀 Quick Start</h3></summary>
152
+
153
+ - [📥 Installation](#1--installation)
154
+ - [🔐 API Configuration](#2--api-configuration)
155
+ - [🧩 Supported Models and Tools](#3--supported-models-and-tools)
156
+ - [Models](#models)
157
+ - [Tools](#tools)
158
+ - [🏃 Run MassGen](#4--run-massgen)
159
+ - [CLI Configuration Parameters](#cli-configuration-parameters)
160
+ - [1. Single Agent (Easiest Start)](#1-single-agent-easiest-start)
161
+ - [2. Multi-Agent Collaboration (Recommended)](#2-multi-agent-collaboration-recommended)
162
+ - [3. Model Context Protocol (MCP)](#3-model-context-protocol-mcp)
163
+ - [4. File System Operations](#4-file-system-operations--workspace-management)
164
+ - [5. Project Integration (NEW in v0.0.21)](#5-project-integration--user-context-paths-new-in-v0021)
165
+ - [Backend Configuration Reference](#backend-configuration-reference)
166
+ - [Interactive Multi-Turn Mode](#interactive-multi-turn-mode)
167
+ - [📊 View Results](#5--view-results)
168
+ - [Real-time Display](#real-time-display)
169
+ - [Comprehensive Logging](#comprehensive-logging)
170
+ </details>
171
+
172
+ <details open>
173
+ <summary><h3>💡 Case Studies & Examples</h3></summary>
174
+
175
+ - [Case Studies](#-case-studies)
176
+ </details>
177
+
178
+ <details open>
179
+ <summary><h3>🗺️ Roadmap</h3></summary>
180
+
181
+ - Recent Achievements
182
+ - [v0.1.0](#recent-achievements-v010)
183
+ - [v0.0.3 - v0.0.32](#previous-achievements-v003---v0032)
184
+ - [Key Future Enhancements](#key-future-enhancements)
185
+ - Bug Fixes & Backend Improvements
186
+ - Advanced Agent Collaboration
187
+ - Expanded Model, Tool & Agent Integrations
188
+ - Improved Performance & Scalability
189
+ - Enhanced Developer Experience
190
+ - [v0.1.1 Roadmap](#v011-roadmap)
191
+ </details>
192
+
193
+ <details open>
194
+ <summary><h3>📚 Additional Resources</h3></summary>
195
+
196
+ - [🤝 Contributing](#-contributing)
197
+ - [📄 License](#-license)
198
+ - [⭐ Star History](#-star-history)
199
+ </details>
200
+
201
+ ---
202
+
203
+ ## ✨ Key Features
204
+
205
+ | Feature | Description |
206
+ |---------|-------------|
207
+ | **🤝 Cross-Model/Agent Synergy** | Harness strengths from diverse frontier model-powered agents |
208
+ | **⚡ Parallel Processing** | Multiple agents tackle problems simultaneously |
209
+ | **👥 Intelligence Sharing** | Agents share and learn from each other's work |
210
+ | **🔄 Consensus Building** | Natural convergence through collaborative refinement |
211
+ | **📊 Live Visualization** | See agents' working processes in real-time |
212
+
213
+ ---
214
+
215
+ ## 🆕 Latest Features (v0.1.0)
216
+
217
+ **🎉 Released: October 17, 2025**
218
+
219
+ **What's New in v0.1.0:**
220
+ - **📦 PyPI Package** - Official pip installation: `pip install massgen`
221
+ - **📖 Comprehensive Documentation** - Full Sphinx docs at [massgen.readthedocs.io](https://massgen.readthedocs.io)
222
+ - **🎯 Interactive Setup Wizard** - Guided configuration for first-time users
223
+ - **🚀 Simplified Commands** - Clean `massgen` CLI with `@examples/` prefix for built-in configs
224
+
225
+ **Get Started with v0.1.0:**
226
+ ```bash
227
+ # Install from PyPI
228
+ pip install massgen
229
+
230
+ # Run the interactive setup wizard
231
+ massgen
232
+
233
+ # Start using with example configurations
234
+ massgen --config @examples/basic/multi/three_agents_default \
235
+ "Analyze the pros and cons of renewable energy"
236
+ ```
237
+
238
+ → [See full release history and examples](massgen/configs/README.md#release-history--examples)
239
+
240
+ ---
241
+
242
+ ## 🏗️ System Design
243
+
244
+ MassGen operates through an architecture designed for **seamless multi-agent collaboration**:
245
+
246
+ ```mermaid
247
+ graph TB
248
+ O[🚀 MassGen Orchestrator<br/>📋 Task Distribution & Coordination]
249
+
250
+ subgraph Collaborative Agents
251
+ A1[Agent 1<br/>🏗️ Anthropic/Claude + Tools]
252
+ A2[Agent 2<br/>🌟 Google/Gemini + Tools]
253
+ A3[Agent 3<br/>🤖 OpenAI/GPT + Tools]
254
+ A4[Agent 4<br/>⚡ xAI/Grok + Tools]
255
+ end
256
+
257
+ H[🔄 Shared Collaboration Hub<br/>📡 Real-time Notification & Consensus]
258
+
259
+ O --> A1 & A2 & A3 & A4
260
+ A1 & A2 & A3 & A4 <--> H
261
+
262
+ classDef orchestrator fill:#e1f5fe,stroke:#0288d1,stroke-width:3px
263
+ classDef agent fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
264
+ classDef hub fill:#e8f5e8,stroke:#388e3c,stroke-width:2px
265
+
266
+ class O orchestrator
267
+ class A1,A2,A3,A4 agent
268
+ class H hub
269
+ ```
270
+
271
+ The system's workflow is defined by the following key principles:
272
+
273
+ **Parallel Processing** - Multiple agents tackle the same task simultaneously, each leveraging their unique capabilities (different models, tools, and specialized approaches).
274
+
275
+ **Real-time Collaboration** - Agents continuously share their working summaries and insights through a notification system, allowing them to learn from each other's approaches and build upon collective knowledge.
276
+
277
+ **Convergence Detection** - The system intelligently monitors when agents have reached stability in their solutions and achieved consensus through natural collaboration rather than forced agreement.
278
+
279
+ **Adaptive Coordination** - Agents can restart and refine their work when they receive new insights from others, creating a dynamic and responsive problem-solving environment.
280
+
281
+ This collaborative approach ensures that the final output leverages collective intelligence from multiple AI systems, leading to more robust and well-rounded results than any single agent could achieve alone.
282
+
283
+ ---
284
+
285
+ > 📖 **Complete Documentation:** For comprehensive guides, API reference, and detailed examples, visit **[massgen.readthedocs.io](https://massgen.readthedocs.io)**
286
+
287
+ ---
288
+
289
+ ## 🚀 Quick Start
290
+
291
+ ### 1. 📥 Installation
292
+
293
+ **Method 1: PyPI Installation** (Recommended - Python 3.11+):
294
+
295
+ ```bash
296
+ # Install MassGen via pip
297
+ pip install massgen
298
+
299
+ # Or with uv (faster)
300
+ uv pip install massgen
301
+
302
+ # Run the interactive setup wizard
303
+ massgen
304
+ ```
305
+
306
+ The wizard will guide you through:
307
+ - Configuring API keys
308
+ - Selecting your use case (Research, Code, Q&A, etc.)
309
+ - Choosing AI models
310
+ - Saving your configuration
311
+
312
+ After setup, you can run MassGen with:
313
+ ```bash
314
+ # Interactive mode
315
+ massgen
316
+
317
+ # Single query
318
+ massgen "Your question here"
319
+
320
+ # With example configurations
321
+ massgen --config @examples/basic/multi/three_agents_default "Your question"
322
+ ```
323
+
324
+ → See [Installation Guide](https://massgen.readthedocs.io/en/latest/quickstart/installation.html) for complete setup instructions.
325
+
326
+ **Method 2: Development Installation** (for contributors):
327
+
328
+ ```bash
329
+ # Clone the repository
330
+ git clone https://github.com/Leezekun/MassGen.git
331
+ cd MassGen
332
+
333
+ # Install in editable mode with pip
334
+ pip install -e .
335
+
336
+ # Or with uv (faster)
337
+ uv pip install -e .
338
+
339
+ # Optional: AG2 framework integration
340
+ pip install -e ".[external]"
341
+ ```
342
+
343
+ <details>
344
+ <summary><b>Alternative Installation Methods</b> (click to expand)</summary>
345
+
346
+ **Using uv with venv:**
347
+ ```bash
348
+ git clone https://github.com/Leezekun/MassGen.git
349
+ cd MassGen
350
+ uv venv
351
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
352
+ uv pip install -e .
353
+ ```
354
+
355
+ **Using traditional Python venv:**
356
+ ```bash
357
+ git clone https://github.com/Leezekun/MassGen.git
358
+ cd MassGen
359
+ python -m venv .venv
360
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
361
+ pip install -e .
362
+ ```
363
+
364
+ **Global installation with uv tool:**
365
+ ```bash
366
+ git clone https://github.com/Leezekun/MassGen.git
367
+ cd MassGen
368
+ uv tool install -e .
369
+ # Now run from any directory
370
+ uv tool run massgen --config @examples/basic_multi "Question"
371
+ ```
372
+
373
+ **Backwards compatibility (uv run):**
374
+ ```bash
375
+ cd /path/to/MassGen
376
+ uv run massgen --config @examples/basic_multi "Question"
377
+ uv run python -m massgen.cli --config config.yaml "Question"
378
+ ```
379
+
380
+ </details>
381
+
382
+ **Optional CLI Tools:**
383
+ ```bash
384
+ # Claude Code CLI - Advanced coding assistant
385
+ npm install -g @anthropic-ai/claude-code
386
+
387
+ # LM Studio - Local model inference
388
+ # MacOS/Linux:
389
+ sudo ~/.lmstudio/bin/lms bootstrap
390
+ # Windows:
391
+ cmd /c %USERPROFILE%\.lmstudio\bin\lms.exe bootstrap
392
+ ```
393
+
394
+ ### 2. 🔐 API Configuration
395
+
396
+ **If you used the setup wizard (`massgen` command), your API keys are already configured!**
397
+
398
+ For development installations or manual configuration:
399
+
400
+ ```bash
401
+ # Copy example configuration
402
+ cp .env.example .env
403
+ ```
404
+
405
+ Or set environment variables directly:
406
+ ```bash
407
+ export OPENAI_API_KEY="your-key"
408
+ export ANTHROPIC_API_KEY="your-key"
409
+ export GOOGLE_API_KEY="your-key"
410
+ ```
411
+
412
+ **Get API keys:**
413
+ - [OpenAI](https://platform.openai.com/api-keys) | [Claude](https://docs.anthropic.com/en/api/overview) | [Gemini](https://ai.google.dev/gemini-api/docs) | [Grok](https://docs.x.ai/docs/overview)
414
+ - [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/) | [Cerebras](https://inference-docs.cerebras.ai/introduction) | [More providers...](https://massgen.readthedocs.io/en/latest/reference/supported_models.html)
415
+
416
+ ### 3. 🧩 Supported Models and Tools
417
+
418
+ #### Models
419
+
420
+ The system currently supports multiple model providers with advanced capabilities:
421
+
422
+ **API-based Models:**
423
+ - **Azure OpenAI** (NEW in v0.0.10): GPT-4, GPT-4o, GPT-3.5-turbo, GPT-4.1, GPT-5-chat
424
+ - **Cerebras AI**: GPT-OSS-120B...
425
+ - **Claude**: Claude Haiku 3.5, Claude Sonnet 4, Claude Opus 4...
426
+ - **Claude Code**: Native Claude Code SDK with comprehensive dev tools
427
+ - **Gemini**: Gemini 2.5 Flash, Gemini 2.5 Pro...
428
+ - **Grok**: Grok-4, Grok-3, Grok-3-mini...
429
+ - **OpenAI**: GPT-5 series (GPT-5, GPT-5-mini, GPT-5-nano)...
430
+ - **Together AI**, **Fireworks AI**, **Groq**, **Kimi/Moonshot**, **Nebius AI Studio**, **OpenRouter**, **POE**: LLaMA, Mistral, Qwen...
431
+ - **Z AI**: GLM-4.5
432
+
433
+ **Local Model Support:**
434
+ - **vLLM & SGLang** (ENHANCED in v0.0.25): Unified inference backend supporting both vLLM and SGLang servers
435
+ - Auto-detection between vLLM (port 8000) and SGLang (port 30000) servers
436
+ - Support for both vLLM and SGLang-specific parameters (top_k, repetition_penalty, separate_reasoning)
437
+ - Mixed server deployments with configuration example: `two_qwen_vllm_sglang.yaml`
438
+
439
+ - **LM Studio** (v0.0.7+): Run open-weight models locally with automatic server management
440
+ - Automatic LM Studio CLI installation
441
+ - Auto-download and loading of models
442
+ - Zero-cost usage reporting
443
+ - Support for LLaMA, Mistral, Qwen and other open-weight models
444
+
445
+ → For complete model list and configuration details, see [Supported Models](https://massgen.readthedocs.io/en/latest/reference/supported_models.html)
446
+
447
+ #### Tools
448
+
449
+ MassGen agents can leverage various tools to enhance their problem-solving capabilities. Both API-based and CLI-based backends support different tool capabilities.
450
+
451
+ **Supported Built-in Tools by Backend:**
452
+
453
+ | Backend | Live Search | Code Execution | File Operations | MCP Support | Multimodal (Image/Audio/Video) | Advanced Features |
454
+ |---------|:-----------:|:--------------:|:---------------:|:-----------:|:----------:|:-----------------|
455
+ | **Azure OpenAI** (NEW in v0.0.10) | ❌ | ❌ | ❌ | ❌ | ❌ | Code interpreter, Azure deployment management |
456
+ | **Claude API** | ✅ | ✅ | ✅ | ✅ | ✅ | Web search, code interpreter, **MCP integration** |
457
+ | **Claude Code** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image* | **Native Claude Code SDK, comprehensive dev tools, MCP integration** |
458
+ | **Gemini API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image* | Web search, code execution, **MCP integration**|
459
+ | **Grok API** | ✅ | ❌ | ✅ | ✅ | ❌ | Web search, **MCP integration** |
460
+ | **OpenAI API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image* | Web search, code interpreter, **MCP integration** |
461
+ | **ZAI API** | ❌ | ❌ | ✅ | ✅ | ❌ | **MCP integration** |
462
+
463
+ **Note:** Audio/video multimodal support (NEW in v0.0.30) is available through Chat Completions-based providers like OpenRouter and Qwen API. See configuration examples: [`single_openrouter_audio_understanding.yaml`](massgen/configs/basic/single/single_openrouter_audio_understanding.yaml), [`single_qwen_video_understanding.yaml`](massgen/configs/basic/single/single_qwen_video_understanding.yaml)
464
+
465
+ → For detailed backend capabilities and tool integration guides, see [User Guide - Backends](https://massgen.readthedocs.io/en/latest/user_guide/backends.html)
466
+
467
+ ---
468
+
469
+ ### 4. 🏃 Run MassGen
470
+
471
+ > **Complete Usage Guide:** For all usage modes, advanced features, and interactive multi-turn sessions, see [Running MassGen](https://massgen.readthedocs.io/en/latest/quickstart/running-massgen.html)
472
+
473
+ #### 🚀 Getting Started
474
+
475
+ #### CLI Configuration Parameters
476
+
477
+ | Parameter | Description |
478
+ |-------------------|-------------|
479
+ | `--config` | Path to YAML configuration file with agent definitions, model parameters, backend parameters and UI settings |
480
+ | `--backend` | Backend type for quick setup without a config file (`claude`, `claude_code`, `gemini`, `grok`, `openai`, `azure_openai`, `zai`). Optional for [models with default backends](massgen/utils.py).|
481
+ | `--model` | Model name for quick setup (e.g., `gemini-2.5-flash`, `gpt-5-nano`, ...). `--config` and `--model` are mutually exclusive - use one or the other. |
482
+ | `--system-message` | System prompt for the agent in quick setup mode. If `--config` is provided, `--system-message` is omitted. |
483
+ | `--no-display` | Disable real-time streaming UI coordination display (fallback to simple text output).|
484
+ | `--no-logs` | Disable real-time logging.|
485
+ | `--debug` | Enable debug mode with verbose logging (NEW in v0.0.13). Shows detailed orchestrator activities, agent messages, backend operations, and tool calls. Debug logs are saved to `agent_outputs/log_{time}/massgen_debug.log`. |
486
+ | `"<your question>"` | Optional single-question input; if omitted, MassGen enters interactive chat mode. |
487
+
488
+
489
+ #### **1. Single Agent (Easiest Start)**
490
+
491
+ **Quick Start Commands:**
492
+ ```bash
493
+ # Quick test with any supported model - no configuration needed
494
+ uv run python -m massgen.cli --model claude-3-5-sonnet-latest "What is machine learning?"
495
+ uv run python -m massgen.cli --model gemini-2.5-flash "Explain quantum computing"
496
+ uv run python -m massgen.cli --model gpt-5-nano "Summarize the latest AI developments"
497
+ ```
498
+
499
+ **Configuration:**
500
+
501
+ Use the `agent` field to define a single agent with its backend and settings:
502
+
503
+ ```yaml
504
+ agent:
505
+ id: "<agent_name>"
506
+ backend:
507
+ type: "azure_openai" | "chatcompletion" | "claude" | "claude_code" | "gemini" | "grok" | "openai" | "zai" | "lmstudio" #Type of backend
508
+ model: "<model_name>" # Model name
509
+ api_key: "<optional_key>" # API key for backend. Uses env vars by default.
510
+ system_message: "..." # System Message for Single Agent
511
+ ```
512
+
513
+ → [See all single agent configs](massgen/configs/basic/single/)
514
+
515
+
516
+ #### **2. Multi-Agent Collaboration (Recommended)**
517
+
518
+ **Configuration:**
519
+
520
+ Use the `agents` field to define multiple agents, each with its own backend and config:
521
+
522
+ **Quick Start Commands:**
523
+
524
+ ```bash
525
+ # Three powerful agents working together - Gemini, GPT-5, and Grok
526
+ massgen --config @examples/basic/multi/three_agents_default \
527
+ "Analyze the pros and cons of renewable energy"
528
+ ```
529
+
530
+ **This showcases MassGen's core strength:**
531
+ - **Gemini 2.5 Flash** - Fast research with web search
532
+ - **GPT-5 Nano** - Advanced reasoning with code execution
533
+ - **Grok-3 Mini** - Real-time information and alternative perspectives
534
+
535
+ ```yaml
536
+ agents: # Multiple agents (alternative to 'agent')
537
+ - id: "<agent1 name>"
538
+ backend:
539
+ type: "azure_openai" | "chatcompletion" | "claude" | "claude_code" | "gemini" | "grok" | "openai" | "zai" | "lmstudio" #Type of backend
540
+ model: "<model_name>" # Model name
541
+ api_key: "<optional_key>" # API key for backend. Uses env vars by default.
542
+ system_message: "..." # System Message for Single Agent
543
+ - id: "..."
544
+ backend:
545
+ type: "..."
546
+ model: "..."
547
+ ...
548
+ system_message: "..."
549
+ ```
550
+
551
+ → [Explore more multi-agent setups](massgen/configs/basic/multi/)
552
+
553
+
554
+ #### **3. Model context protocol (MCP)**
555
+
556
+ The [Model context protocol](https://modelcontextprotocol.io/) (MCP) standardises how applications expose tools and context to language models. From the official documentation:
557
+
558
+ >MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.
559
+
560
+ **MCP Configuration Parameters:**
561
+
562
+ | Parameter | Type | Required | Description |
563
+ |-----------|------|----------|-------------|
564
+ | `mcp_servers` | dict | **Yes** (for MCP) | Container for MCP server definitions |
565
+ | └─ `type` | string | Yes | Transport: `"stdio"` or `"streamable-http"` |
566
+ | └─ `command` | string | stdio only | Command to run the MCP server |
567
+ | └─ `args` | list | stdio only | Arguments for the command |
568
+ | └─ `url` | string | http only | Server endpoint URL |
569
+ | └─ `env` | dict | No | Environment variables to pass |
570
+ | `allowed_tools` | list | No | Whitelist specific tools (if omitted, all tools available) |
571
+ | `exclude_tools` | list | No | Blacklist dangerous/unwanted tools |
572
+
573
+
574
+ **Quick Start Commands ([Check backend MCP support here](#tools)):**
575
+
576
+ ```bash
577
+ # Weather service with GPT-5
578
+ massgen --config @examples/tools/mcp/gpt5_nano_mcp_example \
579
+ "What's the weather forecast for New York this week?"
580
+
581
+ # Multi-tool MCP with Gemini - Search + Weather + Filesystem (Requires BRAVE_API_KEY in .env)
582
+ massgen --config @examples/tools/mcp/multimcp_gemini \
583
+ "Find the best restaurants in Paris and save the recommendations to a file"
584
+ ```
585
+
586
+ **Configuration:**
587
+
588
+ ```yaml
589
+ agents:
590
+ # Basic MCP Configuration:
591
+ backend:
592
+ type: "openai" # Your backend choice
593
+ model: "gpt-5-mini" # Your model choice
594
+
595
+ # Add MCP servers here
596
+ mcp_servers:
597
+ weather: # Server name (you choose this)
598
+ type: "stdio" # Communication type
599
+ command: "npx" # Command to run
600
+ args: ["-y", "@modelcontextprotocol/server-weather"] # MCP server package
601
+
602
+ # That's it! The agent can now check weather.
603
+
604
+ # Multiple MCP Tools Example:
605
+ backend:
606
+ type: "gemini"
607
+ model: "gemini-2.5-flash"
608
+ mcp_servers:
609
+ # Web search
610
+ search:
611
+ type: "stdio"
612
+ command: "npx"
613
+ args: ["-y", "@modelcontextprotocol/server-brave-search"]
614
+ env:
615
+ BRAVE_API_KEY: "${BRAVE_API_KEY}" # Set in .env file
616
+
617
+ # HTTP-based MCP server (streamable-http transport)
618
+ custodm_api:
619
+ type: "streamable-http" # For HTTP/SSE servers
620
+ url: "http://localhost:8080/mcp/sse" # Server endpoint
621
+
622
+
623
+ # Tool configuration (MCP tools are auto-discovered)
624
+ allowed_tools: # Optional: whitelist specific tools
625
+ - "mcp__weather__get_current_weather"
626
+ - "mcp__test_server__mcp_echo"
627
+ - "mcp__test_server__add_numbers"
628
+
629
+ exclude_tools: # Optional: blacklist specific tools
630
+ - "mcp__test_server__current_time"
631
+ ```
632
+
633
+ → [View more MCP examples](massgen/configs/tools/mcp/)
634
+
635
+ → For comprehensive MCP integration guide, see [MCP Integration](https://massgen.readthedocs.io/en/latest/user_guide/mcp_integration.html)
636
+
637
+ #### **4. File System Operations & Workspace Management**
638
+
639
+ MassGen provides comprehensive file system support through multiple backends, enabling agents to read, write, and manipulate files in organized workspaces.
640
+
641
+
642
+ **Filesystem Configuration Parameters:**
643
+
644
+ | Parameter | Type | Required | Description |
645
+ |-----------|------|----------|-------------|
646
+ | `cwd` | string | **Yes** (for file ops) | Working directory for file operations (agent-specific workspace) |
647
+ | `snapshot_storage` | string | Yes | Directory for workspace snapshots |
648
+ | `agent_temporary_workspace` | string | Yes | Parent directory for temporary workspaces |
649
+
650
+
651
+ **Quick Start Commands:**
652
+
653
+ ```bash
654
+ # File operations with Claude Code
655
+ massgen --config @examples/tools/filesystem/claude_code_single \
656
+ "Create a Python web scraper and save results to CSV"
657
+
658
+ # Multi-agent file collaboration
659
+ massgen --config @examples/tools/filesystem/claude_code_context_sharing \
660
+ "Generate a comprehensive project report with charts and analysis"
661
+ ```
662
+
663
+ **Configuration:**
664
+
665
+ ```yaml
666
+ # Basic Workspace Setup:
667
+ agents:
668
+ - id: "file-agent"
669
+ backend:
670
+ type: "claude_code" # Backend with file support
671
+ model: "claude-sonnet-4" # Your model choice
672
+ cwd: "workspace" # Isolated workspace for file operations
673
+
674
+ # Multi-Agent Workspace Isolation:
675
+ agents:
676
+ - id: "agent_a"
677
+ backend:
678
+ type: "claude_code"
679
+ cwd: "workspace1" # Agent-specific workspace
680
+
681
+ - id: "agent_b"
682
+ backend:
683
+ type: "gemini"
684
+ cwd: "workspace2" # Separate workspace
685
+
686
+ orchestrator:
687
+ snapshot_storage: "snapshots" # Shared snapshots directory
688
+ agent_temporary_workspace: "temp_workspaces" # Temporary workspace management
689
+ ```
690
+ **Available File Operations:**
691
+ - **Claude Code**: Built-in tools (Read, Write, Edit, MultiEdit, Bash, Grep, Glob, LS, TodoWrite)
692
+ - **Other Backends**: Via [MCP Filesystem Server](https://github.com/modelcontextprotocol/servers/blob/main/src%2Ffilesystem%2FREADME.md)
693
+
694
+ **Workspace Management:**
695
+ - **Isolated Workspaces**: Each agent's `cwd` is fully isolated and writable
696
+ - **Snapshot Storage**: Share workspace context between Claude Code agents
697
+ - **Temporary Workspaces**: Agents can access previous coordination results
698
+
699
+ → [View more filesystem examples](massgen/configs/tools/filesystem/)
700
+
701
+ > ⚠️ **IMPORTANT SAFETY WARNING**
702
+ >
703
+ > MassGen agents can **autonomously read, write, modify, and delete files** within their permitted directories.
704
+ >
705
+ > **Before running MassGen with filesystem access:**
706
+ > - Only grant access to directories you're comfortable with agents modifying
707
+ > - Use the permission system to restrict write access where needed
708
+ > - Consider testing in an isolated directory or virtual environment first
709
+ > - Back up important files before granting write access
710
+ > - Review the `context_paths` configuration carefully
711
+ >
712
+ > The agents will execute file operations without additional confirmation once permissions are granted.
713
+
714
+ → For comprehensive file operations guide, see [File Operations](https://massgen.readthedocs.io/en/latest/user_guide/file_operations.html)
715
+
716
+ #### **5. Project Integration & User Context Paths (NEW in v0.0.21)**
717
+
718
+ Work directly with your existing projects! User Context Paths allow you to share specific directories with all agents while maintaining granular permission control. This enables secure multi-agent collaboration on your real codebases, documentation, and data.
719
+
720
+ MassGen automatically organizes all its working files under a `.massgen/` directory in your project root, keeping your project clean and making it easy to exclude MassGen's temporary files from version control.
721
+
722
+ **Project Integration Parameters:**
723
+
724
+ | Parameter | Type | Required | Description |
725
+ |-----------|------|----------|-------------|
726
+ | `context_paths` | list | **Yes** (for project integration) | Shared directories for all agents |
727
+ | └─ `path` | string | Yes | Absolute or relative path to your project directory (**must be directory, not file**) |
728
+ | └─ `permission` | string | Yes | Access level: `"read"` or `"write"` (write applies only to final agent) |
729
+ | └─ `protected_paths` | list | No | Files/directories immune from modification (relative to context path) |
730
+
731
+ **⚠️ Important Notes:**
732
+ - Context paths must point to **directories**, not individual files
733
+ - Paths can be **absolute** or **relative** (resolved against current working directory)
734
+ - **Write permissions** apply only to the **final agent** during presentation phase
735
+ - During coordination, all context paths are **read-only** to protect your files
736
+ - MassGen validates all paths during startup and will show clear error messages for missing paths or file paths
737
+
738
+
739
+ **Quick Start Commands:**
740
+
741
+ ```bash
742
+ # Multi-agent collaboration to improve the website in `massgen/configs/resources/v0.0.21-example
743
+ 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."
744
+ ```
745
+
746
+ **Configuration:**
747
+
748
+ ```yaml
749
+ # Basic Project Integration:
750
+ agents:
751
+ - id: "code-reviewer"
752
+ backend:
753
+ type: "claude_code"
754
+ cwd: "workspace" # Agent's isolated work area
755
+
756
+ orchestrator:
757
+ context_paths:
758
+ - path: "." # Current directory (relative path)
759
+ permission: "write" # Final agent can create/modify files
760
+ protected_paths: # Optional: files immune from modification
761
+ - ".env"
762
+ - "config.json"
763
+ - path: "/home/user/my-project/src" # Absolute path example
764
+ permission: "read" # Agents can analyze your code
765
+
766
+ # Advanced: Multi-Agent Project Collaboration
767
+ agents:
768
+ - id: "analyzer"
769
+ backend:
770
+ type: "gemini"
771
+ cwd: "analysis_workspace"
772
+
773
+ - id: "implementer"
774
+ backend:
775
+ type: "claude_code"
776
+ cwd: "implementation_workspace"
777
+
778
+ orchestrator:
779
+ context_paths:
780
+ - path: "../legacy-app/src" # Relative path to existing codebase
781
+ permission: "read" # Read existing codebase
782
+ - path: "../legacy-app/tests"
783
+ permission: "write" # Final agent can write new tests
784
+ protected_paths: # Protect specific test files
785
+ - "integration_tests/production_data_test.py"
786
+ - path: "/home/user/modernized-app" # Absolute path
787
+ permission: "write" # Final agent can create modernized version
788
+ ```
789
+
790
+ **This showcases project integration:**
791
+ - **Real Project Access** - Work with your actual codebases, not copies
792
+ - **Secure Permissions** - Granular control over what agents can read/modify
793
+ - **Multi-Agent Collaboration** - Multiple agents safely work on the same project
794
+ - **Context Agents** (during coordination): Always READ-only access to protect your files
795
+ - **Final Agent** (final execution): Gets the configured permission (READ or write)
796
+
797
+ **Use Cases:**
798
+ - **Code Review**: Agents analyze your source code and suggest improvements
799
+ - **Documentation**: Agents read project docs to understand context and generate updates
800
+ - **Data Processing**: Agents access shared datasets and generate analysis reports
801
+ - **Project Migration**: Agents examine existing projects and create modernized versions
802
+
803
+ **Clean Project Organization:**
804
+ ```
805
+ your-project/
806
+ ├── .massgen/ # All MassGen state
807
+ │ ├── sessions/ # Multi-turn conversation history (if using interactively)
808
+ │ │ └── session_20240101_143022/
809
+ │ │ ├── turn_1/ # Results from turn 1
810
+ │ │ ├── turn_2/ # Results from turn 2
811
+ │ │ └── SESSION_SUMMARY.txt # Human-readable summary
812
+ │ ├── workspaces/ # Agent working directories
813
+ │ │ ├── agent1/ # Individual agent workspaces
814
+ │ │ └── agent2/
815
+ │ ├── snapshots/ # Workspace snapshots for coordination
816
+ │ └── temp_workspaces/ # Previous turn results for context
817
+ ├── massgen/
818
+ └── ...
819
+ ```
820
+
821
+ **Benefits:**
822
+ - ✅ **Clean Projects** - All MassGen files contained in one directory
823
+ - ✅ **Easy Gitignore** - Just add `.massgen/` to `.gitignore`
824
+ - ✅ **Portable** - Move or delete `.massgen/` without affecting your project
825
+ - ✅ **Multi-Turn Sessions** - Conversation history preserved across sessions
826
+
827
+ **Configuration Auto-Organization:**
828
+ ```yaml
829
+ orchestrator:
830
+ # User specifies simple names - MassGen organizes under .massgen/
831
+ snapshot_storage: "snapshots" # → .massgen/snapshots/
832
+ session_storage: "sessions" # → .massgen/sessions/
833
+ agent_temporary_workspace: "temp" # → .massgen/temp/
834
+
835
+ agents:
836
+ - backend:
837
+ cwd: "workspace1" # → .massgen/workspaces/workspace1/
838
+ ```
839
+
840
+ → [Learn more about project integration](massgen/mcp_tools/permissions_and_context_files.md)
841
+
842
+ → For comprehensive project integration guide, see [Project Integration](https://massgen.readthedocs.io/en/latest/user_guide/project_integration.html)
843
+
844
+ **Security Considerations:**
845
+ - **Agent ID Safety**: Avoid using agent+incremental digits for IDs (e.g., `agent1`, `agent2`). This may cause ID exposure during voting
846
+ - **File Access Control**: Restrict file access using MCP server configurations when needed
847
+ - **Path Validation**: All context paths are validated to ensure they exist and are directories (not files)
848
+ - **Directory-Only Context Paths**: Context paths must point to directories, not individual files
849
+
850
+ ---
851
+
852
+ #### Additional Examples by Provider
853
+
854
+ **Claude (Recursive MCP Execution - v0.0.20+)**
855
+ ```bash
856
+ # Claude with advanced tool chaining
857
+ massgen --config @examples/tools/mcp/claude_mcp_example \
858
+ "Research and compare weather in Beijing and Shanghai"
859
+ ```
860
+
861
+ **OpenAI (GPT-5 Series with MCP - v0.0.17+)**
862
+ ```bash
863
+ # GPT-5 with weather and external tools
864
+ massgen --config @examples/tools/mcp/gpt5_mini_mcp_example \
865
+ "What's the weather of Tokyo"
866
+ ```
867
+
868
+ **Gemini (Multi-Server MCP - v0.0.15+)**
869
+ ```bash
870
+ # Gemini with multiple MCP services
871
+ massgen --config @examples/tools/mcp/multimcp_gemini \
872
+ "Find accommodations in Paris with neighborhood analysis" # (requires BRAVE_API_KEY in .env)
873
+ ```
874
+
875
+ **Claude Code (Development Tools)**
876
+ ```bash
877
+ # Professional development environment with auto-configured workspace
878
+ uv run python -m massgen.cli \
879
+ --backend claude_code \
880
+ --model sonnet \
881
+ "Create a Flask web app with authentication"
882
+
883
+ # Default workspace directories created automatically:
884
+ # - workspace1/ (working directory)
885
+ # - snapshots/ (workspace snapshots)
886
+ # - temp_workspaces/ (temporary agent workspaces)
887
+ ```
888
+
889
+ **Local Models (LM Studio - v0.0.7+)**
890
+ ```bash
891
+ # Run open-source models locally
892
+ massgen --config @examples/providers/local/lmstudio \
893
+ "Explain machine learning concepts"
894
+ ```
895
+
896
+ → [Browse by provider](massgen/configs/providers/) | [Browse by tools](massgen/configs/tools/) | [Browse teams](massgen/configs/teams/)
897
+
898
+ #### Additional Use Case Examples
899
+
900
+ **Question Answering & Research:**
901
+ ```bash
902
+ # Complex research with multiple perspectives
903
+ massgen --config @examples/basic/multi/gemini_4o_claude \
904
+ "What's best to do in Stockholm in October 2025"
905
+
906
+ # Specific research requirements
907
+ massgen --config @examples/basic/multi/gemini_4o_claude \
908
+ "Give me all the talks on agent frameworks in Berkeley Agentic AI Summit 2025"
909
+ ```
910
+
911
+ **Creative Writing:**
912
+ ```bash
913
+ # Story generation with multiple creative agents
914
+ massgen --config @examples/basic/multi/gemini_4o_claude \
915
+ "Write a short story about a robot who discovers music"
916
+ ```
917
+
918
+ **Development & Coding:**
919
+ ```bash
920
+ # Full-stack development with file operations
921
+ massgen --config @examples/tools/filesystem/claude_code_single \
922
+ "Create a Flask web app with authentication"
923
+ ```
924
+
925
+ **Web Automation:** (still in test)
926
+ ```bash
927
+ # Browser automation with screenshots and reporting
928
+ # Prerequisites: npm install @playwright/mcp@latest (for Playwright MCP server)
929
+ massgen --config @examples/tools/code-execution/multi_agent_playwright_automation \
930
+ "Browse three issues in https://github.com/Leezekun/MassGen and suggest documentation improvements. Include screenshots and suggestions in a website."
931
+
932
+ # Data extraction and analysis
933
+ massgen --config @examples/tools/code-execution/multi_agent_playwright_automation \
934
+ "Navigate to https://news.ycombinator.com, extract the top 10 stories, and create a summary report"
935
+ ```
936
+
937
+ → [**See detailed case studies**](docs/case_studies/README.md) with real session logs and outcomes
938
+
939
+ #### Interactive Mode & Advanced Usage
940
+
941
+ **Multi-Turn Conversations:**
942
+ ```bash
943
+ # Start interactive chat (no initial question)
944
+ massgen --config @examples/basic/multi/three_agents_default
945
+
946
+ # Debug mode for troubleshooting
947
+ massgen --config @examples/basic/multi/three_agents_default \
948
+ --debug "Your question"
949
+ ```
950
+
951
+ ## Configuration Files
952
+
953
+ MassGen configurations are organized by features and use cases. See the [Configuration Guide](massgen/configs/README.md) for detailed organization and examples.
954
+
955
+ **Quick navigation:**
956
+ - **Basic setups**: [Single agent](massgen/configs/basic/single/) | [Multi-agent](massgen/configs/basic/multi/)
957
+ - **Tool integrations**: [MCP servers](massgen/configs/tools/mcp/) | [Web search](massgen/configs/tools/web-search/) | [Filesystem](massgen/configs/tools/filesystem/)
958
+ - **Provider examples**: [OpenAI](massgen/configs/providers/openai/) | [Claude](massgen/configs/providers/claude/) | [Gemini](massgen/configs/providers/gemini/)
959
+ - **Specialized teams**: [Creative](massgen/configs/teams/creative/) | [Research](massgen/configs/teams/research/) | [Development](massgen/configs/teams/development/)
960
+
961
+ See MCP server setup guides: [Discord MCP](massgen/configs/docs/DISCORD_MCP_SETUP.md) | [Twitter MCP](massgen/configs/docs/TWITTER_MCP_ENESCINAR_SETUP.md)
962
+
963
+ #### Backend Configuration Reference
964
+
965
+ For detailed configuration of all supported backends (OpenAI, Claude, Gemini, Grok, etc.), see:
966
+
967
+ → **[Backend Configuration Guide](massgen/configs/BACKEND_CONFIGURATION.md)**
968
+
969
+ #### Interactive Multi-Turn Mode
970
+
971
+ MassGen supports an interactive mode where you can have ongoing conversations with the system:
972
+
973
+ ```bash
974
+ # Start interactive mode with a single agent (no tool enabled by default)
975
+ uv run python -m massgen.cli --model gpt-5-mini
976
+
977
+ # Start interactive mode with configuration file
978
+ uv run python -m massgen.cli \
979
+ --config massgen/configs/basic/multi/three_agents_default.yaml
980
+ ```
981
+
982
+ **Interactive Mode Features:**
983
+ - **Multi-turn conversations**: Multiple agents collaborate to chat with you in an ongoing conversation
984
+ - **Real-time coordination tracking**: Live visualization of agent interactions, votes, and decision-making processes
985
+ - **Interactive coordination table**: Press `r` to view complete history of agent coordination events and state transitions
986
+ - **Real-time feedback**: Displays real-time agent and system status with enhanced coordination visualization
987
+ - **Clear conversation history**: Type `/clear` to reset the conversation and start fresh
988
+ - **Easy exit**: Type `/quit`, `/exit`, `/q`, or press `Ctrl+C` to stop
989
+
990
+ **Watch the recorded demo:**
991
+
992
+ [![MassGen Case Study](https://img.youtube.com/vi/h1R7fxFJ0Zc/0.jpg)](https://www.youtube.com/watch?v=h1R7fxFJ0Zc)
993
+
994
+ ### 5. 📊 View Results
995
+
996
+ The system provides multiple ways to view and analyze results:
997
+
998
+ #### Real-time Display
999
+ - **Live Collaboration View**: See agents working in parallel through a multi-region terminal display
1000
+ - **Status Updates**: Real-time phase transitions, voting progress, and consensus building
1001
+ - **Streaming Output**: Watch agents' reasoning and responses as they develop
1002
+
1003
+ **Watch an example here:**
1004
+
1005
+ [![MassGen Case Study](https://img.youtube.com/vi/Dp2oldJJImw/0.jpg)](https://www.youtube.com/watch?v=Dp2oldJJImw)
1006
+
1007
+ #### Comprehensive Logging
1008
+
1009
+ All sessions are automatically logged with detailed information for debugging and analysis.
1010
+
1011
+ **Real-time Interaction:**
1012
+ - Press `r` during execution to view the coordination table in your terminal
1013
+ - Watch agents collaborate, vote, and reach consensus in real-time
1014
+
1015
+ ##### Logging Storage Structure
1016
+
1017
+ ```
1018
+ .massgen/
1019
+ └── massgen_logs/
1020
+ └── log_YYYYMMDD_HHMMSS/ # Timestamped log directory
1021
+ ├── agent_<id>/ # Agent-specific coordination logs
1022
+ │ └── YYYYMMDD_HHMMSS_NNNNNN/ # Timestamped coordination steps
1023
+ │ ├── answer.txt # Agent's answer at this step
1024
+ │ ├── context.txt # Context available to agent
1025
+ │ └── workspace/ # Agent workspace (if filesystem tools used)
1026
+ ├── agent_outputs/ # Consolidated output files
1027
+ │ ├── agent_<id>.txt # Complete output from each agent
1028
+ │ ├── final_presentation_agent_<id>.txt # Winning agent's final answer
1029
+ │ ├── final_presentation_agent_<id>_latest.txt # Symlink to latest
1030
+ │ └── system_status.txt # System status and metadata
1031
+ ├── final/ # Final presentation phase
1032
+ │ └── agent_<id>/ # Winning agent's final work
1033
+ │ ├── answer.txt # Final answer
1034
+ │ └── context.txt # Final context
1035
+ ├── coordination_events.json # Structured coordination events
1036
+ ├── coordination_table.txt # Human-readable coordination table
1037
+ ├── vote.json # Final vote tallies and consensus data
1038
+ ├── massgen.log # Complete debug log (or massgen_debug.log in debug mode)
1039
+ ├── snapshot_mappings.json # Workspace snapshot metadata
1040
+ └── execution_metadata.yaml # Query, config, and execution details
1041
+ ```
1042
+
1043
+ ##### Key Log Files
1044
+
1045
+ - **Coordination Table** (`coordination_table.txt`): Complete visualization of multi-agent coordination with event timeline, voting patterns, and consensus building
1046
+ - **Coordination Events** (`coordination_events.json`): Structured JSON log of all events (started_streaming, new_answer, vote, restart, final_answer)
1047
+ - **Vote Summary** (`vote.json`): Final vote tallies, winning agent, and consensus information
1048
+ - **Execution Metadata** (`execution_metadata.yaml`): Original query, timestamp, configuration, and execution context for reproducibility
1049
+ - **Agent Outputs** (`agent_outputs/`): Complete output history and final presentations from all agents
1050
+ - **Debug Log** (`massgen.log`): Complete system operations, API calls, tool usage, and error traces (use `--debug` for verbose logging)
1051
+
1052
+ → For comprehensive logging guide and debugging techniques, see [Logging & Debugging](https://massgen.readthedocs.io/en/latest/user_guide/logging.html)
1053
+
1054
+ ## 💡 Case Studies
1055
+
1056
+ To see how MassGen works in practice, check out these detailed case studies based on real session logs:
1057
+
1058
+ - [**MassGen Case Studies**](docs/case_studies/README.md)
1059
+ - [**Case Studies Documentation**](https://massgen.readthedocs.io/en/latest/examples/case_studies.html) - Browse case studies online
1060
+
1061
+ ---
1062
+
1063
+
1064
+ ## 🗺️ Roadmap
1065
+
1066
+ MassGen is currently in its foundational stage, with a focus on parallel, asynchronous multi-agent collaboration and orchestration. Our roadmap is centered on transforming this foundation into a highly robust, intelligent, and user-friendly system, while enabling frontier research and exploration. An earlier version of MassGen can be found [here](./massgen/v1).
1067
+
1068
+ ⚠️ **Early Stage Notice:** As MassGen is in active development, please expect upcoming breaking architecture changes as we continue to refine and improve the system.
1069
+
1070
+ ### Recent Achievements (v0.1.0)
1071
+
1072
+ **🎉 Released: October 17, 2025**
1073
+
1074
+ #### PyPI Package Release
1075
+ - **Official Distribution**: MassGen now available via `pip install massgen`
1076
+ - **Simplified Installation**: No need to clone repository for standard usage
1077
+ - **Global Access**: Run `massgen` command from any directory after pip install
1078
+
1079
+ #### Comprehensive Documentation
1080
+ - **Sphinx Documentation**: Full documentation site at [massgen.readthedocs.io](https://massgen.readthedocs.io)
1081
+ - **Complete User Guide**: Installation, configuration, usage modes, and API reference
1082
+ - **Case Studies**: Real-world examples with session logs and outcomes
1083
+ - **Structured Navigation**: Getting Started, User Guide, Reference, Examples, and Development sections
1084
+
1085
+ #### Interactive Setup Wizard
1086
+ - **Guided Configuration**: Step-by-step wizard for first-time users
1087
+ - **Use Case Presets**: Research, Code, Q&A, Data Analysis, and more
1088
+ - **API Key Management**: Centralized configuration in `~/.config/massgen/`
1089
+ - **Smart Defaults**: Auto-configured tools based on selected use case
1090
+
1091
+ #### Enhanced CLI Experience
1092
+ - **Simplified Commands**: Clean `massgen` command with intuitive syntax
1093
+ - **Built-in Examples**: `@examples/` prefix for instant access to configurations
1094
+ - **Backwards Compatibility**: Existing git clone workflows continue to work
1095
+
1096
+ ### Recent Achievements (v0.0.32)
1097
+
1098
+ **🎉 Released: October 15, 2025**
1099
+
1100
+ #### Docker Execution Mode
1101
+ - **Container-Based Isolation**: Secure command execution in isolated Docker containers preventing host filesystem access
1102
+ - **Persistent State Management**: Packages and dependencies persist across conversation turns eliminating redundant setup
1103
+ - **Multi-Agent Support**: Each agent receives dedicated isolated container enabling safe parallel execution
1104
+ - **Configurable Security**: Resource limits (CPU, memory), network isolation modes, and read-only volume mounts
1105
+
1106
+ **⚠️ Docker Setup Required:**
1107
+ To use Docker execution mode, complete these steps before running:
1108
+ 1. **Docker Engine 28.0.0+** installed and running (`docker ps` should work)
1109
+ 2. **Python docker library**: `uv pip install -e ".[docker]"` or `pip install docker>=7.0.0`
1110
+ 3. **Build Docker image**: `bash massgen/docker/build.sh` (from repository root)
1111
+ 4. **📚 Full setup guide**: See `massgen/docker/README.md` for complete instructions
1112
+
1113
+ #### MCP Architecture Refactoring
1114
+ - **Simplified Client**: Renamed `MultiMCPClient` to `MCPClient` reflecting streamlined architecture
1115
+ - **Code Consolidation**: Removed deprecated modules and consolidated duplicate MCP protocol handling
1116
+ - **Improved Maintainability**: Standardized type hints, enhanced error handling, cleaner code organization
1117
+
1118
+ #### Claude Code Docker Integration
1119
+ - **Automatic Tool Management**: Bash tool automatically disabled in Docker mode routing commands through execute_command
1120
+ - **MCP Auto-Permissions**: Automatic approval for MCP tools while preserving security validation
1121
+ - **Enhanced Guidance**: System messages prevent git repository confusion between host and container environments
1122
+
1123
+ #### Configuration and Testing
1124
+ - **Docker Documentation**: `massgen/docker/README.md` with setup guide and build scripts
1125
+ - **Example Configurations**: `docker_simple.yaml`, `docker_multi_agent.yaml`, `docker_with_resource_limits.yaml`, `docker_claude_code.yaml`, `docker_verification.yaml`
1126
+ - **Testing**: Comprehensive test suite validating Docker and local execution modes
1127
+
1128
+ ### Recent Achievements (v0.0.31)
1129
+
1130
+ **🎉 Released: October 13, 2025**
1131
+
1132
+ #### Universal Code Execution
1133
+ - **MCP-Based Tool**: New `execute_command` tool works across Claude, Gemini, OpenAI, and Chat Completions backends
1134
+ - **AG2-Inspired Security**: Permission management and command filtering (whitelist/blacklist patterns)
1135
+ - **Planning Mode Support**: Code execution in planning mode for safer coordination
1136
+
1137
+ #### AG2 Group Chat Integration
1138
+ - **Multi-Agent Conversations**: Native support using AG2's GroupChat and GroupChatManager frameworks
1139
+ - **Smart Speaker Selection**: Automatic, round-robin, or manual selection powered by LLMs
1140
+ - **Enhanced Adapter**: AG2 adapter supporting native group chat coordination
1141
+
1142
+ #### Audio & Video Generation
1143
+ - **Audio Tools**: Text-to-speech and transcription capabilities
1144
+ - **Video Generation**: Integration with OpenAI's Sora-2 API for video creation
1145
+ - **Multimodal Expansion**: Extended capabilities beyond text and images
1146
+
1147
+ ### Previous Achievements (v0.0.3 - v0.0.32)
1148
+
1149
+ <div style="max-height: 600px; overflow-y: auto; transition: max-height 0.3s ease;">
1150
+
1151
+ ✅ **Universal Command Execution (v0.0.31)**: MCP-based execute_command tool works across Claude, Gemini, OpenAI, and Chat Completions providers, AG2-inspired security with permission management and command filtering, code execution in planning mode for safer coordination
1152
+
1153
+ ✅ **AG2 Group Chat Integration (v0.0.31)**: Multi-agent conversations using AG2's GroupChat and GroupChatManager frameworks, smart speaker selection (automatic, round-robin, manual) powered by LLMs, enhanced AG2 adapter supporting native group chat coordination
1154
+
1155
+ ✅ **Audio & Video Generation (v0.0.31)**: Audio tools for text-to-speech and transcription, video generation using OpenAI's Sora-2 API, multimodal expansion beyond text and images
1156
+
1157
+ ✅ **Multimodal Support Extension (v0.0.30)**: Audio and video processing for Chat Completions and Claude backends (WAV, MP3, MP4, AVI, MOV, WEBM formats), flexible media input via local paths or URLs, extended base64 encoding for audio/video files, configurable file size limits
1158
+
1159
+ ✅ **Claude Agent SDK Migration (v0.0.30)**: Package migration from `claude-code-sdk` to `claude-agent-sdk>=0.0.22`, improved bash tool permission validation, enhanced system message handling
1160
+
1161
+ ✅ **Qwen API Integration (v0.0.30)**: Added Qwen API provider to Chat Completions ecosystem with `QWEN_API_KEY` support, video understanding configuration examples
1162
+
1163
+ ✅ **MCP Planning Mode (v0.0.29)**: Strategic planning coordination strategy for safer MCP tool usage, multi-backend support (Response API, Chat Completions, Gemini), agents plan without execution during coordination, 5 planning mode configurations
1164
+
1165
+ ✅ **File Operation Safety (v0.0.29)**: Read-before-delete enforcement with `FileOperationTracker` class, `PathPermissionManager` integration with operation tracking methods, enhanced file operation safety mechanisms
1166
+
1167
+ ✅ **AG2 Framework Integration (v0.0.28)**: Adapter system for external agent frameworks, AG2 ConversableAgent and AssistantAgent support with async execution, code execution in multiple environments (Local, Docker, Jupyter, YepCode), 4 ready-to-use AG2 configurations
1168
+
1169
+ ✅ **Multimodal Support - Image Processing (v0.0.27)**: New `stream_chunk` module for multimodal content, image generation and understanding capabilities, file upload and search for document Q&A, Claude Sonnet 4.5 support, enhanced workspace multimodal tools
1170
+
1171
+ ✅ **File Deletion and Workspace Management (v0.0.26)**: New MCP tools (`delete_file`, `delete_files_batch`, `compare_directories`, `compare_files`) for workspace cleanup and file comparison, consolidated `_workspace_tools_server.py`, enhanced path permission manager
1172
+
1173
+ ✅ **Protected Paths and File-Based Context Paths (v0.0.26)**: Protect specific files within write-permitted directories, grant access to individual files instead of entire directories
1174
+
1175
+ ✅ **Multi-Turn Filesystem Support (v0.0.25)**: Multi-turn conversation support with persistent context across turns, automatic `.massgen` directory structure, workspace snapshots and restoration, enhanced path permission system with smart exclusions, and comprehensive backend improvements
1176
+
1177
+ ✅ **SGLang Backend Integration (v0.0.25)**: Unified vLLM/SGLang backend with auto-detection, support for SGLang-specific parameters like `separate_reasoning`, and dual server support for mixed vLLM and SGLang deployments
1178
+
1179
+ ✅ **vLLM Backend Support (v0.0.24)**: Complete integration with vLLM for high-performance local model serving, POE provider support, GPT-5-Codex model recognition, backend utility modules refactoring, and comprehensive bug fixes including streaming chunk processing
1180
+
1181
+ ✅ **Backend Architecture Refactoring (v0.0.23)**: Major code consolidation with new `base_with_mcp.py` class reducing ~1,932 lines across backends, extracted formatter module for better code organization, and improved maintainability through unified MCP integration
1182
+
1183
+ ✅ **Workspace Copy Tools via MCP (v0.0.22)**: Seamless file copying capabilities between workspaces, configuration organization with hierarchical structure, and enhanced file operations for large-scale collaboration
1184
+
1185
+ ✅ **Grok MCP Integration (v0.0.21)**: Unified backend architecture with full MCP server support, filesystem capabilities through MCP servers, and enhanced configuration files
1186
+
1187
+ ✅ **Claude Backend MCP Support (v0.0.20)**: Extended MCP integration to Claude backend, full MCP protocol and filesystem support, robust error handling, and comprehensive documentation
1188
+
1189
+ ✅ **Comprehensive Coordination Tracking (v0.0.19)**: Complete coordination tracking and visualization system with event-based tracking, interactive coordination table display, and advanced debugging capabilities for multi-agent collaboration patterns
1190
+
1191
+ ✅ **Comprehensive MCP Integration (v0.0.18)**: Extended MCP to all Chat Completions backends (Cerebras AI, Together AI, Fireworks AI, Groq, Nebius AI Studio, OpenRouter), cross-provider function calling compatibility, 9 new MCP configuration examples
1192
+
1193
+ ✅ **OpenAI MCP Integration (v0.0.17)**: Extended MCP (Model Context Protocol) support to OpenAI backend with full tool discovery and execution capabilities for GPT models, unified MCP architecture across multiple backends, and enhanced debugging
1194
+
1195
+ ✅ **Unified Filesystem Support with MCP Integration (v0.0.16)**: Complete `FilesystemManager` class providing unified filesystem access for Gemini and Claude Code backends, with MCP-based operations for file manipulation and cross-agent collaboration
1196
+
1197
+ ✅ **MCP Integration Framework (v0.0.15)**: Complete MCP implementation for Gemini backend with multi-server support, circuit breaker patterns, and comprehensive security framework
1198
+
1199
+ ✅ **Enhanced Logging (v0.0.14)**: Improved logging system for better agents' answer debugging, new final answer directory structure, and detailed architecture documentation
1200
+
1201
+ ✅ **Unified Logging System (v0.0.13)**: Centralized logging infrastructure with debug mode and enhanced terminal display formatting
1202
+
1203
+ ✅ **Windows Platform Support (v0.0.13)**: Windows platform compatibility with improved path handling and process management
1204
+
1205
+ ✅ **Enhanced Claude Code Agent Context Sharing (v0.0.12)**: Claude Code agents now share workspace context by maintaining snapshots and temporary workspace in orchestrator's side
1206
+
1207
+ ✅ **Documentation Improvement (v0.0.12)**: Updated README with current features and improved setup instructions
1208
+
1209
+ ✅ **Custom System Messages (v0.0.11)**: Enhanced system message configuration and preservation with backend-specific system prompt customization
1210
+
1211
+ ✅ **Claude Code Backend Enhancements (v0.0.11)**: Improved integration with better system message handling, JSON response parsing, and coordination action descriptions
1212
+
1213
+ ✅ **Azure OpenAI Support (v0.0.10)**: Integration with Azure OpenAI services including GPT-4.1 and GPT-5-chat models with async streaming
1214
+
1215
+ ✅ **MCP (Model Context Protocol) Support (v0.0.9)**: Integration with MCP for advanced tool capabilities in Claude Code Agent, including Discord and Twitter integration
1216
+
1217
+ ✅ **Timeout Management System (v0.0.8)**: Orchestrator-level timeout with graceful fallback and enhanced error messages
1218
+
1219
+ ✅ **Local Model Support (v0.0.7)**: Complete LM Studio integration for running open-weight models locally with automatic server management
1220
+
1221
+ ✅ **GPT-5 Series Integration (v0.0.6)**: Support for OpenAI's GPT-5, GPT-5-mini, GPT-5-nano with advanced reasoning parameters
1222
+
1223
+ ✅ **Claude Code Integration (v0.0.5)**: Native Claude Code backend with streaming capabilities and tool support
1224
+
1225
+ ✅ **GLM-4.5 Model Support (v0.0.4)**: Integration with ZhipuAI's GLM-4.5 model family
1226
+
1227
+ ✅ **Foundation Architecture (v0.0.3)**: Complete multi-agent orchestration system with async streaming, builtin tools, and multi-backend support
1228
+
1229
+ ✅ **Extended Provider Ecosystem**: Support for 15+ providers including Cerebras AI, Together AI, Fireworks AI, Groq, Nebius AI Studio, and OpenRouter
1230
+
1231
+ </div>
1232
+
1233
+ ### Key Future Enhancements
1234
+
1235
+ - **Bug Fixes & Backend Improvements:** Fixing image generation path issues and adding Claude multimodal support
1236
+ - **Advanced Agent Collaboration:** Exploring improved communication patterns and consensus-building protocols to improve agent synergy
1237
+ - **Expanded Model Integration:** Adding support for more frontier models and local inference engines
1238
+ - **Improved Performance & Scalability:** Optimizing the streaming and logging mechanisms for better performance and resource management
1239
+ - **Enhanced Developer Experience:** Completing tool registration system and web interface for better visualization
1240
+
1241
+ We welcome community contributions to achieve these goals.
1242
+
1243
+ ### v0.1.1 Roadmap
1244
+
1245
+ Version 0.1.1 focuses on developer experience improvements and PyPI distribution:
1246
+
1247
+ #### Required Features
1248
+ - **Configuration Builder CLI**: Interactive command-line tool for generating and validating MassGen configurations
1249
+ - **PyPI Package Release v0.1.0**: Official PyPI package representing new usage paradigm with easy pip installation
1250
+
1251
+ #### Optional Features
1252
+ - **Nested Chat Integration**: Complete AG2 nested chat pattern support for hierarchical agent conversations
1253
+ - **DSPy Integration**: Framework integration for prompt optimization and systematic agent improvement
1254
+
1255
+ Key technical approach:
1256
+ - **Config Builder**: Interactive prompts, configuration templates, validation and error checking, preset support
1257
+ - **PyPI Package**: Production-ready distribution with proper dependencies, documentation, and migration guide
1258
+ - **Nested Chat**: AG2 integration for hierarchical conversations with parent-child agent relationships
1259
+ - **DSPy**: Prompt optimization, performance tuning, and systematic agent improvement workflows
1260
+
1261
+ For detailed milestones and technical specifications, see the [full v0.1.1 roadmap](ROADMAP.md).
1262
+
1263
+ ---
1264
+
1265
+ ## 🤝 Contributing
1266
+
1267
+ We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
1268
+
1269
+ ---
1270
+
1271
+ ## 📄 License
1272
+
1273
+ This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
1274
+
1275
+ ---
1276
+
1277
+ <div align="center">
1278
+
1279
+ **⭐ Star this repo if you find it useful! ⭐**
1280
+
1281
+ Made with ❤️ by the MassGen team
1282
+
1283
+ </div>
1284
+
1285
+ ## ⭐ Star History
1286
+
1287
+ [![Star History Chart](https://api.star-history.com/svg?repos=Leezekun/MassGen&type=Date)](https://www.star-history.com/#Leezekun/MassGen&Date)