Consensus Groups
@leumas/consensusPanels of AI members that deliberate and synthesize ONE answer. Generalizes the legacy ollama-consensus pipeline over every provider, and ports the MIT council-of-high-intelligence deliberation...
Consensus Groups (@leumas/consensus)
Panels of AI members that deliberate and synthesize ONE answer. Generalizes the legacy ollama-consensus pipeline over every provider, and ports the MIT council-of-high-intelligence deliberation protocol as code.
Model
A group (/db/consensus_groups, zero-backend CRUD) = members[] + chairman + mode + settings.
- Member = a
chatbotsrow (kind:'chatbot', e.g. the 18 seededcouncil-*personas) or inline
{ provider, model, system }. Optional per member: domainSeat (×1.5 vote weight), research: { enabled, loops, searchApi } (runs @leumas/research before answering).
- Chairman = the synthesizer; never a panelist (enforced).
- Modes:
panel(parallel + judge; fast) ·council(restate gate → blind Round 1 → ANONYMIZED
Round 2 cross-exam → Round 3 STANCE: x | CONFIDENCE: high|med|low | DEALBREAKER: yes|no → confidence-weighted vote: consensus iff ≥⅔ of total BASE weight, else the honest split → Chairman verdict leading with unknowns) · quick (2 rounds + vote) · duo (dialectic).
How agents call it
| Surface | How |
|---|---|
| Chatbot / Leviathan | attach the run_consensus functioncall (executor action:run-consensus) |
| Automation rule | action run-consensus { groupId, prompt, mode? } |
| MCP client | functioncalls server → run_consensus tool |
| HTTP | POST /api/consensus/run[/stream] with { groupId } OR an inline { group } (ad-hoc panels — AiLab does this) |
| Studio | Intelligence → Consensus Groups / Group Chat; Builder → AI Lab (inline local panels) |
| Code | runConsensus({ group, prompt, mode, onEvent, signal, providerRegistry, getBot, research, connector }) |
SSE vocabulary
start · phase(restate|round1|round2|round3|vote|synthesis|panel) · member_start · member_done · research (nested per-member) · stance · vote · synth_start · consensus · done · error. Runs persist to /db/consensus_runs, checkpointed per phase (dropped streams lose nothing).
Gotchas
- Panel synthesis imports
buildConsensusPrompt+CONSENSUS_SYSTEMfrom@leumas/a-ollama— never copy them. - All-Ollama panels default to concurrency 2 (one GPU serializes); Studio prewarms via
/api/ollama/prewarm. - Stance labels are cleaned of markdown/quote decoration before tallying (models emit
** monorepo). - Providers without a step
adapter(cursor-agent, codex, slm) answer one-shot — fine for members. - Council cost ≈ members × 4 calls + chairman; Group Chat shows the projected call count pre-run.
Gating
requireAuth + requireMembership('intelligence') (admins bypass) + PassNode guard feature:consensus.run (author a passnode_rules doc to meter). Smoke: pnpm smoke:consensus.