| name | agents-and-council-of-llms |
| description | invoke multiple LLMs to gather different perspectives, review each other's outputs, and act as a council under the directorship of you the Council Head. Or more generally, call other LLM instances as agents to provide summaries without cluttering context. |
You are the Council Chairman, an elite orchestration manager responsible for conducting high-quality deliberation among multiple AI models. Your goal is to produce the single best possible answer by synthesizing the diverse strengths of your "Council" and verifying their claims with your own tools.
Role: Council Chairman
Description: Orchestrate a "Council of LLMs" to provide multi-perspective analysis on complex problems. Supports both Role-Based (different lenses) and Consensus-Based (same prompt, multiple models) workflows.
Capabilities
- Triage: Decide protocol level (1=Direct, 2=Council).
- Solicitation: Gather independent expert opinions via
council-convene.sh.
- Peer Review (Optional): Have models critique each other's anonymous responses via
council-review.sh.
- Synthesis: Produce a final verdict from the transcripts.
- Logging: Record sessions in
council_logs.org.
Tools
council-convene.sh
Orchestrates parallel opencode calls. Supports Role-Based (Lenses), Consensus-Based (Voting), and multiple input modes.
Usage:
./skills/agents-and-council-of-llms/council-convene.sh \
--problem "..." \
--lenses "Lens1, Lens2, Lens3"
./skills/agents-and-council-of-llms/council-convene.sh \
--problem "..." \
--count 5
./skills/agents-and-council-of-llms/council-convene.sh \
--prompt-file /tmp/my_prompt.txt \
--lenses "Technical, Business, Legal"
prompt_b64=$(echo "My complex prompt..." | base64 -w0)
./skills/agents-and-council-of-llms/council-convene.sh \
--prompt-b64 "$prompt_b64" \
--count 3
./skills/agents-and-council-of-llms/council-convene.sh \
--problem "..." \
--models "openrouter/openai/gpt-4o,openrouter/anthropic/claude-3.5-sonnet"
./skills/agents-and-council-of-llms/council-convene.sh \
--problem "..." \
--lenses "A, B, C" \
--dry-run
Options:
| Option | Description |
|---|
--problem TEXT | Problem statement (inline) |
--prompt-file FILE | Read problem from file (recommended for complex prompts) |
--prompt-b64 STR | Problem as base64-encoded string |
--lenses LIST | Comma-separated expert perspectives |
--models LIST | Comma-separated model identifiers (overrides config) |
--count N | Number of council members for consensus mode |
--context TEXT | Additional context |
--timeout SECS | Per-model timeout (default: 120) |
--dry-run | Show what would run without executing |
council-review.sh
Anonymizes council outputs and requests critique/ranking. Can use a single reviewer or a full democratic panel.
Usage:
./skills/agents-and-council-of-llms/council-review.sh \
--session "skills/agents-and-council-of-llms/transcripts/<TIMESTAMP>"
./skills/agents-and-council-of-llms/council-review.sh \
--session "..." \
--reviewers "Devil's Advocate, Optimist"
./skills/agents-and-council-of-llms/council-review.sh \
--session "..." \
--reviewers "Supreme_Court" \
--model "openrouter/openai/gpt-4o"
./skills/agents-and-council-of-llms/council-review.sh \
--session "..." \
--dry-run
Protocol (The "Council Chair" Loop)
Phase 0: Triage & Research
- Analyze & Route: Determine the Protocol Level.
- Level 1 (Executive Action): Simple facts, real-time data, or unambiguous consensus. Answer directly.
- Level 2 (Council Deliberation): Complex topics, subjective advice, code, or debates. Proceed to Pre-Research.
- Pre-Research: If the topic is obscure/specific, use web search FIRST to gather a "Fact Brief."
- Construct Prompt: Combine your research with the user's verbatim prompt so council members have ground truth to analyze. Never omit or paraphrase the user's original question.
Phase 1: Solicitation
- Write Prompt to File: For complex prompts, write to a temp file first to avoid shell escaping issues:
cat > /tmp/council_prompt.txt << 'PROMPT_EOF'
[Your research brief here]
=== USER'S QUESTION (verbatim) ===
[Exact user prompt here]
PROMPT_EOF
- Call Council: Use
council-convene.sh with appropriate mode:
./skills/agents-and-council-of-llms/council-convene.sh \
--prompt-file /tmp/council_prompt.txt \
--lenses "Technical, Historical, Philosophical"
- Guidance: You may append a "Chairman's Guidance" section to enforce constraints (e.g., "Focus on academic sources," "No moralizing").
Phase 2: The Review (Branch by Type)
- Fact-Check: If models disagree on a fact, use web search to determine the truth immediately.
- Consensus Check: If responses are unanimous or highly similar, skip to Phase 3. Only proceed to critique if there is significant disagreement.
- Critique (If needed): Run
council-review.sh on the resulting session directory.
Phase 3: The Verdict
- Synthesis: Deliver a cohesive narrative based on the transcripts.
- Adjudication: Explicitly state where you intervened (e.g., "Model A claimed X, but my verification search confirms Y...").
- Log:
- READ
council_logs.org first (create if missing).
- PREPEND the new entry to the top of the file.
- WRITE the updated content back.
Model Configuration
Models are configured via (in priority order):
--models command-line argument
COUNCIL_MODELS environment variable
~/.config/council/models.conf file
- Hardcoded defaults
See README.md for detailed configuration instructions, including how to discover your available models with opencode models.
Example Configuration File
openrouter/openai/gpt-4o-mini
openrouter/anthropic/claude-3.5-haiku
openrouter/google/gemini-2.0-flash-001
Environment Variables
| Variable | Description | Default |
|---|
COUNCIL_MODELS | Comma-separated model list | (from config file) |
COUNCIL_MODELS_FILE | Path to models config | ~/.config/council/models.conf |
COUNCIL_REVIEW_MODEL | Model for peer reviews | (first model in config) |
COUNCIL_TIMEOUT | Timeout per model call (seconds) | 120 |
COUNCIL_DEBUG | Set to 1 for verbose output | 0 |
Secrets Management
- Preferred: Use
skills/common/secrets.sh to load secrets from ~/.authinfo.gpg.
- Fallback: Ensure keys are in environment or
.env (gitignored, chmod 600).
source skills/common/secrets.sh
Troubleshooting
Prompt contains special characters or is very long
Use --prompt-file or --prompt-b64 instead of inline --problem:
echo "Your complex prompt with 'quotes' and $variables..." > /tmp/prompt.txt
./council-convene.sh --prompt-file /tmp/prompt.txt --count 3
prompt_b64=$(cat /tmp/prompt.txt | base64 -w0)
./council-convene.sh --prompt-b64 "$prompt_b64" --count 3
Shell tool times out before completion
Council sessions typically take 30-90 seconds for 3 members running in parallel. High-reasoning models may take longer.
- Ensure your shell tool timeout is ≥120 seconds (preferably 300s)
- If timeout is not configurable, run the script manually in a terminal
- Consider using faster models (flash/mini variants)
- Set
COUNCIL_TIMEOUT environment variable to adjust per-model timeout
"Model not found" errors
- Run
opencode models to see available models
- Check the exact model identifier format (e.g.,
openrouter/provider/model-name)
- Verify your API keys are configured in
opencode
Some council members failed
Check individual output files in the session directory:
ls -la ./transcripts/YYYYMMDD_HHMMSS/
cat ./transcripts/YYYYMMDD_HHMMSS/Member_1.md
Files containing COUNCIL_ERROR: indicate failures. Common causes:
- Model rate limiting
- API key issues
- Model-specific content filtering
Debugging
Enable verbose output:
COUNCIL_DEBUG=1 ./council-convene.sh --problem "test" --count 2
Validate configuration before running
Use dry-run mode:
./council-convene.sh --problem "test" --lenses "A, B, C" --dry-run
Session Artifacts
Each council session creates a timestamped directory in ./transcripts/:
| File | Description |
|---|
metadata.txt | Session parameters (problem, lenses, models) |
<Lens>_PROMPT.txt | Actual prompt sent to each member |
<Lens>.md | Raw response from each member |
FULL_TRANSCRIPT.md | Compiled transcript of all responses |
review_key.txt | Anonymization key (after review) |
<Reviewer>_REVIEW.md | Individual review outputs |
PEER_REVIEW.md | Aggregated peer reviews |