A multi-agent AI system where 5 autonomous stakeholder agents, each with a distinct identity, bias, and value system, debate any policy question across multiple rounds of structured deliberation. A Summarizer agent synthesizes the debate into a structured impact report with consensus areas, key disagreements, actionable recommendations, implementation roadmaps, and preserved minority dissent. Reports are automatically saved to Google Drive and emailed via Gmail. The entire system runs through a real-time Streamlit web interface with live debate streaming, powered by local LLM inference via Ollama, no API costs, no cloud dependency.
git clone https://github.com/ChiragSW/LLM-Town-Hall.git
cd policy-town-hallpython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txtcopy .env.example .env # Windows
# cp .env.example .env # macOS/LinuxEdit .env with your settings. The defaults work out of the box with Ollama.
Download from ollama.com, then:
ollama pull qwen2.5:3b-instruct
ollama pull qwen2.5:7b-instructstreamlit run ui/app.pyOpen http://localhost:8501 in your browser.
| # | Emoji | Name | Identity | Core Values |
|---|---|---|---|---|
| 1 | 👤 | Citizen Representative | Priya Sharma, 34, mid-sized city resident | Fairness, affordability, human dignity |
| 2 | 📊 | Independent Economist | Dr. Arjun Mehta, development economist, 15yr experience | Evidence, data, non-partisan analysis |
| 3 | 🌱 | Environmental Scientist | Dr. Meera Nair, climate policy researcher | Ecological health, environmental justice |
| 4 | 🏭 | Business Representative | Rajesh Kapoor, MSME entrepreneur, 140 employees | Practicality, business viability, anti-stupid-regulation |
| 5 | 🏛️ | Senior Policy Analyst | Vikram Rao, 20-year IAS veteran | Implementation feasibility, institutional realism |
These three policies are tested to produce genuinely split, engaging debates:
-
"Should Ahmedabad ban petrol and diesel auto-rickshaws by 2027 and replace them with CNG/electric?"
-
"Should India impose a carbon tax of ₹2,000 per tonne on all industrial CO2 emissions?"
-
"Should public schools in India serve free mid-day meals through Grade 12?"
To enable automatic report saving and email delivery:
- Go to Google Cloud Console
- Create a new project (e.g., "Policy Town Hall")
- Enable the Google Drive API and Gmail API from APIs & Services → Library
- Go to APIs & Services → Credentials
- Click "Create Credentials" → "OAuth 2.0 Client ID"
- Application type: Desktop app
- Download the JSON file and save it as
client_secret.jsonin the project root
- Go to APIs & Services → OAuth consent screen
- Set to External (or Internal for Workspace)
- Add your email as a test user
On first run with Drive/Gmail enabled, a browser window will open for OAuth consent. After authorization, a token.json file is created automatically for future runs.
Note: Google OAuth is optional. The debate and report generation work perfectly without it. The app gracefully handles missing Google credentials.
-
Multi-agent adversarial debate -> Not a single-prompt summarizer. Five agents with genuinely different value systems build on, challenge, and respond to each other across multiple rounds, producing richer analysis than any single-agent system.
-
Evidence-grounded reasoning -> DuckDuckGo web search injects real-world data, statistics, and precedents into each agent's context. Agents cite sources. Claims are traceable.
-
Preserved minority dissent -> The summarizer is explicitly instructed to never smooth over disagreements. The report preserves the most important dissenting view with full attribution — because silenced dissent is a policy failure waiting to happen.
-
Local-first, zero-cost inference -> Runs entirely on your machine via Ollama with 3B/7B models. No API keys required for the core debate loop. Cloud LLM (Anthropic) is an optional fallback.
Built a 5-agent autonomous policy simulation system with local LLM inference (Ollama), multi-round debate orchestration, DuckDuckGo-grounded evidence snippets, and automated Google Drive/Gmail delivery — generating structured policy impact reports with preserved minority dissent in under 2 minutes.
policy-town-hall/
├── .env.example # Environment variable template
├── .gitignore # Git ignore rules
├── config.py # Central config + unified LLM call wrapper
├── requirements.txt # Python dependencies
├── README.md # This file
├── SETUP.md # Quick setup commands
│
├── agents/
│ ├── __init__.py
│ ├── definitions.py # 5 stakeholder agent identities + system prompts
│ ├── orchestrator.py # Frames policy → structured debate plan
│ └── summarizer.py # Debate → structured impact report
│
├── core/
│ ├── __init__.py
│ ├── debate.py # Multi-round debate engine w/ context builder
│ ├── google_tools.py # Google Drive + Gmail integration (OAuth2)
│ └── search.py # DuckDuckGo search wrapper
│
├── data/
│ ├── __init__.py
│ └── storage.py # SQLite persistence layer
│
├── ui/
│ ├── __init__.py
│ └── app.py # Streamlit web interface
│
└── tests/
├── __init__.py
└── test_debate.py # Unit tests for debate engine + agents
