Ensemble
Agent BuildingensembleEnsemble 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.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/opensage-agent/opensage-adk/blob/HEAD/src/opensage/bash_tools/workflow/ensemble/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/ensemble, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
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.