Multi-Agent Examples And Templates
This page describes how the experimental multi-agent layer is intended to work in this personal research setup. It is optimized for combinatorics, graph theory, mathematical writing, and related research workflows. It may not behave as desired on every agent frontend or model version.
The shared skills involved are:
Skill |
Use |
|---|---|
|
Template-based multi-agent discussion, review, and research. |
|
More explicit OpenProse-style decomposition, parallel work, and synthesis. |
|
Bounded research loop policy; multi-agent panel advises, single path executes; Goal Focus enforce for new loops; scripted force-loop defaults (hard goal_priority + notify). Soft |
|
Headless |
|
Optional graph theory, algebra, enumeration, and invariant checks. |
|
Lightweight graph sanity checks. |
|
Closed packet contracts for parent-controlled handoffs; it does not execute or broker agents. |
|
Final evidence and gap check before delivery. |
Autonomous research loop: host-owned hybrid panel
For unattended multi-iteration research, prefer the hybrid model owned by
autonomous-research-loop-runtime, not nested “primary agent shells out to four
CLIs under its sandbox”:
Host parent (driver) runs top-level provider CLIs for target advice.
Drive primary (
drive --provider …) executes one single-path math or research step and must not nest panel CLIs for multi-agent purposes.Host parent runs result review on new artifacts.
Host evidence gates bank claims; panel consensus is not evidence.
Notify (remote-bridge when configured) is progress messaging only; force-loop apply defaults leave notify auto/on.
Default scripted force-loop (all OS)
Use the installed force-loop kit first. It applies Goal Focus enforce,
goal_priority hard, and notify auto, and works on Linux, macOS, Windows,
and WSL without requiring systemd. Discovery template: arl-scripted-force-loop.
# Bootstrap pins + smoke (init if needed)
bash "${AAS_RUNTIME_ROOT:-$HOME/.local/share/ai-agents-skills/runtime}/run_skill.sh" \
skills/autonomous-research-loop-runtime/force-loop/run_force_loop.sh \
bootstrap --loop research/run --root "$PWD" --profile formal --goal "…"
# Foreground start (default supervision mode)
bash "${AAS_RUNTIME_ROOT:-$HOME/.local/share/ai-agents-skills/runtime}/run_skill.sh" \
skills/autonomous-research-loop-runtime/force-loop/run_force_loop.sh \
start --loop research/run --root "$PWD" --provider codex
# Status / stuck dispatch or quarantine
… force-loop/run_force_loop.sh status --loop research/run
… force-loop/run_force_loop.sh drain --loop research/run --cancel-dispatch-id <exact-id>
Windows: run_skill.ps1 with
skills/autonomous-research-loop-runtime/force-loop/run_force_loop.ps1.
Advanced: raw drive / supervisor
Raw drive and POSIX LAUNCH_supervisor.sh remain supported for custom
compositions. Prefer force-loop for new campaigns.
# Enable host panel around each drive iteration
bash "${AAS_RUNTIME_ROOT:-$HOME/.local/share/ai-agents-skills/runtime}/run_skill.sh" \
skills/autonomous-research-loop-runtime/run_autonomous_research_loop.sh \
drive --dir research/run --provider codex --panel on
# auto: on when loop panel.json / standing_orders.panel / AAS_AUTOLOOP_PANEL=on
… drive --dir research/run --provider codex --panel auto
# Probe panel providers without starting drive
… panel --smoke --root .
Panel provider budgets default to adaptive timeouts (prompt size, provider
multipliers, recent elapsed history, hard max). Set "timeout_mode": "fixed" for
legacy flat caps.
Discipline defaults (force-loop apply): Goal Focus enforcement_mode=enforce,
goal_priority.enabled=true with discipline_mode=hard, and notify auto/on.
Legacy soft goal priority (goal_priority.json with explicit enable) still
injects goal-EV / campaign / streak warnings without v2 enforce gates; see
templates goal-focus and goal-priority.
Optional loop config (panel.json or loop_state.standing_orders.panel):
{
"enabled": true,
"providers": ["codex", "claude", "grok", "opencode", "antigravity", "copilot", "kimi", "deepseek"],
"timeouts": {"target_advice": 600, "result_review": 900}
}
Use agent-group-discuss for heavy strategy pauses and template panels.
Use force-loop start (or raw ARL drive --panel) for routine per-iteration
advice and review while the loop runs unattended. Keep cross-provider depth
shallow: one parent layer, not recursive multi-vendor trees.
Codex has a native spawn_agent orchestration model. Claude and DeepSeek get
the same templates and adapter instructions, but their actual process control
depends on the frontend and installed tools. When a frontend cannot spawn
separate agents directly, the templates still serve as a disciplined role and
round protocol for manual or sequential execution.
True cross-provider delegation is parent-owned by agent-group-discuss.
manifest/delegation.yaml sets the default policy: include Codex as the parent
and spawned-subagent provider; prefer Claude, DeepSeek, Copilot, Antigravity, Grok, and Kimi when fresh
probes pass; keep OpenClaw reference-only; fall back to Codex-only when
configured; and require latest-model plus highest-thinking for research roles.
This policy is general across supported target-agent installs. External CLI
process launch is handled by the parent-owned delegate-agent adapter, not by
the inert packet contract. Target agents receive shared guidance and templates;
live dispatch is still run-specific, probe-gated, and confirmation-controlled.
Dry-run an external provider plan with:
make delegate-agent ARGS="--provider auto --task-file ./task.md --research --dry-run"
Actual launch requires --allow-external-cli. Research launch also requires a
resolved latest-model and highest-thinking setting. Most providers also require
an explicit dispatch command, for example AAS_CLAUDE_DISPATCH_COMMAND,
AAS_CLAUDE_LATEST_MODEL, and AAS_CLAUDE_HIGHEST_THINKING. Antigravity
dispatch is CLI-based through agy -p "<prompt>" --dangerously-skip-permissions
(never put flags between -p and the prompt; agy does not read the user
prompt from stdin); it does not require
ANTIGRAVITY_LS_ADDRESS. Grok dispatch is CLI-based through
grok --prompt-file /dev/stdin (the prompt is delivered on stdin; grok’s
--single needs an argv value and does not read stdin) and uses an interactive
OIDC session rather than an API-key environment variable. Grok may use automatic
selection for research because the resolved model gates the route. The
dispatcher first parses only exact anchored available-model rows from bare
grok models. On POSIX, model probes, remote readiness checks, and actual Grok
children use umask 0077 so Grok-created cache files remain private. Exact
membership selects bare Grok and pins --model;
only bare CLI absence or non-confirmation authorizes the region-correct grok-remote
fallback. Without a resolved model, automatic selection stays bare and does not
authorize the proxy. Generic provider prechecks are bare-only and never
version-probe an automatically discovered proxy. Explicit AAS_GROK and
AAS_GROK_DISPATCH_COMMAND overrides remain authoritative and are not silently
replaced. The dispatcher
invokes a selected proxy route-neutrally: it neither sets GROK_MULTI_SESSION
nor adds route flags. A bare proxy command uses its active managed profile. A
parent readiness probe must validate that profile and its model/release
identities before concurrent dispatch. The dispatcher runs
grok-remote doctor --json, accepts only an exact
grok-remote.profile-status.v1 result in ready or degraded state, and
requires its model_id to match the resolved model. Blocked, unconfigured,
invalid, inconsistent, and timed-out probes fail closed; private topology is
not recorded. An exact --help feature check prevents older proxies from
receiving doctor as ordinary Grok input.
Orchestration Lifecycle
A normal multi-agent run follows this shape:
Classify the request. Decide whether the task is discussion, review, research, proof stress-testing, manuscript review, graph reconfiguration, or formalization.
Select a template. Choose the most specific matching template and state why it was chosen.
Show the plan first. List roles, models or reasoning tiers, round order, verification steps, expected artifacts, and time assumptions.
Wait for confirmation. Multi-agent execution should not start until the user confirms the plan.
Spawn bounded role agents. The orchestrator launches independent roles for the current round. Each role gets a narrow prompt, clear output format, and no file-write authority unless it owns a specific write target.
Collect round outputs. The orchestrator waits once per round or critical batch, compresses decisive findings, and records the state.
Cross-pollinate only after Round 1. Later rounds receive a compressed summary of the strongest findings, objections, and unresolved claims.
Run independent verification. Where useful, the orchestrator runs SageMath, graph checks, source checks, or local tests instead of trusting role opinions alone.
Synthesize locally or with a referee. The final answer separates accepted, rejected, unresolved, and unverified claims.
Close or recover agents. Completed role agents are closed. Interrupted runs resume from state rather than rerunning completed rounds.
Spawn And Round Handling
For Codex-style execution, the mapping is:
Concept |
Process |
|---|---|
Launch role |
|
Launch parallel roles |
Multiple independent |
Continue a role |
|
Wait for outputs |
|
Recover interrupted role |
|
Finish role |
|
External verification |
Orchestrator runs local tools directly, then feeds verified facts into synthesis. |
For research tasks, every parent role, delegated manager, and child worker must use the latest available model with the highest available thinking or reasoning level. Nested workers are allowed only for explicitly planned manager roles, must use the manager’s same provider/model/thinking level, and must remain leaf workers.
Role prompts should include:
template and role name
exact task or claim
round number and round-specific instructions
prior-round summary when applicable
required output format
tool permissions and write boundaries
hard rules for evidence, uncertainty, and fatal gaps
Available Templates
Template |
Best for |
Default shape |
|---|---|---|
Lakatos Proof and Refutation |
Stress-testing a theorem or proof draft. |
4 roles, 3 rounds, debate. |
Polya Multi-Strategy Problem Solving |
Exploring an open problem or complexity boundary. |
3 roles, 3 rounds, star topology. |
Knuth Structured Manuscript Review |
Reviewing a mathematical paper draft. |
3 roles, 2 rounds, panel synthesis. |
Structured Research Team |
General high-stakes claim, proof, algorithm, or characterization review. |
4 roles, 3 rounds plus optional repair. |
Graph Reconfiguration Specialist |
Token sliding, token jumping, gadgets, reductions, PSPACE/NP-hardness, graph-class preservation. |
4 roles, 3 rounds plus optional repair. |
Lean Formalization Team |
Turning a proved lemma into a Lean scaffold or debugging a formal proof. |
5 roles, 2 rounds. |
Prose / OpenProse-style workflow |
Reproducible decomposition with explicit tracks and artifacts. |
Variable tracks, parallel where independent. |
Template chaining is allowed when the task naturally has phases. For example, a graph reconfiguration reduction can use Graph Reconfiguration Specialist first, then Knuth Structured Manuscript Review after the proof is stable.
True Cross-Provider Delegation
Cross-provider runs use three layers:
agent-group-discussselects providers, probes capability profiles, and owns execution.cross-agent-delegationsupplies inert task and result packet contracts.deep-research-workflowpreserves source IDs and evidence mapping.
The default policy is prefer: use Codex plus real non-Codex providers when
enough fresh profiles satisfy the research model policy, otherwise disclose
Codex-only fallback. require mode can be used later to block runs that cannot
satisfy the provider threshold.
Example: Graph Theory Proof Stress-Test
User request:
Use a multi-agent panel to stress-test my proof that every graph in class C has
property P under token sliding.
Likely process:
Select Lakatos Proof and Refutation if the main goal is proof attack, or Graph Reconfiguration Specialist if gadgets and state graphs are central.
Show a plan with Prover or Constructor, Counterexample Hunter or Adversary, Monster-Barrer or Auditor, and Formalist or Referee.
Spawn independent Round 1 role agents.
Let the counterexample role use SageMath or graph checks when a finite search is meaningful.
Run Round 2 with compressed objections and proposed repairs.
Return a ledger of accepted, rejected, unresolved, and weakened claims.
Typical final output:
strongest surviving theorem statement
proof steps that survived
hidden assumptions found
smallest counterexample candidates, if any
verification limits
recommended next proof repair
Example: Graph Reconfiguration Reduction Audit
User request:
Check whether this PSPACE-hardness reduction for token jumping is sound.
Likely process:
Select Graph Reconfiguration Specialist.
Split the work into Constructor, Adversary, Auditor, and Referee.
Track separate claims for local gadget behavior, soundness, completeness, noninterference, graph-class preservation, and polynomial size.
Run local verification for small gadgets when possible.
Stop defending the original proof if a decisive counterexample is found.
The important distinction is that prose polishing does not happen until the construction is stable. Correctness comes first.
Example: Mathematical Manuscript Review
User request:
Run a multi-agent review of this draft before submission.
Likely process:
Select Knuth Structured Manuscript Review.
Spawn Correctness Reviewer, Exposition Reviewer, and Literature Reviewer.
Ask each reviewer for section-level findings with severity and concrete fixes.
Merge overlaps into one prioritized action list.
Typical final output:
critical correctness issues
significant exposition problems
missing or questionable citations
minor issues
optional cosmetic suggestions
Example: Open Problem Exploration
User request:
Use multiple agents to explore whether this graph problem is likely fixed-
parameter tractable or hard.
Likely process:
Select Polya Multi-Strategy Problem Solving.
Spawn Specializer, Generalizer, and Reducer.
Specializer studies restricted cases and small examples.
Generalizer searches for known techniques and neighboring dichotomies.
Reducer proposes plausible hardness sources and gadget outlines.
The final synthesis ranks approaches by promise and expected difficulty.
Example: Lean Formalization Handoff
User request:
Use a formalization team to turn this lemma into a Lean skeleton.
Likely process:
Select Lean Formalization Team.
Spawn Informal Planner, Formalizer, and Missing-Lemma Miner in Round 1.
Spawn Repair Agent and Checker in Round 2.
Separate mathematical gaps from formalization friction.
The output should say whether the skeleton is complete, blocked by missing lemmas, or revealing a real gap in the informal proof.
When To Prefer Prose
Use prose instead of agent-group-discuss when the user asks for a more
reproducible workflow, explicit tracks, or a reusable process. Good examples:
source gathering plus independent verification plus synthesis
comparing two approaches with separate advocates
producing durable intermediate artifacts
decomposing a long research task into named phases
prose is still an adapter here. It describes the workflow and maps it to the
available agent tools; it is not a bundled OpenProse virtual machine.
Related pages: Workflow Overview, Skills, Profiles, Verification.