Inspiration

The idea for PolicyGPT was born out of frustration with the inaccessibility of legislative documents. When trying to understand a local environmental protection bill, we encountered dense legalese that made it nearly impossible to grasp its true impact. We realized that if we struggled with this, how could the average citizen engage meaningfully with the policies that affect our world? Climate change, social justice, economic policy: these critical issues are often buried in legislative jargon that creates a barrier between citizens and the decisions that shape our planet's future. We created PolicyGPT to break down that barrier and democratize understanding of policy.

What it does

PolicyGPT transforms complex legislative documents into clear, accessible insights for everyone. Users can upload bills in various formats (PDF, DOCX, images), paste text directly, or analyze legislation via URLs. The application provides plain-language explanations, analyzes pros and cons, identifies stakeholder impacts, offers sentiment analysis with controversy scoring, supports multiple languages, enables collaboration through sharing and comparison features, and processes multiple documents with batch capabilities. By making legislation understandable, PolicyGPT empowers citizens to participate more effectively in democracy and advocate for the changes needed to build a sustainable future.

How we built it

We built PolicyGPT as a Flask web application with a clean blue and white interface. We leveraged OpenAI's GPT-4o model to analyze legislative text and generate insights, customizing our prompts to extract the most relevant information about each bill. For document processing, we implemented a robust pipeline using PyTesseract, PyMuPDF, and pdf2image to extract text from various document types, including OCR for scanned documents. We designed a PostgreSQL database system for user accounts, analysis history, and notification preferences. We implemented translation capabilities to make the platform globally accessible and created an intuitive interface using Bootstrap, enhanced with Font Awesome icons for a polished user experience.

Challenges we ran into

Building PolicyGPT presented several significant challenges. Legislative documents come in countless formats, layouts, and structures, making it difficult to create a system that could reliably extract text from all these variations. Ensuring that our AI summaries captured the true essence of bills without political bias required extensive testing and refinement. Processing large documents with OCR while maintaining reasonable response times was challenging, leading us to implement background batch processing. Making complex policy analysis approachable to non-experts required careful UI/UX considerations and multiple iterations. Finally, connecting multiple libraries and APIs into a cohesive system presented integration challenges, particularly with text extraction from different document formats.

Accomplishments that we're proud of

We're particularly proud of creating a fully functional document analysis system that handles multiple file formats and even URLs. Our sentiment analysis and controversy scoring features provide unique insights not available in similar tools. The implementation of batch processing for multiple documents significantly enhances productivity for power users. The clean, intuitive user interface with responsive design makes complex policy accessible to everyone. Finally, our notification system for alerting users about similar legislation creates a more connected experience for those following specific policy areas.

What we learned

This project taught us invaluable lessons about the power of AI to transform specialized knowledge into accessible insights. We gained experience with techniques for effective document processing across multiple formats and strategies for designing intuitive interfaces for complex information. We learned the importance of considering diverse user needs in civic technology and how technology can bridge gaps in democratic participation. The project also strengthened our skills in Flask development, database design, and API integration.

What's next for PolicyGPT UWB Hacks 2025

We plan to expand PolicyGPT with community discussion forums where users can share perspectives on analyzed legislation. We aim to add legislative tracking to monitor bills as they progress through legislative processes and action recommendations suggesting specific steps citizens can take based on bill analysis. Integration with advocacy platforms will connect users directly to representatives and advocacy campaigns. Enhanced historical context will provide background on similar legislation. Our ultimate goal is to build a complete ecosystem that not only explains policy but facilitates the informed civic engagement needed to address the world's most pressing challenges.

Built With

  • api
  • bootstrap-5-database:-postgresql-ai/machine-learning:-openai-gpt-4o-api-authentication:-flask-login-forms:-flask-wtf
  • content
  • css
  • document
  • email
  • email-validator
  • javascript
  • pillow
  • processing:
  • pymupdf
  • pytesseract
  • python-docx
  • replit
  • scraping:
  • sendgrid
  • services:
  • styling/ui:
  • trafilatura
  • url
  • web
  • word
+ 68 more
Share this project:

Updates