massgen 0.1.4__py3-none-any.whl → 0.1.6__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.
- massgen/__init__.py +1 -1
- massgen/backend/base_with_custom_tool_and_mcp.py +453 -23
- massgen/backend/capabilities.py +39 -0
- massgen/backend/chat_completions.py +111 -197
- massgen/backend/claude.py +210 -181
- massgen/backend/gemini.py +1015 -1559
- massgen/backend/grok.py +3 -2
- massgen/backend/response.py +160 -220
- massgen/chat_agent.py +340 -20
- massgen/cli.py +399 -25
- massgen/config_builder.py +20 -54
- massgen/config_validator.py +931 -0
- massgen/configs/README.md +95 -10
- massgen/configs/memory/gpt5mini_gemini_baseline_research_to_implementation.yaml +94 -0
- massgen/configs/memory/gpt5mini_gemini_context_window_management.yaml +187 -0
- massgen/configs/memory/gpt5mini_gemini_research_to_implementation.yaml +127 -0
- massgen/configs/memory/gpt5mini_high_reasoning_gemini.yaml +107 -0
- massgen/configs/memory/single_agent_compression_test.yaml +64 -0
- massgen/configs/tools/custom_tools/claude_code_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/claude_custom_tool_example_no_path.yaml +1 -1
- massgen/configs/tools/custom_tools/claude_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/computer_use_browser_example.yaml +1 -1
- massgen/configs/tools/custom_tools/computer_use_docker_example.yaml +1 -1
- massgen/configs/tools/custom_tools/gemini_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/gpt5_nano_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/gpt_oss_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/grok3_mini_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/interop/ag2_and_langgraph_lesson_planner.yaml +65 -0
- massgen/configs/tools/custom_tools/interop/ag2_and_openai_assistant_lesson_planner.yaml +65 -0
- massgen/configs/tools/custom_tools/interop/ag2_lesson_planner_example.yaml +48 -0
- massgen/configs/tools/custom_tools/interop/agentscope_lesson_planner_example.yaml +48 -0
- massgen/configs/tools/custom_tools/interop/langgraph_lesson_planner_example.yaml +49 -0
- massgen/configs/tools/custom_tools/interop/openai_assistant_lesson_planner_example.yaml +50 -0
- massgen/configs/tools/custom_tools/interop/smolagent_lesson_planner_example.yaml +49 -0
- massgen/configs/tools/custom_tools/qwen_api_custom_tool_with_mcp_example.yaml +1 -0
- massgen/configs/tools/custom_tools/two_models_with_tools_example.yaml +44 -0
- massgen/formatter/_gemini_formatter.py +61 -15
- massgen/memory/README.md +277 -0
- massgen/memory/__init__.py +26 -0
- massgen/memory/_base.py +193 -0
- massgen/memory/_compression.py +237 -0
- massgen/memory/_context_monitor.py +211 -0
- massgen/memory/_conversation.py +255 -0
- massgen/memory/_fact_extraction_prompts.py +333 -0
- massgen/memory/_mem0_adapters.py +257 -0
- massgen/memory/_persistent.py +687 -0
- massgen/memory/docker-compose.qdrant.yml +36 -0
- massgen/memory/docs/DESIGN.md +388 -0
- massgen/memory/docs/QUICKSTART.md +409 -0
- massgen/memory/docs/SUMMARY.md +319 -0
- massgen/memory/docs/agent_use_memory.md +408 -0
- massgen/memory/docs/orchestrator_use_memory.md +586 -0
- massgen/memory/examples.py +237 -0
- massgen/orchestrator.py +207 -7
- massgen/tests/memory/test_agent_compression.py +174 -0
- massgen/tests/memory/test_context_window_management.py +286 -0
- massgen/tests/memory/test_force_compression.py +154 -0
- massgen/tests/memory/test_simple_compression.py +147 -0
- massgen/tests/test_ag2_lesson_planner.py +223 -0
- massgen/tests/test_agent_memory.py +534 -0
- massgen/tests/test_config_validator.py +1156 -0
- massgen/tests/test_conversation_memory.py +382 -0
- massgen/tests/test_langgraph_lesson_planner.py +223 -0
- massgen/tests/test_orchestrator_memory.py +620 -0
- massgen/tests/test_persistent_memory.py +435 -0
- massgen/token_manager/token_manager.py +6 -0
- massgen/tool/__init__.py +2 -9
- massgen/tool/_decorators.py +52 -0
- massgen/tool/_extraframework_agents/ag2_lesson_planner_tool.py +251 -0
- massgen/tool/_extraframework_agents/agentscope_lesson_planner_tool.py +303 -0
- massgen/tool/_extraframework_agents/langgraph_lesson_planner_tool.py +275 -0
- massgen/tool/_extraframework_agents/openai_assistant_lesson_planner_tool.py +247 -0
- massgen/tool/_extraframework_agents/smolagent_lesson_planner_tool.py +180 -0
- massgen/tool/_manager.py +102 -16
- massgen/tool/_registered_tool.py +3 -0
- massgen/tool/_result.py +3 -0
- {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/METADATA +138 -77
- {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/RECORD +82 -37
- massgen/backend/gemini_mcp_manager.py +0 -545
- massgen/backend/gemini_trackers.py +0 -344
- {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/WHEEL +0 -0
- {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/entry_points.txt +0 -0
- {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/licenses/LICENSE +0 -0
- {massgen-0.1.4.dist-info → massgen-0.1.6.dist-info}/top_level.txt +0 -0
massgen/tool/_manager.py
CHANGED
|
@@ -220,17 +220,11 @@ class ToolManager:
|
|
|
220
220
|
if description:
|
|
221
221
|
tool_schema["function"]["description"] = description
|
|
222
222
|
|
|
223
|
-
#
|
|
224
|
-
|
|
225
|
-
if arg in tool_schema["function"]["parameters"]["properties"]:
|
|
226
|
-
tool_schema["function"]["parameters"]["properties"].pop(arg)
|
|
227
|
-
|
|
228
|
-
if "required" in tool_schema["function"]["parameters"]:
|
|
229
|
-
if arg in tool_schema["function"]["parameters"]["required"]:
|
|
230
|
-
tool_schema["function"]["parameters"]["required"].remove(arg)
|
|
223
|
+
# Extract context param names from decorator
|
|
224
|
+
context_param_names = getattr(base_func, "__context_params__", set())
|
|
231
225
|
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
# Remove preset args and context params from schema
|
|
227
|
+
self._remove_params_from_schema(tool_schema, set(preset_args or {}) | context_param_names)
|
|
234
228
|
|
|
235
229
|
tool_entry = RegisteredToolEntry(
|
|
236
230
|
tool_name=tool_name,
|
|
@@ -239,6 +233,7 @@ class ToolManager:
|
|
|
239
233
|
base_function=base_func,
|
|
240
234
|
schema_def=tool_schema,
|
|
241
235
|
preset_params=preset_args or {},
|
|
236
|
+
context_param_names=context_param_names,
|
|
242
237
|
extension_model=None,
|
|
243
238
|
post_processor=post_processor,
|
|
244
239
|
)
|
|
@@ -290,11 +285,13 @@ class ToolManager:
|
|
|
290
285
|
async def execute_tool(
|
|
291
286
|
self,
|
|
292
287
|
tool_request: dict,
|
|
288
|
+
execution_context: Optional[Dict[str, Any]] = None,
|
|
293
289
|
) -> AsyncGenerator[ExecutionResult, None]:
|
|
294
290
|
"""Execute a tool and return results as async generator.
|
|
295
291
|
|
|
296
292
|
Args:
|
|
297
293
|
tool_request: Tool execution request with name and input
|
|
294
|
+
execution_context: Optional execution context (messages, agent_id, etc.)
|
|
298
295
|
|
|
299
296
|
Yields:
|
|
300
297
|
ExecutionResult objects (accumulated)
|
|
@@ -313,13 +310,28 @@ class ToolManager:
|
|
|
313
310
|
|
|
314
311
|
tool_entry = self.registered_tools[tool_name]
|
|
315
312
|
|
|
316
|
-
#
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
313
|
+
# Extract context values for marked params only
|
|
314
|
+
context_values = {}
|
|
315
|
+
if execution_context and tool_entry.context_param_names:
|
|
316
|
+
context_values = {k: v for k, v in execution_context.items() if k in tool_entry.context_param_names}
|
|
317
|
+
|
|
318
|
+
# Validate all parameters match function signature
|
|
319
|
+
self._validate_params_match_signature(
|
|
320
|
+
tool_entry.base_function,
|
|
321
|
+
tool_entry.preset_params,
|
|
322
|
+
tool_entry.context_param_names,
|
|
323
|
+
tool_request,
|
|
324
|
+
tool_name,
|
|
325
|
+
)
|
|
326
|
+
|
|
327
|
+
# Merge all parameters (validation ensures all are valid):
|
|
328
|
+
# 1. Static preset params (from registration)
|
|
329
|
+
# 2. Dynamic context values (from execution_context, marked by decorator)
|
|
330
|
+
# 3. LLM input (from tool request)
|
|
320
331
|
exec_kwargs = {
|
|
321
|
-
**
|
|
322
|
-
**
|
|
332
|
+
**tool_entry.preset_params,
|
|
333
|
+
**context_values,
|
|
334
|
+
**(tool_request.get("input", {}) or {}),
|
|
323
335
|
}
|
|
324
336
|
|
|
325
337
|
# Prepare post-processor if exists
|
|
@@ -372,6 +384,73 @@ class ToolManager:
|
|
|
372
384
|
f"Tool must return ExecutionResult or Generator, got {type(result)}",
|
|
373
385
|
)
|
|
374
386
|
|
|
387
|
+
@staticmethod
|
|
388
|
+
def _validate_params_match_signature(
|
|
389
|
+
func: Callable,
|
|
390
|
+
preset_params: dict,
|
|
391
|
+
context_param_names: set,
|
|
392
|
+
tool_request: dict,
|
|
393
|
+
tool_name: str,
|
|
394
|
+
) -> None:
|
|
395
|
+
"""Validate that all provided parameters match function signature.
|
|
396
|
+
|
|
397
|
+
Args:
|
|
398
|
+
func: The function to validate against
|
|
399
|
+
preset_params: Static preset parameters
|
|
400
|
+
context_param_names: Context parameter names from decorator
|
|
401
|
+
tool_request: Tool request with LLM input
|
|
402
|
+
tool_name: Tool name for error messages
|
|
403
|
+
|
|
404
|
+
Raises:
|
|
405
|
+
ValueError: If any provided parameter doesn't match function signature
|
|
406
|
+
"""
|
|
407
|
+
sig = inspect.signature(func)
|
|
408
|
+
valid_params = set(sig.parameters.keys())
|
|
409
|
+
|
|
410
|
+
# Check preset args
|
|
411
|
+
invalid_preset = set(preset_params.keys()) - valid_params
|
|
412
|
+
if invalid_preset:
|
|
413
|
+
raise ValueError(
|
|
414
|
+
f"Tool '{tool_name}': preset_args contains invalid parameters: {invalid_preset}. " f"Valid parameters: {valid_params}",
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
# Check context params
|
|
418
|
+
invalid_context = context_param_names - valid_params
|
|
419
|
+
if invalid_context:
|
|
420
|
+
raise ValueError(
|
|
421
|
+
f"Tool '{tool_name}': @context_params decorator specifies invalid parameters: {invalid_context}. " f"Valid parameters: {valid_params}",
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
# Check LLM input
|
|
425
|
+
llm_input = tool_request.get("input", {}) or {}
|
|
426
|
+
invalid_llm = set(llm_input.keys()) - valid_params
|
|
427
|
+
if invalid_llm:
|
|
428
|
+
raise ValueError(
|
|
429
|
+
f"Tool '{tool_name}': LLM provided invalid parameters: {invalid_llm}. " f"Valid parameters: {valid_params}",
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
@staticmethod
|
|
433
|
+
def _remove_params_from_schema(tool_schema: dict, param_names: set) -> None:
|
|
434
|
+
"""Remove parameters from tool schema (for preset args and context params).
|
|
435
|
+
|
|
436
|
+
Args:
|
|
437
|
+
tool_schema: The tool schema to modify
|
|
438
|
+
param_names: Set of parameter names to remove
|
|
439
|
+
"""
|
|
440
|
+
for arg in param_names:
|
|
441
|
+
# Remove from properties
|
|
442
|
+
if arg in tool_schema["function"]["parameters"]["properties"]:
|
|
443
|
+
tool_schema["function"]["parameters"]["properties"].pop(arg)
|
|
444
|
+
|
|
445
|
+
# Remove from required list
|
|
446
|
+
if "required" in tool_schema["function"]["parameters"]:
|
|
447
|
+
if arg in tool_schema["function"]["parameters"]["required"]:
|
|
448
|
+
tool_schema["function"]["parameters"]["required"].remove(arg)
|
|
449
|
+
|
|
450
|
+
# Clean up empty required list
|
|
451
|
+
if not tool_schema["function"]["parameters"]["required"]:
|
|
452
|
+
tool_schema["function"]["parameters"].pop("required", None)
|
|
453
|
+
|
|
375
454
|
def fetch_category_hints(self) -> str:
|
|
376
455
|
"""Get usage hints from active categories.
|
|
377
456
|
|
|
@@ -570,12 +649,19 @@ class ToolManager:
|
|
|
570
649
|
|
|
571
650
|
func_desc = "\n\n".join(desc_parts)
|
|
572
651
|
|
|
652
|
+
# Get context param names to exclude from schema
|
|
653
|
+
context_param_names = getattr(func, "__context_params__", set())
|
|
654
|
+
|
|
573
655
|
# Build parameter fields
|
|
574
656
|
param_fields = {}
|
|
575
657
|
for param_name, param_info in inspect.signature(func).parameters.items():
|
|
576
658
|
if param_name in ["self", "cls"]:
|
|
577
659
|
continue
|
|
578
660
|
|
|
661
|
+
# Skip context params (they'll be injected at runtime)
|
|
662
|
+
if param_name in context_param_names:
|
|
663
|
+
continue
|
|
664
|
+
|
|
579
665
|
if param_info.kind == inspect.Parameter.VAR_KEYWORD:
|
|
580
666
|
if not include_varkwargs:
|
|
581
667
|
continue
|
massgen/tool/_registered_tool.py
CHANGED
|
@@ -32,6 +32,9 @@ class RegisteredToolEntry:
|
|
|
32
32
|
preset_params: dict[str, Any] = field(default_factory=dict)
|
|
33
33
|
"""Pre-configured parameters hidden from schema."""
|
|
34
34
|
|
|
35
|
+
context_param_names: set[str] = field(default_factory=set)
|
|
36
|
+
"""Parameter names to inject from execution context at runtime."""
|
|
37
|
+
|
|
35
38
|
extension_model: Optional[Type[BaseModel]] = None
|
|
36
39
|
"""Optional model for extending the base schema."""
|
|
37
40
|
|
massgen/tool/_result.py
CHANGED
|
@@ -59,6 +59,9 @@ class ExecutionResult:
|
|
|
59
59
|
is_final: bool = True
|
|
60
60
|
"""Indicates if this is the final result in a stream."""
|
|
61
61
|
|
|
62
|
+
is_log: bool = False
|
|
63
|
+
"""Indicates if this result is for logging purposes only."""
|
|
64
|
+
|
|
62
65
|
was_interrupted: bool = False
|
|
63
66
|
"""Indicates if the execution was interrupted."""
|
|
64
67
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: massgen
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
4
4
|
Summary: Multi-Agent Scaling System - A powerful framework for collaborative AI
|
|
5
5
|
Author-email: MassGen Team <contact@massgen.dev>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -49,11 +49,17 @@ Requires-Dist: ag2>=0.9.10
|
|
|
49
49
|
Requires-Dist: pyautogen>=0.10.0
|
|
50
50
|
Requires-Dist: vertexai>=1.71.1
|
|
51
51
|
Requires-Dist: pytest>=8.4.2
|
|
52
|
+
Requires-Dist: langchain-openai>=1.0.0
|
|
53
|
+
Requires-Dist: langgraph>=1.0.0
|
|
54
|
+
Requires-Dist: langchain-core>=1.0.0
|
|
55
|
+
Requires-Dist: agentscope>=1.0.6
|
|
56
|
+
Requires-Dist: smolagents[litellm]>=1.22.0
|
|
52
57
|
Requires-Dist: python-docx>=1.2.0
|
|
53
58
|
Requires-Dist: openpyxl>=3.1.5
|
|
54
59
|
Requires-Dist: python-pptx>=1.0.2
|
|
55
60
|
Requires-Dist: opencv-python>=4.12.0.88
|
|
56
61
|
Requires-Dist: pypdf2>=3.0.1
|
|
62
|
+
Requires-Dist: mem0ai>=1.0.0
|
|
57
63
|
Requires-Dist: reportlab>=4.0.0
|
|
58
64
|
Provides-Extra: dev
|
|
59
65
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
@@ -121,12 +127,12 @@ Dynamic: license-file
|
|
|
121
127
|
|
|
122
128
|
<p align="center">
|
|
123
129
|
<a href="https://www.youtube.com/watch?v=Dp2oldJJImw">
|
|
124
|
-
<img src="
|
|
130
|
+
<img src="docs/source/_static/images/thumbnail.png" alt="MassGen case study -- Berkeley Agentic AI Summit Question" width="800">
|
|
125
131
|
</a>
|
|
126
132
|
</p>
|
|
127
133
|
|
|
128
134
|
<p align="center">
|
|
129
|
-
<i>
|
|
135
|
+
<i>Scaling AI with collaborative, continuously improving agents</i>
|
|
130
136
|
</p>
|
|
131
137
|
|
|
132
138
|
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.
|
|
@@ -150,7 +156,7 @@ This project started with the "threads of thought" and "iterative refinement" id
|
|
|
150
156
|
<details open>
|
|
151
157
|
<summary><h3>🆕 Latest Features</h3></summary>
|
|
152
158
|
|
|
153
|
-
- [v0.1.
|
|
159
|
+
- [v0.1.6 Features](#-latest-features-v016)
|
|
154
160
|
</details>
|
|
155
161
|
|
|
156
162
|
<details open>
|
|
@@ -195,16 +201,15 @@ This project started with the "threads of thought" and "iterative refinement" id
|
|
|
195
201
|
<summary><h3>🗺️ Roadmap</h3></summary>
|
|
196
202
|
|
|
197
203
|
- Recent Achievements
|
|
198
|
-
- [v0.1.
|
|
199
|
-
- [v0.1.
|
|
200
|
-
- [v0.0.3 - v0.1.2](#previous-achievements-v003---v012)
|
|
204
|
+
- [v0.1.6](#recent-achievements-v016)
|
|
205
|
+
- [v0.0.3 - v0.1.5](#previous-achievements-v003---v015)
|
|
201
206
|
- [Key Future Enhancements](#key-future-enhancements)
|
|
202
207
|
- Bug Fixes & Backend Improvements
|
|
203
208
|
- Advanced Agent Collaboration
|
|
204
209
|
- Expanded Model, Tool & Agent Integrations
|
|
205
210
|
- Improved Performance & Scalability
|
|
206
211
|
- Enhanced Developer Experience
|
|
207
|
-
- [v0.1.
|
|
212
|
+
- [v0.1.7 Roadmap](#v017-roadmap)
|
|
208
213
|
</details>
|
|
209
214
|
|
|
210
215
|
<details open>
|
|
@@ -229,37 +234,54 @@ This project started with the "threads of thought" and "iterative refinement" id
|
|
|
229
234
|
|
|
230
235
|
---
|
|
231
236
|
|
|
232
|
-
## 🆕 Latest Features (v0.1.
|
|
237
|
+
## 🆕 Latest Features (v0.1.6)
|
|
233
238
|
|
|
234
|
-
**🎉 Released: October
|
|
239
|
+
**🎉 Released: October 31, 2025**
|
|
235
240
|
|
|
236
|
-
**What's New in v0.1.
|
|
237
|
-
-
|
|
238
|
-
-
|
|
239
|
-
-
|
|
241
|
+
**What's New in v0.1.6:**
|
|
242
|
+
- **🔗 Framework Interoperability** - Use agents from AG2, LangGraph, AgentScope, OpenAI Assistants, and SmoLAgent as tools
|
|
243
|
+
- **✅ Configuration Validator** - Pre-flight YAML validation with detailed error messages and suggestions
|
|
244
|
+
- **🔧 Unified Tool Execution** - Streamlined backend architecture with consistent tool handling
|
|
245
|
+
- **⚡ Gemini Backend Simplification** - Major cleanup reducing codebase by 1,598 lines
|
|
240
246
|
|
|
241
247
|
**Key Improvements:**
|
|
242
|
-
-
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
248
|
+
- External agent frameworks work as MassGen custom tools
|
|
249
|
+
- Comprehensive config validation with pre-commit hooks
|
|
250
|
+
- ToolExecutionConfig dataclass for standardized tool handling across backends
|
|
251
|
+
- Simplified Gemini backend with improved maintainability
|
|
252
|
+
- Enhanced ToolManager with category management
|
|
246
253
|
|
|
247
|
-
**
|
|
254
|
+
**Try v0.1.6 Features:**
|
|
248
255
|
```bash
|
|
249
256
|
# Install or upgrade from PyPI
|
|
250
257
|
pip install --upgrade massgen
|
|
251
258
|
|
|
252
|
-
#
|
|
253
|
-
|
|
254
|
-
|
|
259
|
+
# Use AG2 agents as tools for lesson planning (supports streaming)
|
|
260
|
+
# Requirements: pip install pyautogen, OPENAI_API_KEY must be set
|
|
261
|
+
massgen --config massgen/configs/tools/custom_tools/ag2_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
|
|
255
262
|
|
|
256
|
-
#
|
|
257
|
-
|
|
258
|
-
|
|
263
|
+
# Use LangGraph workflows as tools
|
|
264
|
+
# Requirements: pip install langgraph langchain-openai langchain-core, OPENAI_API_KEY must be set
|
|
265
|
+
massgen --config massgen/configs/tools/custom_tools/langgraph_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
|
|
259
266
|
|
|
260
|
-
#
|
|
261
|
-
|
|
262
|
-
|
|
267
|
+
# Use AgentScope multi-agent framework as tools
|
|
268
|
+
# Requirements: pip install agentscope, OPENAI_API_KEY must be set
|
|
269
|
+
massgen --config massgen/configs/tools/custom_tools/agentscope_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
|
|
270
|
+
|
|
271
|
+
# Use OpenAI Assistants API as tools
|
|
272
|
+
# Requirements: pip install openai, OPENAI_API_KEY must be set
|
|
273
|
+
massgen --config massgen/configs/tools/custom_tools/openai_assistant_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
|
|
274
|
+
|
|
275
|
+
# Use SmolAgent (HuggingFace) as tools
|
|
276
|
+
# Requirements: pip install smolagents, OPENAI_API_KEY must be set
|
|
277
|
+
massgen --config massgen/configs/tools/custom_tools/smolagent_lesson_planner_example.yaml "Create a lesson plan for photosynthesis"
|
|
278
|
+
|
|
279
|
+
# Combine multiple frameworks - AG2 + LangGraph collaboration
|
|
280
|
+
# Requirements: pip install pyautogen langgraph langchain-openai langchain-core, OPENAI_API_KEY must be set
|
|
281
|
+
massgen --config massgen/configs/tools/custom_tools/ag2_and_langgraph_lesson_planner.yaml "Create a lesson plan for photosynthesis"
|
|
282
|
+
|
|
283
|
+
# Validate your configuration before running
|
|
284
|
+
python -m massgen.config_validator your_config.yaml
|
|
263
285
|
```
|
|
264
286
|
|
|
265
287
|
→ [See full release history and examples](massgen/configs/README.md#release-history--examples)
|
|
@@ -481,17 +503,20 @@ MassGen agents can leverage various tools to enhance their problem-solving capab
|
|
|
481
503
|
|
|
482
504
|
**Supported Built-in Tools by Backend:**
|
|
483
505
|
|
|
484
|
-
| Backend | Live Search | Code Execution | File Operations | MCP Support | Multimodal
|
|
485
|
-
|
|
486
|
-
| **Azure OpenAI** (NEW in v0.0.10) | ❌ | ❌ | ❌ | ❌ | ❌ | Code interpreter, Azure deployment management |
|
|
487
|
-
| **Claude API** | ✅ | ✅ | ✅ | ✅ |
|
|
488
|
-
| **Claude Code** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image* | **Native Claude Code SDK, comprehensive dev tools, MCP integration** |
|
|
489
|
-
| **Gemini API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image* | Web search, code execution, **MCP integration**|
|
|
490
|
-
| **Grok API** | ✅ | ❌ | ✅ | ✅ |
|
|
491
|
-
| **OpenAI API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image* | Web search, code interpreter, **MCP integration** |
|
|
492
|
-
| **ZAI API** | ❌ | ❌ | ✅ | ✅ |
|
|
493
|
-
|
|
494
|
-
**
|
|
506
|
+
| Backend | Live Search | Code Execution | File Operations | MCP Support | Multimodal Understanding | Multimodal Generation | Advanced Features |
|
|
507
|
+
|---------|:-----------:|:--------------:|:---------------:|:-----------:|:------------------------:|:---------------------:|:-----------------|
|
|
508
|
+
| **Azure OpenAI** (NEW in v0.0.10) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | Code interpreter, Azure deployment management |
|
|
509
|
+
| **Claude API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*via custom tools* | ✅<br/>*via custom tools* | Web search, code interpreter, **MCP integration** |
|
|
510
|
+
| **Claude Code** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image (native)*<br/>*Audio/Video/Docs (custom tools)* | ✅<br/>*via custom tools* | **Native Claude Code SDK, comprehensive dev tools, MCP integration** |
|
|
511
|
+
| **Gemini API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image (native)*<br/>*Audio/Video/Docs (custom tools)* | ✅<br/>*via custom tools* | Web search, code execution, **MCP integration**|
|
|
512
|
+
| **Grok API** | ✅ | ❌ | ✅ | ✅ | ✅<br/>*via custom tools* | ✅<br/>*via custom tools* | Web search, **MCP integration** |
|
|
513
|
+
| **OpenAI API** | ✅ | ✅ | ✅ | ✅ | ✅<br/>*Image (native)*<br/>*Audio/Video/Docs (custom tools)* | ✅<br/>*via custom tools* | Web search, code interpreter, **MCP integration** |
|
|
514
|
+
| **ZAI API** | ❌ | ❌ | ✅ | ✅ | ✅<br/>*via custom tools* | ✅<br/>*via custom tools* | **MCP integration** |
|
|
515
|
+
|
|
516
|
+
**Notes:**
|
|
517
|
+
- **Multimodal Understanding** (NEW in v0.1.3): Analyze images, audio, video, and documents via custom tools using OpenAI GPT-4.1 - works with any backend
|
|
518
|
+
- **Multimodal Generation** (NEW in v0.1.4): Generate images, videos, audio, and documents via custom tools using OpenAI APIs - works with any backend
|
|
519
|
+
- See custom tool configurations: [`understand_image.yaml`](massgen/configs/tools/custom_tools/multimodal_tools/understand_image.yaml), [`text_to_image_generation_single.yaml`](massgen/configs/tools/custom_tools/multimodal_tools/text_to_image_generation_single.yaml)
|
|
495
520
|
|
|
496
521
|
→ For detailed backend capabilities and tool integration guides, see [User Guide - Backends](https://docs.massgen.ai/en/latest/user_guide/backends.html)
|
|
497
522
|
|
|
@@ -1084,6 +1109,10 @@ All sessions are automatically logged with detailed information for debugging an
|
|
|
1084
1109
|
|
|
1085
1110
|
To see how MassGen works in practice, check out these detailed case studies based on real session logs:
|
|
1086
1111
|
|
|
1112
|
+
**Featured:**
|
|
1113
|
+
- [**Multi-Turn Persistent Memory**](docs/source/examples/case_studies/multi-turn-persistent-memory.md) - Research-to-implementation workflow demonstrating memory system (v0.1.5) | [📹 Watch Demo](https://youtu.be/wWxxFgyw40Y)
|
|
1114
|
+
|
|
1115
|
+
**All Case Studies:**
|
|
1087
1116
|
- [**MassGen Case Studies**](docs/source/examples/case_studies/README.md)
|
|
1088
1117
|
- [**Case Studies Documentation**](https://docs.massgen.ai/en/latest/examples/case_studies.html) - Browse case studies online
|
|
1089
1118
|
|
|
@@ -1096,49 +1125,80 @@ MassGen is currently in its foundational stage, with a focus on parallel, asynch
|
|
|
1096
1125
|
|
|
1097
1126
|
⚠️ **Early Stage Notice:** As MassGen is in active development, please expect upcoming breaking architecture changes as we continue to refine and improve the system.
|
|
1098
1127
|
|
|
1099
|
-
### Recent Achievements (v0.1.
|
|
1128
|
+
### Recent Achievements (v0.1.6)
|
|
1129
|
+
|
|
1130
|
+
**🎉 Released: October 31, 2025**
|
|
1131
|
+
|
|
1132
|
+
#### Framework Interoperability
|
|
1133
|
+
- **AG2 Integration**: Nested chat functionality wrapped as custom tool for multi-agent lesson planning (supports streaming)
|
|
1134
|
+
- **LangGraph Integration**: Graph-based workflows integrated as tools for structured task execution
|
|
1135
|
+
- **AgentScope Integration**: AgentScope agent system wrapped for collaborative task handling
|
|
1136
|
+
- **OpenAI Assistants Integration**: OpenAI Assistants API integrated as tools for specialized workflows
|
|
1137
|
+
- **SmoLAgent Integration**: HuggingFace SmoLAgent wrapped for flexible agent orchestration
|
|
1138
|
+
- **Cross-Framework Collaboration**: MassGen orchestrates agents from multiple frameworks seamlessly
|
|
1139
|
+
- **Tool Module**: New `massgen/tool/_extraframework_agents/` module with 5 framework integrations
|
|
1140
|
+
- **Streaming Support**: Only AG2 currently supports streaming; other frameworks return complete results
|
|
1141
|
+
|
|
1142
|
+
#### Configuration Validator
|
|
1143
|
+
- **ConfigValidator Class**: Comprehensive YAML validation in `massgen/config_validator.py`
|
|
1144
|
+
- **Memory Validation**: Detailed validation for memory configuration parameters
|
|
1145
|
+
- **Pre-commit Integration**: Automatic configuration validation before commits
|
|
1146
|
+
- **Error Messaging**: Actionable error messages with suggestions for common mistakes
|
|
1147
|
+
- **Test Coverage**: Comprehensive test suite in `massgen/tests/test_config_validator.py`
|
|
1148
|
+
|
|
1149
|
+
#### Backend Architecture Refactoring
|
|
1150
|
+
- **ToolExecutionConfig**: Unified tool execution with new dataclass in `base_with_custom_tool_and_mcp.py`
|
|
1151
|
+
- **ResponseBackend Refactoring**: Unified tool execution flow eliminating duplicate code paths
|
|
1152
|
+
- **ChatCompletionsBackend Refactoring**: Consistent tool handling across Chat Completions providers
|
|
1153
|
+
- **ClaudeBackend Refactoring**: Unified tool execution methods for Claude backend
|
|
1154
|
+
- **Consistent Error Handling**: Standardized status reporting across all tool types
|
|
1155
|
+
|
|
1156
|
+
#### Gemini Backend Simplification
|
|
1157
|
+
- **Module Removal**: Removed `gemini_mcp_manager.py` and `gemini_trackers.py` modules
|
|
1158
|
+
- **Code Consolidation**: Refactored to use manual tool execution via base class
|
|
1159
|
+
- **Streamlined Logic**: Removed continuation logic and duplicate code
|
|
1160
|
+
- **Codebase Reduction**: Net reduction of 1,598 lines through consolidation
|
|
1161
|
+
- **Formatter Updates**: Updated `_gemini_formatter.py` for simplified tool conversion
|
|
1162
|
+
|
|
1163
|
+
#### Custom Tool System Enhancement
|
|
1164
|
+
- **ToolManager Improvements**: Enhanced category management capabilities
|
|
1165
|
+
- **Registration System**: Improved tool registration and validation
|
|
1166
|
+
- **Result Handling**: Enhanced error reporting and async execution support
|
|
1167
|
+
- **Schema Generation**: Improved tool schema generation for LLM consumption
|
|
1100
1168
|
|
|
1101
|
-
|
|
1169
|
+
#### Configuration Files
|
|
1170
|
+
- `ag2_lesson_planner_example.yaml` - AG2 nested chat as custom tool
|
|
1171
|
+
- `langgraph_lesson_planner_example.yaml` - LangGraph workflows integrated
|
|
1172
|
+
- `agentscope_lesson_planner_example.yaml` - AgentScope agent integration
|
|
1173
|
+
- `openai_assistant_lesson_planner_example.yaml` - OpenAI Assistants as tools
|
|
1174
|
+
- `smolagent_lesson_planner_example.yaml` - SmoLAgent integration
|
|
1175
|
+
- `ag2_and_langgraph_lesson_planner.yaml` - Multi-framework collaboration
|
|
1176
|
+
- `ag2_and_openai_assistant_lesson_planner.yaml` - AG2 + OpenAI Assistants combo
|
|
1177
|
+
- `two_models_with_tools_example.yaml` - Multiple models with custom tools
|
|
1102
1178
|
|
|
1103
|
-
|
|
1104
|
-
- **Text-to-Image**: `text_to_image_generation` tool creates images from text prompts via DALL-E API
|
|
1105
|
-
- **Text-to-Video**: `text_to_video_generation` tool generates videos from text descriptions
|
|
1106
|
-
- **Text-to-Speech**: `text_to_speech_continue_generation` and `text_to_speech_transcription_generation` tools for audio generation and transcription
|
|
1107
|
-
- **Text-to-File**: `text_to_file_generation` tool creates documents in PDF, DOCX, XLSX, and PPTX formats
|
|
1108
|
-
- **Image-to-Image**: `image_to_image_generation` tool transforms existing images
|
|
1179
|
+
### Previous Achievements (v0.0.3 - v0.1.5)
|
|
1109
1180
|
|
|
1110
|
-
|
|
1111
|
-
- **Automatic Blocking**: `PathPermissionManager` now prevents text-based read tools from accessing binary files
|
|
1112
|
-
- **Protected File Types**: 40+ extensions including images (.jpg, .png), videos (.mp4, .avi), audio (.mp3, .wav), archives (.zip, .tar), executables (.exe, .dll), and Office documents (.pdf, .docx, .xlsx, .pptx)
|
|
1113
|
-
- **Intelligent Guidance**: Error messages automatically suggest appropriate specialized tools (e.g., "use understand_image tool" for .jpg files)
|
|
1114
|
-
- **Test Coverage**: `test_binary_file_blocking.py`
|
|
1181
|
+
✅ **Memory System (v0.1.5)**: Long-term semantic memory via mem0 integration with fact extraction and retrieval across sessions, short-term conversational memory for active context, automatic context compression when approaching token limits, cross-agent memory sharing with turn-aware filtering, session management for memory isolation and continuation, Qdrant vector database integration for semantic search
|
|
1115
1182
|
|
|
1116
|
-
|
|
1117
|
-
- **Crawl4AI Tool**: `crawl4ai_tool` enables intelligent web scraping with LLM-powered content extraction and customizable patterns
|
|
1183
|
+
✅ **Multimodal Generation Tools (v0.1.4)**: Create images from text via DALL-E API, generate videos from descriptions, text-to-speech with audio transcription support, document generation for PDF/DOCX/XLSX/PPTX formats, image transformation capabilities for existing images
|
|
1118
1184
|
|
|
1119
|
-
|
|
1120
|
-
- **Generation Tools**: 8 multimodal generation configurations
|
|
1121
|
-
- `text_to_image_generation_single.yaml` and `text_to_image_generation_multi.yaml`
|
|
1122
|
-
- `text_to_video_generation_single.yaml` and `text_to_video_generation_multi.yaml`
|
|
1123
|
-
- `text_to_speech_generation_single.yaml` and `text_to_speech_generation_multi.yaml`
|
|
1124
|
-
- `text_to_file_generation_single.yaml` and `text_to_file_generation_multi.yaml`
|
|
1125
|
-
- **Web Scraping**: `crawl4ai_example.yaml` for Crawl4AI integration
|
|
1185
|
+
✅ **Binary File Protection (v0.1.4)**: Automatic blocking prevents text tools from accessing 40+ binary file types including images, videos, audio, archives, and Office documents, intelligent error messages guide users to appropriate specialized tools for binary content
|
|
1126
1186
|
|
|
1127
|
-
|
|
1187
|
+
✅ **Crawl4AI Integration (v0.1.4)**: Intelligent web scraping with LLM-powered content extraction and customizable extraction patterns for structured data retrieval from websites
|
|
1128
1188
|
|
|
1129
|
-
✅ **Post-Evaluation Workflow (v0.1.3)**:
|
|
1189
|
+
✅ **Post-Evaluation Workflow (v0.1.3)**: Winning agents evaluate their own answers before submission with submit and restart capabilities, supports answer confirmation and orchestration restart with feedback across all backends
|
|
1130
1190
|
|
|
1131
|
-
✅ **Multimodal Understanding Tools (v0.1.3)**:
|
|
1191
|
+
✅ **Multimodal Understanding Tools (v0.1.3)**: Analyze images, transcribe audio, extract video frames, and process documents (PDF/DOCX/XLSX/PPTX) with structured JSON output, works across all backends via OpenAI GPT-4.1 integration
|
|
1132
1192
|
|
|
1133
|
-
✅ **Docker Sudo Mode (v0.1.3)**:
|
|
1193
|
+
✅ **Docker Sudo Mode (v0.1.3)**: Privileged command execution in Docker containers for system-level operations requiring elevated permissions
|
|
1134
1194
|
|
|
1135
|
-
✅ **Intelligent Planning Mode (v0.1.2)**: Automatic question analysis determining operation irreversibility via `_analyze_question_irreversibility()` in orchestrator, selective tool blocking with `set_planning_mode_blocked_tools()` and `is_mcp_tool_blocked()` methods, read-only MCP operations during coordination with write operations blocked, zero-configuration transparent operation, multi-workspace support
|
|
1195
|
+
✅ **Intelligent Planning Mode (v0.1.2)**: Automatic question analysis determining operation irreversibility via `_analyze_question_irreversibility()` in orchestrator, selective tool blocking with `set_planning_mode_blocked_tools()` and `is_mcp_tool_blocked()` methods, read-only MCP operations during coordination with write operations blocked, zero-configuration transparent operation, multi-workspace support
|
|
1136
1196
|
|
|
1137
|
-
✅ **Model Updates (v0.1.2)**: Claude 4.5 Haiku model `claude-haiku-4-5-20251001`, reorganized Claude model priorities with `claude-sonnet-4-5-20250929` default, Grok web search fix with `_add_grok_search_params()` method for proper `extra_body` parameter handling
|
|
1197
|
+
✅ **Model Updates (v0.1.2)**: Claude 4.5 Haiku model `claude-haiku-4-5-20251001`, reorganized Claude model priorities with `claude-sonnet-4-5-20250929` default, Grok web search fix with `_add_grok_search_params()` method for proper `extra_body` parameter handling
|
|
1138
1198
|
|
|
1139
1199
|
✅ **Custom Tools System (v0.1.1)**: User-defined Python function registration using `ToolManager` class in `massgen/tool/_manager.py`, cross-backend support alongside MCP servers, builtin/MCP/custom tool categories with automatic discovery, 40+ examples in `massgen/configs/tools/custom_tools/`, voting sensitivity controls with three-tier quality system (lenient/balanced/strict), answer novelty detection preventing duplicates
|
|
1140
1200
|
|
|
1141
|
-
✅ **Backend Enhancements (v0.1.1)**: Gemini architecture refactoring with extracted MCP management (`gemini_mcp_manager.py`), tracking (`gemini_trackers.py`), and utilities, new capabilities registry in `massgen/backend/capabilities.py` documenting feature support across backends
|
|
1201
|
+
✅ **Backend Enhancements (v0.1.1)**: Gemini architecture refactoring with extracted MCP management (`gemini_mcp_manager.py`), tracking (`gemini_trackers.py`), and utilities, new capabilities registry in `massgen/backend/capabilities.py` documenting feature support across all backends
|
|
1142
1202
|
|
|
1143
1203
|
✅ **PyPI Package Release (v0.1.0)**: Official distribution via `pip install massgen` with simplified installation, global `massgen` command accessible from any directory, comprehensive Sphinx documentation at [docs.massgen.ai](https://docs.massgen.ai/), interactive setup wizard with use case presets and API key management, enhanced CLI with `@examples/` prefix for built-in configurations
|
|
1144
1204
|
|
|
@@ -1238,21 +1298,22 @@ MassGen is currently in its foundational stage, with a focus on parallel, asynch
|
|
|
1238
1298
|
|
|
1239
1299
|
We welcome community contributions to achieve these goals.
|
|
1240
1300
|
|
|
1241
|
-
### v0.1.
|
|
1301
|
+
### v0.1.7 Roadmap
|
|
1242
1302
|
|
|
1243
|
-
Version 0.1.
|
|
1303
|
+
Version 0.1.7 focuses on agent task planning and rate limiting for improved coordination and cost management:
|
|
1244
1304
|
|
|
1245
|
-
####
|
|
1246
|
-
- **
|
|
1247
|
-
- **
|
|
1305
|
+
#### Planned Features
|
|
1306
|
+
- **Agent Task Planning System**: Enable agents to organize complex multi-step work with task plans, dependency tracking, and progress monitoring via 8 new MCP planning tools
|
|
1307
|
+
- **Gemini Rate Limiting System**: Multi-dimensional rate limiting (RPM, TPM, RPD) to prevent API spam and manage costs with model-specific limits and configurable thresholds
|
|
1248
1308
|
|
|
1249
1309
|
Key technical approach:
|
|
1250
|
-
- **
|
|
1251
|
-
- **
|
|
1310
|
+
- **Task Planning**: MCP-based planning tools with dependency graphs, status tracking, and maximum 100 tasks per plan safety limit
|
|
1311
|
+
- **Rate Limiting**: Sliding window tracking, external YAML configuration, optional CLI flag, mandatory cooldown periods after startup
|
|
1312
|
+
- **Configuration**: Both features are optional and configurable via flags (`enable_agent_task_planning`, `--rate-limit`)
|
|
1252
1313
|
|
|
1253
|
-
**Target Release**:
|
|
1314
|
+
**Target Release**: November 3, 2025 (Monday @ 9am PT)
|
|
1254
1315
|
|
|
1255
|
-
For detailed milestones and technical specifications, see the [full v0.1.
|
|
1316
|
+
For detailed milestones and technical specifications, see the [full v0.1.7 roadmap](ROADMAP_v0.1.7.md).
|
|
1256
1317
|
|
|
1257
1318
|
---
|
|
1258
1319
|
|