MFlow searches for a policy that lets an agent decide when to spawn a subagent, which capabilities to give it, and what evidence to return. Each task starts with one root. The policy can keep working with that agent or assemble a team as evidence arrives. Search and inference use the published @codesoul-co/ditto package.
Use Node.js 24+ and npm 11+ on macOS or Linux. From the MFlow repository root, run npm ci to install the published Ditto runtime (@codesoul-co/ditto@0.1.2) and the other dependencies pinned in the lockfile. Then build MFlow and check the runtime.
npm ci
npm run build
npm run mflow -- doctorThe runtime check runs locally without a model key. To generate an initial single-agent bundle, run:
npm run mflow -- seed --benchmark math --initialization single --out runs/math-seed.jsonRun npm test for the application test suite. The suite uses Python 3.9+, and some integration tests use optional upstream environments or Docker images.
Copy .env.example to .env and set MFLOW_BASE_URL, MFLOW_MODEL and MFLOW_API_KEY before running model inference. MFlow uses an OpenAI-compatible endpoint. The example targets DeepSeek Flash. For a self-hosted model, set its URL and served model name, and use MFLOW_PROVIDER_OPTIONS for endpoint-specific request options. HLE also requires a judge model, and its multimodal view requires an image-capable actor.
| Provider | MFLOW_BASE_URL |
MFLOW_MODEL |
|---|---|---|
| SiliconFlow | https://api.siliconflow.cn/v1 |
Qwen/Qwen3.5-4B |
| BigModel | https://open.bigmodel.cn/api/paas/v4 |
glm-4.7-flash |
For these two model and endpoint pairs, Ditto handles streaming, structured responses and tool calls. The endpoint controls generation length. Reasoning mode defaults to off and can be enabled with MFLOW_PROVIDER_OPTIONS using the provider's request format.
Use Python 3.9+ for the split tools.
The split catalog and preparation guide publishes ordered task IDs, content hashes and pinned sources. It covers DROP, HumanEval, HumanEval+, MBPP, GSM8K, MATH, AutomationBench, BFCL and the named HLE views. The historical AFlow DROP protocol retains five known cross-split duplicate prompt pairs. GAIA and tau3 have asset-management support in the shared benchmark hub.
python3 benchmark-splits/splits.py list
python3 benchmark-splits/splits.py prepare --benchmark math --download --out ../ReproducedBenchmarks/math
python3 benchmark-splits/splits.py verify --benchmark math --data ../ReproducedBenchmarks/mathOther projects can use the split tools independently of MFlow. To share a prepared catalog, set BENCHMARK_HOME; MFlow can then resolve references such as benchmark:mbpp/test.
Install the official AFlow controller at the revision in the baseline lock, its Python dependencies and the MATH grader. The following uses Python 3.11, a running Docker engine and an external directory for upstream sources:
mkdir -p ../MFlow-baselines/sources
git clone https://github.com/FoundationAgents/AFlow.git ../MFlow-baselines/sources/AFlow
git -C ../MFlow-baselines/sources/AFlow checkout --detach 3f457218fc716093fe53f6df8a5d5e6379d66346
python3.11 -m venv ../MFlow-baselines/.venv-aflow
../MFlow-baselines/.venv-aflow/bin/pip install -r baselines/requirements-aflow.txt
python3.11 -m venv .benchmark-venv
.benchmark-venv/bin/pip install -r requirements-benchmarks.txt
export MFLOW_BENCH_PYTHON="$PWD/.benchmark-venv/bin/python"
docker pull python:3.12-alpineSearch calls the configured model. Each candidate is evaluated on the search split. Inference loads the frozen bundle for a new task. To keep the final test separate:
npm run mflow -- search \
--search ../ReproducedBenchmarks/math/search.jsonl --config configs/aflow-search.json \
--source ../MFlow-baselines/sources/AFlow --python ../MFlow-baselines/.venv-aflow/bin/python \
--out runs/math-search
npm run mflow -- infer --bundle runs/math-search/best.json --question "What is 7 times 8?"
npm run mflow -- evaluate --bundle runs/math-search/best.json \
--test ../ReproducedBenchmarks/math/test.jsonl --out runs/math-testThe default search starts from one root, evaluates each candidate five times and checks for convergence using AFlow's controller. Use --resume with the original inputs, configuration and output directory to continue an interrupted run. The standard protocol resets member state for each test task.
The baseline adapters use the pinned upstream implementations of AFlow, DyLAN, EvoAgent and AutoAgents. The public configurations specify benchmark and model settings. Run python3 scripts/automation_experiment.py --help for the comparison runner; --protocol and --search-config accept paths to your own JSON settings. Upstream baseline environments and benchmark-specific scoring tools are separate from the core npm installation.
The comparison runner reads the model settings from .env, with exported environment variables taking precedence. It uses the selected benchmark protocol for all methods. To run AFlow and the direct baselines on the pinned DROP splits after preparing the upstream environments and benchmark data, use:
python3 scripts/automation_experiment.py --benchmark drop --run runs/drop-comparison \
--methods AFlow DyLAN EvoAgent AutoAgents SingleLLM
python3 scripts/automation_experiment.py --status --run runs/drop-comparisonInclude MFlow in --methods to compare the searched spawn policy on the same test split. Use a distinct --run path for each model and add --resume to continue an interrupted comparison with its original configuration.
Keep private model settings in .env, deployment scripts and custom files in local/, and experiment outputs in runs/. All three are ignored by Git.