# Ensemble

> Ensemble is an Agent Skill for agent building published in the opensage-agent/opensage-adk repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Run the same task on multiple agents/models in parallel and reduce the answers (majority vote or disagreement check). Replaces the legacy agent_ensemble tool.

- Skill name: `ensemble`
- Category: [Agent Building](https://www.openparable.com/skill/agent-building/1)
- Source: https://github.com/opensage-agent/opensage-adk/blob/HEAD/src/opensage/bash_tools/workflow/ensemble/SKILL.md
- Repository: opensage-agent/opensage-adk (104 GitHub stars when collected)

## SKILL.md

# Ensemble Pattern

Same question, multiple independent subagents (typically with different models), then reduce. Useful when you want N opinions on a high-stakes call and there's no ground truth — e.g. "is this function vulnerable?".

## Usage

```
models = get_available_models()           # pick 2-5 distinct ones
sids = []
for m in chosen_models:
    r = call_subagent(agent_name="X", request=Q, mode="async", model_name=m)
    sids.append(r.session_id)

for sid in sids:
    wait_for_subagent(sid, timeout=...)

# Read each subagent's final reply from your inbox (each async invocation
# posts its result back as kind="result"). Then majority vote / compare.
```

Key points:

- **`mode="async"` is required** for parallelism. Sync mode serializes the calls.
- All chosen models must be in `get_available_models()`. Unregistered → `KeyError`.
- Cost scales linearly with N. Don't ensemble cheap-easy queries.
- Each async result lands in the **caller's** inbox; read it after `wait_for_subagent`.

## Common Use Cases

- Vulnerability triage: 3 models say yes, 1 says no → flag for review
- Code review on subtle correctness questions
- Disagreement detection between models on the same prompt

## Requires Sandbox

None — pure orchestration.

---

Source: https://www.openparable.com/skill/agent-building/ensemble (OpenParable). Cite the canonical URL above.
