A mixed-initiative system that uses LLMs to help civic leaders write questions for surveys, interviews, and conversation guides.
Effectively incorporating community input into civic decision-making is crucial for inclusive governance, yet public officials often have trouble writing effective questions due to time, resource, and experience constraints. Coalesce helps by improving question readability, specificity, and reducing bias, following best practices in questionnaire design.
Coalesce was originally built by Cassandra Overney, a Ph.D. candidate at MIT's Center for Constructive Communication (CCC). Her paper Coalesce: An Accessible Mixed-Initiative System for Designing Community-Centric Questionnaires documents the initial user study. The CCC Translational Research team then adopted and iterated on the prototype through additional user studies and UI improvements.
This code was open sourced in May 2026 as part of a code-share agreement between CCC and Cortico, a nonprofit amplifying underheard voices. The concept will become part of Cortico's product offering. This repository will not be updated further.
| Layer | Technology |
|---|---|
| Frontend | React 18 (Create React App), Material UI |
| Backend | Python / Flask |
| Task queue | Celery + Redis |
| Database | MongoDB Atlas |
| AI | OpenAI GPT-4o via DSPy |
- Docker and Docker Compose
- A MongoDB Atlas cluster (free tier works)
- An OpenAI API key
- Node.js (v18+) and npm (for the frontend)
The backend reads credentials from server/.env. Copy the example file and fill in your values:
cp server/.env.example server/.envThen edit server/.env:
MONGODB_URI=mongodb+srv://<user>:<password>@<cluster>.mongodb.net/?retryWrites=true&w=majority
FLASK_SECRET_KEY=<any-long-random-string>
OPENAI_API_KEY=sk-...
REDIS_BROKER_URL=redis://redis:6379/0 # matches the Docker service name; use redis://localhost:6379/0 without Docker
server/.envis in.gitignore. Do not commit it.
From the repo root:
docker compose up --buildThis starts three services:
| Service | URL |
|---|---|
| Flask API | http://localhost:5001 |
| Celery worker | (background) |
| Redis | localhost:6379 |
In a separate terminal:
cd ui
npm install # first time only
npm startThe React app runs at http://localhost:3000 and proxies API requests to the Flask backend on port 5001.
cd server
# Create and activate a conda environment
conda create -n coalesce python=3.12
conda activate coalesce
# Install dependencies
pip install -r requirements.txt
# Start Redis separately (e.g. via Homebrew: brew services start redis)
# Run the server
python server.pyThen start the Celery worker in a second terminal:
cd server
conda activate coalesce
celery -A server.celery worker --loglevel=INFOWhen running outside Docker, set
REDIS_BROKER_URL=redis://localhost:6379/0inserver/.env.
coalesce/
├── server/ # Flask backend + Celery tasks
│ ├── server.py # main application entry point
│ ├── db.py # MongoDB access layer
│ ├── dspy_accessor.py # LLM calls via DSPy
│ ├── dspy_modules.py # DSPy prompt modules
│ ├── compiled_modules/# pre-optimized DSPy modules
│ └── requirements.txt
├── ui/ # React frontend
│ └── src/
├── docker-compose.yml # local dev and production container definitions
└── Makefile # deployment helpers (AWS)
@inproceedings{overney2025coalesce,
title = {Coalesce: An Accessible Mixed-Initiative System for Designing Community-Centric Questionnaires},
author = {Overney, Cassandra and Kessler, Daniel T. and Fulay, Suyash P. and Jasim, Mahmood and Roy, Deb},
booktitle = {Proceedings of the 30th International Conference on Intelligent User Interfaces (IUI '25)},
year = {2025},
address = {Cagliari, Italy},
publisher = {ACM},
doi = {10.1145/3708359.3712118}
}