Exact commands to run from scratch on a fresh machine.
- Python 3.11+ — python.org/downloads
- Ollama — ollama.com/download
- Git — git-scm.com
git clone <your-repo-url>
cd policy-town-hallpython -m venv venvActivate it:
# Windows (PowerShell)
venv\Scripts\Activate.ps1
# Windows (cmd)
venv\Scripts\activate.bat
# macOS / Linux
source venv/bin/activatepip install -r requirements.txt# Windows
copy .env.example .env
# macOS/Linux
cp .env.example .envOpen .env in your editor. The defaults work with Ollama out of the box:
LLM_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
DEBATE_MODEL=qwen2.5:3b-instruct
SUMMARY_MODEL=qwen2.5:7b-instructDownload and install Ollama from ollama.com.
Pull the required models:
# Required — fast 3B model for debate turns
ollama pull qwen2.5:3b-instruct
# Recommended — higher-quality 7B model for report synthesis
ollama pull qwen2.5:7b-instructVerify Ollama is running:
ollama listYou should see qwen2.5:3b-instruct in the output.
streamlit run ui/app.pyOpen http://localhost:8501 in your browser.
python -m pytest tests/test_debate.py -vOnly needed if you want to save reports to Google Drive or send email summaries.
- Go to console.cloud.google.com
- Create a new project
- Navigate to APIs & Services → Library
- Enable Google Drive API
- Enable Gmail API
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth 2.0 Client ID
- Application type: Desktop app
- Download the JSON file
- Save it as
client_secret.jsonin the project root
- Go to APIs & Services → OAuth consent screen
- Select External
- Add your email as a test user
GOOGLE_OAUTH_CLIENT_SECRETS=client_secret.json
GOOGLE_OAUTH_TOKEN=token.json
GMAIL_RECIPIENT=your_email@gmail.comOn first launch with Drive/Gmail enabled, a browser window will open asking for Google authorization. After you approve, a token.json is created and reused automatically.
| Problem | Solution |
|---|---|
ConnectionRefusedError on LLM call |
Make sure Ollama is running: ollama serve |
| Model not found | Pull it: ollama pull qwen2.5:3b-instruct |
| Google Drive fails silently | Check that client_secret.json exists and APIs are enabled |
ModuleNotFoundError |
Activate your venv and run pip install -r requirements.txt |
| Streamlit import errors | Run from project root: streamlit run ui/app.py |
| DuckDuckGo search returns empty | Normal if rate-limited; debate continues without evidence |
- Start the app:
streamlit run ui/app.py - Click the sample policy: "Should Ahmedabad implement a congestion tax on private vehicles?"
- Set rounds to 2 for speed
- Uncheck Drive/Gmail (unless configured)
- Click Start Debate
- Watch agents debate in real time
- Review the structured impact report
- Download the JSON report
Total time: ~2 minutes with qwen2.5:3b-instruct on CPU.