council-engine 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. council_engine-0.3.0/LICENSE +21 -0
  2. council_engine-0.3.0/PKG-INFO +164 -0
  3. council_engine-0.3.0/README.md +135 -0
  4. council_engine-0.3.0/council/__init__.py +6 -0
  5. council_engine-0.3.0/council/chair.py +393 -0
  6. council_engine-0.3.0/council/cli.py +907 -0
  7. council_engine-0.3.0/council/config.py +80 -0
  8. council_engine-0.3.0/council/db.py +180 -0
  9. council_engine-0.3.0/council/events.py +43 -0
  10. council_engine-0.3.0/council/formatting.py +116 -0
  11. council_engine-0.3.0/council/orchestrator.py +1031 -0
  12. council_engine-0.3.0/council/providers/__init__.py +94 -0
  13. council_engine-0.3.0/council/providers/base.py +86 -0
  14. council_engine-0.3.0/council/providers/claude.py +377 -0
  15. council_engine-0.3.0/council/providers/gemini.py +409 -0
  16. council_engine-0.3.0/council/providers/ollama.py +418 -0
  17. council_engine-0.3.0/council/providers/openai.py +332 -0
  18. council_engine-0.3.0/council/renderers.py +256 -0
  19. council_engine-0.3.0/council/repl.py +689 -0
  20. council_engine-0.3.0/council/settings.py +236 -0
  21. council_engine-0.3.0/council/tools.py +354 -0
  22. council_engine-0.3.0/council_engine.egg-info/PKG-INFO +164 -0
  23. council_engine-0.3.0/council_engine.egg-info/SOURCES.txt +28 -0
  24. council_engine-0.3.0/council_engine.egg-info/dependency_links.txt +1 -0
  25. council_engine-0.3.0/council_engine.egg-info/entry_points.txt +2 -0
  26. council_engine-0.3.0/council_engine.egg-info/requires.txt +6 -0
  27. council_engine-0.3.0/council_engine.egg-info/top_level.txt +1 -0
  28. council_engine-0.3.0/pyproject.toml +46 -0
  29. council_engine-0.3.0/setup.cfg +4 -0
  30. council_engine-0.3.0/tests/test_critique_filtering.py +77 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Amith Mathew
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,164 @@
1
+ Metadata-Version: 2.4
2
+ Name: council-engine
3
+ Version: 0.3.0
4
+ Summary: A structured deliberation protocol across diverse AI models
5
+ Author-email: Amith Mathew <amith@councilengine.dev>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://councilengine.dev
8
+ Project-URL: Repository, https://github.com/amithmathew/council-engine
9
+ Project-URL: Documentation, https://councilengine.dev/architecture
10
+ Keywords: ai,llm,multi-model,deliberation,debate,heterogeneous,protocol
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: google-genai>=1.64.0
23
+ Requires-Dist: openai>=1.0.0
24
+ Requires-Dist: anthropic>=0.39.0
25
+ Requires-Dist: httpx>=0.27.0
26
+ Requires-Dist: rich>=13.0.0
27
+ Requires-Dist: prompt-toolkit>=3.0.0
28
+ Dynamic: license-file
29
+
30
+ # Council Engine
31
+
32
+ A structured deliberation protocol across diverse AI models.
33
+
34
+ Single-model outputs are fluent, fast, and often wrong in the same direction. Council runs a bounded deliberation across different models, processes critique explicitly, and returns a decision you can inspect. The point is not more text. It is better judgment.
35
+
36
+ **Website:** [councilengine.dev](https://councilengine.dev)
37
+
38
+ ## How it works
39
+
40
+ Council orchestrates a bounded 3-stage protocol:
41
+
42
+ 1. **Proposals** — Multiple models respond to the same task independently. Each produces a clear position.
43
+ 2. **Critique** — Models review each other through a constrained vocabulary: *challenge*, *alternative*, *refinement*, and *question*. Silence is treated as approval.
44
+ 3. **Resolution** — A lead model classifies the disagreement and produces one of four adaptive outcomes:
45
+ - **Recommendation** — Council agrees; single clear guidance.
46
+ - **Alternatives** — Real tradeoffs remain; presented with decision rules.
47
+ - **Question** — A missing fact is decisive; outputs a clarifying question.
48
+ - **Investigate** — Evidence is needed; outputs an investigation plan.
49
+
50
+ ## Why heterogeneous models
51
+
52
+ Research shows that multi-agent debate improves reasoning when the agents are actually different. Same-model personas tend to converge on the same errors. Council uses genuinely different foundation models — not different prompts to the same model — because diverse architectures surface conflicting assumptions and different failure modes.
53
+
54
+ ## Supported providers
55
+
56
+ | Provider | Auth | Web search |
57
+ |----------|------|------------|
58
+ | **Gemini** (Google) | API key (AI Studio or Vertex AI) or ADC | Yes (Google Search) |
59
+ | **ChatGPT** (OpenAI) | API key | Yes (web_search_preview) |
60
+ | **Claude** (Anthropic) | API key | No |
61
+ | **Ollama** (local) | None — runs locally | No |
62
+
63
+ ## Install
64
+
65
+ ```bash
66
+ pip install council-engine
67
+ ```
68
+
69
+ All providers are included. No optional extras needed.
70
+
71
+ ## Setup
72
+
73
+ Run the guided setup:
74
+
75
+ ```bash
76
+ council init
77
+ ```
78
+
79
+ This creates `~/.council/config.toml` with your API keys and validates each connection. You need at least one provider configured; for multi-model deliberation, configure two or more.
80
+
81
+ ### Manual configuration
82
+
83
+ Edit `~/.council/config.toml` directly:
84
+
85
+ ```toml
86
+ [providers.gemini]
87
+ api_key = "your-google-api-key" # from https://aistudio.google.com/apikey
88
+
89
+ [providers.chatgpt]
90
+ api_key = "your-openai-api-key" # from https://platform.openai.com/api-keys
91
+
92
+ [providers.claude]
93
+ api_key = "your-anthropic-api-key" # from https://console.anthropic.com/settings/keys
94
+
95
+ [providers.ollama]
96
+ host = "http://localhost:11434" # ollama serve && ollama pull <model>
97
+ model = "llama3.1:8b" # browse models: https://ollama.com/library
98
+ ```
99
+
100
+ Environment variables override the config file: `COUNCIL_GEMINI_API_KEY`, `COUNCIL_OPENAI_API_KEY`, `COUNCIL_CLAUDE_API_KEY`, `COUNCIL_OLLAMA_HOST`.
101
+
102
+ ## Usage
103
+
104
+ ### Interactive REPL
105
+
106
+ ```bash
107
+ council
108
+ ```
109
+
110
+ Launches a persistent session with tab completion, slash commands, and multi-model deliberation by default. Type a question and press Enter to convene the full council.
111
+
112
+ - `@gemini <msg>` — send to a single model
113
+ - `/attach <file>` — attach files for the council to read
114
+ - `/discuss <prompt>` — reconvene after follow-up
115
+ - `/new` — start a new conversation
116
+ - `/resume <name>` — resume a past conversation
117
+
118
+ ### Structured deliberation
119
+
120
+ ```bash
121
+ council discuss --models gemini,claude "Should we use event sourcing or CRUD for our collaborative editor?"
122
+ ```
123
+
124
+ Runs the full 3-stage protocol (Proposals → Critique → Resolution) and outputs the result.
125
+
126
+ ### Quick query
127
+
128
+ ```bash
129
+ council ask --model chatgpt "What are the tradeoffs of gRPC vs REST for internal services?"
130
+ ```
131
+
132
+ Single-model query. Promote to a full conversation with `council promote <name>`.
133
+
134
+ ### Multi-model chat
135
+
136
+ ```bash
137
+ council chat --models gemini,chatgpt,claude "my-conversation" "Your message here"
138
+ ```
139
+
140
+ ## Architecture
141
+
142
+ Council is built with explicit boundaries and auditability:
143
+
144
+ - **Event bus** — orchestration decoupled from rendering; same protocol drives terminal UI, plain text, or custom consumers
145
+ - **Persistent audit trail** — every proposal, critique, and resolution stored in SQLite with full metadata
146
+ - **Chair subsystem** — sandboxed file operations with mediated reads (workspace-wide) and writes (council-output/ only)
147
+ - **Provider abstraction** — pluggable model backends with parallel execution via asyncio
148
+ - **Two integration surfaces** — interactive REPL for humans, CLI commands for automation and agent tooling
149
+
150
+ See the full [architecture documentation](https://councilengine.dev/architecture).
151
+
152
+ ## Research
153
+
154
+ Council's design is informed by research on multi-model deliberation:
155
+
156
+ 1. Du, Y. et al. 2023. *Improving Factuality and Reasoning in Language Models through Multiagent Debate.*
157
+ 2. *Understanding Agent Scaling in LLM-Based Multi-Agent Systems via Diversity.* 2026.
158
+ 3. *If Multi-Agent Debate is the Answer, What is the Question?* 2025.
159
+ 4. *Dipper: Diversity in Prompts for Producing Large Language Model Ensembles.* 2024.
160
+ 5. Zheng, et al. 2023. *Persona prompting and factual task performance.*
161
+
162
+ ## License
163
+
164
+ MIT
@@ -0,0 +1,135 @@
1
+ # Council Engine
2
+
3
+ A structured deliberation protocol across diverse AI models.
4
+
5
+ Single-model outputs are fluent, fast, and often wrong in the same direction. Council runs a bounded deliberation across different models, processes critique explicitly, and returns a decision you can inspect. The point is not more text. It is better judgment.
6
+
7
+ **Website:** [councilengine.dev](https://councilengine.dev)
8
+
9
+ ## How it works
10
+
11
+ Council orchestrates a bounded 3-stage protocol:
12
+
13
+ 1. **Proposals** — Multiple models respond to the same task independently. Each produces a clear position.
14
+ 2. **Critique** — Models review each other through a constrained vocabulary: *challenge*, *alternative*, *refinement*, and *question*. Silence is treated as approval.
15
+ 3. **Resolution** — A lead model classifies the disagreement and produces one of four adaptive outcomes:
16
+ - **Recommendation** — Council agrees; single clear guidance.
17
+ - **Alternatives** — Real tradeoffs remain; presented with decision rules.
18
+ - **Question** — A missing fact is decisive; outputs a clarifying question.
19
+ - **Investigate** — Evidence is needed; outputs an investigation plan.
20
+
21
+ ## Why heterogeneous models
22
+
23
+ Research shows that multi-agent debate improves reasoning when the agents are actually different. Same-model personas tend to converge on the same errors. Council uses genuinely different foundation models — not different prompts to the same model — because diverse architectures surface conflicting assumptions and different failure modes.
24
+
25
+ ## Supported providers
26
+
27
+ | Provider | Auth | Web search |
28
+ |----------|------|------------|
29
+ | **Gemini** (Google) | API key (AI Studio or Vertex AI) or ADC | Yes (Google Search) |
30
+ | **ChatGPT** (OpenAI) | API key | Yes (web_search_preview) |
31
+ | **Claude** (Anthropic) | API key | No |
32
+ | **Ollama** (local) | None — runs locally | No |
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pip install council-engine
38
+ ```
39
+
40
+ All providers are included. No optional extras needed.
41
+
42
+ ## Setup
43
+
44
+ Run the guided setup:
45
+
46
+ ```bash
47
+ council init
48
+ ```
49
+
50
+ This creates `~/.council/config.toml` with your API keys and validates each connection. You need at least one provider configured; for multi-model deliberation, configure two or more.
51
+
52
+ ### Manual configuration
53
+
54
+ Edit `~/.council/config.toml` directly:
55
+
56
+ ```toml
57
+ [providers.gemini]
58
+ api_key = "your-google-api-key" # from https://aistudio.google.com/apikey
59
+
60
+ [providers.chatgpt]
61
+ api_key = "your-openai-api-key" # from https://platform.openai.com/api-keys
62
+
63
+ [providers.claude]
64
+ api_key = "your-anthropic-api-key" # from https://console.anthropic.com/settings/keys
65
+
66
+ [providers.ollama]
67
+ host = "http://localhost:11434" # ollama serve && ollama pull <model>
68
+ model = "llama3.1:8b" # browse models: https://ollama.com/library
69
+ ```
70
+
71
+ Environment variables override the config file: `COUNCIL_GEMINI_API_KEY`, `COUNCIL_OPENAI_API_KEY`, `COUNCIL_CLAUDE_API_KEY`, `COUNCIL_OLLAMA_HOST`.
72
+
73
+ ## Usage
74
+
75
+ ### Interactive REPL
76
+
77
+ ```bash
78
+ council
79
+ ```
80
+
81
+ Launches a persistent session with tab completion, slash commands, and multi-model deliberation by default. Type a question and press Enter to convene the full council.
82
+
83
+ - `@gemini <msg>` — send to a single model
84
+ - `/attach <file>` — attach files for the council to read
85
+ - `/discuss <prompt>` — reconvene after follow-up
86
+ - `/new` — start a new conversation
87
+ - `/resume <name>` — resume a past conversation
88
+
89
+ ### Structured deliberation
90
+
91
+ ```bash
92
+ council discuss --models gemini,claude "Should we use event sourcing or CRUD for our collaborative editor?"
93
+ ```
94
+
95
+ Runs the full 3-stage protocol (Proposals → Critique → Resolution) and outputs the result.
96
+
97
+ ### Quick query
98
+
99
+ ```bash
100
+ council ask --model chatgpt "What are the tradeoffs of gRPC vs REST for internal services?"
101
+ ```
102
+
103
+ Single-model query. Promote to a full conversation with `council promote <name>`.
104
+
105
+ ### Multi-model chat
106
+
107
+ ```bash
108
+ council chat --models gemini,chatgpt,claude "my-conversation" "Your message here"
109
+ ```
110
+
111
+ ## Architecture
112
+
113
+ Council is built with explicit boundaries and auditability:
114
+
115
+ - **Event bus** — orchestration decoupled from rendering; same protocol drives terminal UI, plain text, or custom consumers
116
+ - **Persistent audit trail** — every proposal, critique, and resolution stored in SQLite with full metadata
117
+ - **Chair subsystem** — sandboxed file operations with mediated reads (workspace-wide) and writes (council-output/ only)
118
+ - **Provider abstraction** — pluggable model backends with parallel execution via asyncio
119
+ - **Two integration surfaces** — interactive REPL for humans, CLI commands for automation and agent tooling
120
+
121
+ See the full [architecture documentation](https://councilengine.dev/architecture).
122
+
123
+ ## Research
124
+
125
+ Council's design is informed by research on multi-model deliberation:
126
+
127
+ 1. Du, Y. et al. 2023. *Improving Factuality and Reasoning in Language Models through Multiagent Debate.*
128
+ 2. *Understanding Agent Scaling in LLM-Based Multi-Agent Systems via Diversity.* 2026.
129
+ 3. *If Multi-Agent Debate is the Answer, What is the Question?* 2025.
130
+ 4. *Dipper: Diversity in Prompts for Producing Large Language Model Ensembles.* 2024.
131
+ 5. Zheng, et al. 2023. *Persona prompting and factual task performance.*
132
+
133
+ ## License
134
+
135
+ MIT
@@ -0,0 +1,6 @@
1
+ """Council — Multi-model brainstorm CLI."""
2
+
3
+ from council.cli import main
4
+
5
+ __all__ = ["main"]
6
+ __version__ = "0.2.0"