LLMs are trained on human consensus. They want to agree. Give five agents the same problem and they converge toward the same answer. Your "debate" becomes theater. The final output looks like deliberation — but it's really just consensus with extra steps and extra API cost.
The thesis: To force genuine adversarial critique, the constraint must be architectural, not stylistic.
Hardcoded 'You MUST disagree' into the Devil's Advocate agent prompt, structurally preventing consensus and forcing the pipeline to engage with genuine flaws in the initial strategy.
// ━━━ DEVIL'S ADVOCATE — the constraint that makes everything real ━━━
"You are the Devil's Advocate — a ruthless critical data scientist.
Read the Strategist's plan. You MUST disagree with it.
Find the biggest risk or flaw. Challenge aggressively.
NEVER agree with the Strategist.
Keep your response under 50 words."Wrapped every agent execution in a tracking function that measures latency, prompt tokens, completion tokens, and real-time cost, streaming atomic receipts to the dashboard.
async function trackExecution(agentName, executeFn) {
const start = performance.now();
const result = await executeFn();
const latencyMs = (performance.now() - start).toFixed(2);
const { promptTokenCount, candidatesTokenCount } = result.usageMetadata;
const cost = (promptTokenCount / 1_000_000 * 0.075) +
(candidatesTokenCount / 1_000_000 * 0.300);
totalCost += cost;
auditLog.push({
Agent: agentName,
Latency: `${latencyMs}ms`,
Cost_USD: `$${cost.toFixed(6)}`
});
return result;
}Hard Timeout on Externals
Implemented `AbortController` for 3-second hard timeouts on all external APIs (e.g. Open-Meteo) so the pipeline never hangs during live inferences.
Structured Fallback
If the weather API dies, a `catch` block returns historical pitch data ensuring graceful degradation instead of a crash.
Cost per Season
Methodology
Multi-agent architecture is highly cost-effective at scale when prompts are optimized.
Consensus Broken
Methodology
Hardcoded system prompt constraints can successfully force adversarial evaluation.