|
| 1 | +# MultiAgentBench Integration |
| 2 | + |
| 3 | +Framework-agnostic implementation of the MultiAgentBench benchmark suite from MARBLE |
| 4 | +(Multi-Agent Coordination Backbone with LLM Engine) for evaluating multi-agent collaboration. |
| 5 | + |
| 6 | +**Original Paper**: "MultiAgentBench: Evaluating the Collaboration and Competition of LLM agents" |
| 7 | +(arXiv:2503.01935) |
| 8 | + |
| 9 | +**Original Repository**: https://github.com/ulab-uiuc/MARBLE |
| 10 | + |
| 11 | +## Setup |
| 12 | + |
| 13 | +This benchmark requires the MARBLE source code to be cloned locally. The benchmark |
| 14 | +does NOT install MARBLE as a dependency - instead, it imports directly from a local copy. |
| 15 | + |
| 16 | +### 1. Clone MARBLE |
| 17 | + |
| 18 | +```bash |
| 19 | +cd maseval/benchmark/multiagentbench |
| 20 | +git clone https://github.com/ulab-uiuc/MARBLE.git marble |
| 21 | +cd marble |
| 22 | +# Pin to tested version (recommended) |
| 23 | +git checkout <pinned-commit-hash> |
| 24 | +``` |
| 25 | + |
| 26 | +### 2. Install MARBLE Dependencies |
| 27 | + |
| 28 | +MARBLE requires additional dependencies. Add them to your environment: |
| 29 | + |
| 30 | +```bash |
| 31 | +# If using uv (recommended) |
| 32 | +uv add litellm ruamel.yaml |
| 33 | + |
| 34 | +# Or with pip |
| 35 | +pip install litellm ruamel.yaml |
| 36 | +``` |
| 37 | + |
| 38 | +### 3. Verify Setup |
| 39 | + |
| 40 | +```python |
| 41 | +from maseval.benchmark.multiagentbench import load_tasks |
| 42 | + |
| 43 | +# Should load without error |
| 44 | +tasks = load_tasks("research", limit=1) |
| 45 | +print(f"Loaded {len(tasks)} task(s)") |
| 46 | +``` |
| 47 | + |
| 48 | +## Usage |
| 49 | + |
| 50 | +### Basic Usage (Abstract Base) |
| 51 | + |
| 52 | +The abstract `MultiAgentBenchBenchmark` provides task loading, environment setup, |
| 53 | +and evaluation infrastructure. You implement `setup_agents()` with your framework: |
| 54 | + |
| 55 | +```python |
| 56 | +from maseval.benchmark.multiagentbench import ( |
| 57 | + MultiAgentBenchBenchmark, |
| 58 | + MultiAgentBenchEnvironment, |
| 59 | + load_tasks, |
| 60 | + configure_model_ids, |
| 61 | +) |
| 62 | + |
| 63 | +class MyMultiAgentBenchmark(MultiAgentBenchBenchmark): |
| 64 | + def setup_agents(self, agent_data, environment, task, user): |
| 65 | + # Your framework-specific agent creation |
| 66 | + ... |
| 67 | + |
| 68 | + def get_model_adapter(self, model_id, **kwargs): |
| 69 | + adapter = MyModelAdapter(model_id) |
| 70 | + if "register_name" in kwargs: |
| 71 | + self.register("models", kwargs["register_name"], adapter) |
| 72 | + return adapter |
| 73 | + |
| 74 | +# Load and configure tasks |
| 75 | +tasks = load_tasks("research", limit=5) |
| 76 | +configure_model_ids(tasks, agent_model_id="gpt-4o") |
| 77 | + |
| 78 | +# Run |
| 79 | +benchmark = MyMultiAgentBenchmark() |
| 80 | +results = benchmark.run(tasks) |
| 81 | +``` |
| 82 | + |
| 83 | +### MARBLE Reproduction |
| 84 | + |
| 85 | +Use `MarbleMultiAgentBenchBenchmark` for exact reproduction of MARBLE's published results: |
| 86 | + |
| 87 | +```python |
| 88 | +from maseval.benchmark.multiagentbench import ( |
| 89 | + MarbleMultiAgentBenchBenchmark, |
| 90 | + load_tasks, |
| 91 | + configure_model_ids, |
| 92 | +) |
| 93 | + |
| 94 | +# Load tasks from a simple domain (no Docker required) |
| 95 | +tasks = load_tasks("research", limit=5) |
| 96 | +configure_model_ids(tasks, agent_model_id="gpt-4o") |
| 97 | + |
| 98 | +# Create benchmark with model adapter implementation |
| 99 | +class MyMarbleBenchmark(MarbleMultiAgentBenchBenchmark): |
| 100 | + def get_model_adapter(self, model_id, **kwargs): |
| 101 | + from maseval.interface.openai import OpenAIModelAdapter |
| 102 | + adapter = OpenAIModelAdapter(model_id) |
| 103 | + if "register_name" in kwargs: |
| 104 | + self.register("models", kwargs["register_name"], adapter) |
| 105 | + return adapter |
| 106 | + |
| 107 | +benchmark = MyMarbleBenchmark() |
| 108 | +results = benchmark.run(tasks) |
| 109 | + |
| 110 | +# Print results |
| 111 | +for result in results: |
| 112 | + print(f"Task: {result['task_id']}") |
| 113 | + print(f"Status: {result['status']}") |
| 114 | + if result['eval']: |
| 115 | + print(f"Passed: {result['eval'][0]['passed']}") |
| 116 | +``` |
| 117 | + |
| 118 | +## Domains |
| 119 | + |
| 120 | +MultiAgentBench includes 7 domains with different requirements: |
| 121 | + |
| 122 | +| Domain | External Dependencies | Initial Support | |
| 123 | +|--------|----------------------|-----------------| |
| 124 | +| Research | None | Yes | |
| 125 | +| Bargaining | None | Yes | |
| 126 | +| Coding | Filesystem access | Yes | |
| 127 | +| Web | Network access | Yes | |
| 128 | +| WorldSimulation | None | Yes | |
| 129 | +| Database | Docker + PostgreSQL | Optional | |
| 130 | +| Minecraft | External game server | Deferred | |
| 131 | + |
| 132 | +### Domain-Specific Notes |
| 133 | + |
| 134 | +- **Research/Bargaining**: Recommended for initial testing - no infrastructure required |
| 135 | +- **Coding**: Creates files in a workspace directory |
| 136 | +- **Database**: Requires Docker with PostgreSQL image |
| 137 | +- **Minecraft**: Not currently supported (requires external game server) |
| 138 | + |
| 139 | +## Known Limitations |
| 140 | + |
| 141 | +1. **Chain coordination mode bug**: MARBLE's `engine.py` references `get_agent_profiles_linked()` |
| 142 | + which doesn't exist in `AgentGraph`. Tasks using chain coordination may fail. |
| 143 | + |
| 144 | +2. **SharedMemory is per-agent**: Despite the name, each MARBLE agent creates its own |
| 145 | + `SharedMemory` instance. Use `msg_box` for inter-agent communication. |
| 146 | + |
| 147 | +3. **Requires manual MARBLE clone**: MARBLE must be cloned manually into the `marble/` |
| 148 | + subdirectory (gitignored by default). |
| 149 | + |
| 150 | +## File Structure |
| 151 | + |
| 152 | +``` |
| 153 | +multiagentbench/ |
| 154 | +├── __init__.py # Public API exports |
| 155 | +├── README.md # This file |
| 156 | +├── PROVENANCE.md # MARBLE version and license info |
| 157 | +├── .gitignore # Ignores marble/ directory |
| 158 | +├── multiagentbench.py # Benchmark classes |
| 159 | +├── environment.py # MultiAgentBenchEnvironment |
| 160 | +├── data_loader.py # Task loading utilities |
| 161 | +├── adapters/ |
| 162 | +│ ├── __init__.py |
| 163 | +│ └── marble_adapter.py # MarbleAgentAdapter |
| 164 | +└── marble/ # ← Vendored MARBLE (gitignored) |
| 165 | + └── ... |
| 166 | +``` |
0 commit comments