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