CouncilMode
Core Architecture
Multi-Agent
Collaborative
A democratic orchestration engine where multiple specialized agents nominate, vote, and execute tasks in a collaborative loop.
CouncilModeConfig.json
{
"council": [
"ProjectManager",
"AgileDeveloper",
"CreativeWriter"
],
"maxTasksPerIteration": 3,
"maxIterations": 10
}
→
Live Council Session
Iteration 1: Nominations
• AgileDeveloper:
RunLinterTask• ProjectManager:
UpdateReadmeTaskVoting Results:
1. RunLinterTask
2 Votes
2. UpdateReadmeTask
1 Vote
Executing: RunLinterTask...
Collaborative Reasoning Flow
graph TD
A[Initialize Council] --> B[Iteration Start]
B --> C[Nomination Phase]
C --> D[Voting Phase]
D --> E[Parallel Execution]
E --> F[State Reflection]
F --> G{Goal Met?}
G -->|No| B
G -->|Yes| H[Complete]
| Phase | Description |
|---|---|
| Nomination | Each council member uses its specific strategy to propose tasks based on the current state. |
| Voting | Members review all nominations and vote for the best path forward. Ties are resolved by priority. |
| Reflection | After execution, every member updates its internal state independently, allowing for diverse perspectives. |
Built-in Council Strategies
CouncilMode ships with three primary personas that balance technical rigor with project velocity.
Project Manager
Focus: Velocity
Prioritizes high-level goals, roadmap alignment, and documentation.
Agile Developer
Focus: Quality
Focuses on TDD, linting, implementation details, and refactoring.
Creative Writer
Focus: Clarity
Ensures user-facing outputs, comments, and commit messages are professional.
kotlin
class CouncilMode(config: CouncilModeConfig) : CognitiveMode() {
override fun handleUserMessage(userMessage: String, task: SessionTask) {
// 1. Initialize Council Members
config.council.forEach { strategy ->
reasoningStates[strategy.name] = strategy.initialize(...)
}
// 2. The Iteration Loop
while (iteration++ < maxIterations) {
val nominations = config.council.flatMap { it.getNominations(...) }
val selectedTasks = voteOnTasks(nominations)
// 3. Parallel Execution
val results = selectedTasks.map { runTask(it) }
// 4. Multi-Agent Reflection
config.council.forEach { it.update(results) }
}
}
}
Integration Guide
To enable CouncilMode, update your OrchestrationConfig. This mode is ideal for complex refactoring or architectural changes where a single agent might miss edge cases.
kotlin
val config = OrchestrationConfig(
mode = CognitiveModeType.Council,
council = listOf(
CognitiveSchemaStrategy.ProjectManager,
CognitiveSchemaStrategy.AgileDeveloper
),
autoFix = true // Allow council to execute plans without manual approval
)