AI Council Documentation
Everything you need to know to get the most out of AI Council.
Installation
AI Council is distributed as an npm package with pre-compiled binaries for all major platforms.
npm install -g @mugzie/ai-council
This automatically installs the correct binary for your platform:
- macOS - darwin-arm64 (Apple Silicon) or darwin-x64 (Intel)
- Linux - linux-arm64 or linux-x64
- Windows - win32-x64
Run ai-council --help to verify the installation was successful.
License Setup
AI Council requires a valid license key to operate. Purchase your license from our store.
Purchase LicenseOnce you have your license key, set it as an environment variable:
export AI_COUNCIL_LICENSE_KEY="your-license-key"
# AI Council License
export AI_COUNCIL_LICENSE_KEY="your-license-key"
Quick Start
Get up and running with AI Council in under a minute.
Install the package
npm install -g @mugzie/ai-council
Set your license key
export AI_COUNCIL_LICENSE_KEY="your-key"
Configure AI provider (at least one required)
# OpenAI (recommended)
export OPENAI_API_KEY="sk-..."
# Or Google Gemini
export GEMINI_API_KEY="..."
# Or both for best results!
Run your first review
ai-council review --diff --branch=main --pretty
Basic Usage
AI Council analyzes your git diff and provides recommendations from multiple AI perspectives.
# Review changes against main branch
ai-council review --diff --branch=main --pretty
# Review changes against develop branch
ai-council review --diff --branch=develop --pretty
# Review staged changes only
ai-council review --diff --pretty
Output Formats
Control how results are displayed:
| Flag | Description |
|---|---|
--pretty |
Human-readable formatted output with colors and emojis |
--json |
JSON output for programmatic use |
--ci |
CI mode - exits with code 1 on REJECT or low confidence |
Review Commands
AI Council offers specialized review modes that focus on specific aspects of your code.
ai-council review
Comprehensive code review with all agents: Senior Developer, Security, Performance, Pragmatist, and Gemini.
ai-council review --diff --pretty
ai-council security
Security-focused review examining vulnerabilities, authentication, and secure coding practices.
ai-council security --diff --pretty
ai-council perf
Performance analysis focusing on algorithmic complexity, bottlenecks, and optimization opportunities.
ai-council perf --diff --pretty
ai-council arch
Architecture review evaluating design patterns, scalability, and system structure.
ai-council arch --diff --pretty
ai-council sanity
Quick sanity check with Pragmatist, Senior Dev, and Architect for a balanced perspective.
ai-council sanity --diff --pretty
CI/CD Mode
Integrate AI Council into your continuous integration pipeline to automatically review pull requests.
name: AI Council Review
on:
pull_request:
branches: [main, develop]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install AI Council
run: npm install -g @mugzie/ai-council
- name: Run Code Review
env:
AI_COUNCIL_LICENSE_KEY: ${{ secrets.AI_COUNCIL_LICENSE_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: ai-council review --diff --branch=origin/main --ci
In CI mode, AI Council exits with code 1 when the final decision is REJECT or when overall confidence is below 0.5. This can be used to block merges.
MCP Server
AI Council includes a Model Context Protocol (MCP) server for integration with AI assistants like Claude and Cursor.
ai-council mcp
The MCP server exposes AI Council's functionality as tools that can be invoked by AI assistants, enabling them to request code reviews during conversations.
Claude Integration
Add AI Council to Claude Code for seamless code review within your Claude conversations.
claude mcp add --transport stdio ai-council -- ai-council mcp
Once configured, Claude can invoke AI Council to review code snippets or git diffs during your conversation.
Cursor Integration
Configure AI Council as an MCP server in Cursor for integrated code review.
{
"mcpServers": {
"ai-council": {
"command": "ai-council",
"args": ["mcp"],
"env": {
"AI_COUNCIL_LICENSE_KEY": "your-license-key",
"OPENAI_API_KEY": "your-openai-key",
"GEMINI_API_KEY": "your-gemini-key",
"AI_COUNCIL_MODEL": "gpt-4o-mini",
"AI_COUNCIL_GEMINI_MODEL": "gemini-2.0-flash"
}
}
}
}
Place the .mcp.json file in your project root or home directory for Cursor to automatically detect it.
Environment Variables
Configure AI Council's behavior through environment variables.
| Variable | Required | Default | Description |
|---|---|---|---|
AI_COUNCIL_LICENSE_KEY |
Yes | - | Your license key from the store |
OPENAI_API_KEY |
No* | - | OpenAI API key for GPT models |
GEMINI_API_KEY |
No* | - | Google Gemini API key |
AI_COUNCIL_MODEL |
No | gpt-4o-mini |
OpenAI model to use |
AI_COUNCIL_GEMINI_MODEL |
No | gemini-2.0-flash |
Gemini model to use |
* At least one of OPENAI_API_KEY or GEMINI_API_KEY is required.
AI Providers
AI Council supports multiple AI providers for diverse perspectives.
OpenAI (Primary)
Used for most agents including Senior Developer, Security, Performance, Architect, and Pragmatist.
export OPENAI_API_KEY="sk-..."
Google Gemini
Powers the Gemini Structural Thinker agent, providing alternative reasoning and challenging assumptions.
export GEMINI_API_KEY="..."
Configure both providers for the most comprehensive reviews. The diversity of AI models leads to better coverage and catches more edge cases.
Model Selection
Customize which AI models power your council.
OpenAI Models
| Model | Speed | Cost | Quality |
|---|---|---|---|
gpt-4o-mini |
Fast | Low | Good (default) |
gpt-4o |
Medium | High | Excellent |
gpt-4-turbo |
Medium | High | Excellent |
Gemini Models
| Model | Speed | Cost | Quality |
|---|---|---|---|
gemini-2.0-flash |
Fast | Low | Good (default) |
gemini-1.5-pro |
Medium | Medium | Excellent |
Agents Overview
AI Council assembles a diverse panel of specialized AI agents.
Senior Developer
Generalist15+ years of experience. Focuses on maintainability, best practices, readability, testability, and long-term sustainability. Comments on any aspect of the code.
Security Engineer
SpecialistIdentifies security vulnerabilities, authentication issues, SQL injection, XSS, CSRF, and other security concerns. Abstains when code has no security implications.
Performance Engineer
SpecialistAnalyzes algorithmic complexity (O(n), O(log n)), memory usage, caching opportunities, and optimization potential. Abstains for code without performance implications.
Software Architect
SpecialistEvaluates design patterns, scalability, separation of concerns, system boundaries, and how code fits into the broader system. Abstains for simple changes.
Gemini Thinker
ChallengerPowered by Google Gemini. Challenges assumptions, reframes problems, identifies edge cases, and provides alternative system-level perspectives.
Pragmatist
GeneralistBalances perfectionism with shipping. Considers deadlines, team velocity, and whether the code effectively solves the problem. Sometimes "good enough" is right.
Voting System
Each agent casts a vote with a confidence score. The system uses these to reach a final decision.
Vote Types
Code meets quality standards and can be merged
Code needs improvements before merging
Code has fundamental issues that must be addressed
Agent defers due to low confidence or irrelevant domain
Confidence Scores
Each vote includes a confidence score from 0.0 to 1.0:
- 0.8-1.0: High confidence - agent is certain about their assessment
- 0.5-0.8: Moderate confidence - reasonable certainty
- < 0.5: Low confidence - agent automatically abstains
Abstention Rules
Agents abstain in two scenarios:
- Domain Mismatch: Specialist agents (Security, Performance, Architect) abstain when code doesn't match their domain expertise
- Low Confidence: Any agent with confidence below 0.5 automatically abstains
Debate System
When Gemini dissents from the majority, AI Council triggers an automated debate to explore the disagreement.
Debate Flow
- Detection: System detects Gemini's vote differs from majority
- Escalation: Debate is triggered between Gemini and the strongest majority voice
- Rebuttal: Majority agent responds to Gemini's concerns
- Counter: Gemini provides final response (maintain, partial concede, or full concede)
- Judgment: Judge considers the debate when making final decision
⚡ Debate escalation: Gemini (REJECT) dissents from majority (APPROVE)
1. senior-dev (DEFEND): The null check on line 42 handles the edge case
Gemini mentioned. The early return pattern is intentional for...
2. gemini (PARTIAL_CONCEDE): I acknowledge the null check, but maintain
concern about the async race condition that could still occur when...
Gemini uses a different AI model (Google's) than other agents. This intentional diversity helps catch edge cases and provides truly alternative perspectives that might be missed by a single AI provider.
Need Help?
Can't find what you're looking for? Here are some resources: