Inspiration

We were inspired by the growing conversation around inequality in the criminal justice system and how sentencing outcomes can vary dramatically based on factors like geography, legal representation, and demographics. Public sentencing data exists, but it is difficult for most people to interpret. We wanted to build a platform that makes these disparities visible, interactive, and easier to understand through AI and data visualization.


What it does

SentenceGap is an AI-powered sentencing disparity analytics platform that predicts sentencing outcomes based on case details such as:

  • offense type
  • criminal history
  • district
  • plea or trial status
  • race
  • gender
  • legal representation

The platform then:

  • compares the result against similar historical cases
  • visualizes disparities across districts and demographics
  • generates AI-powered explanations using Gemini
  • displays live analytics from MongoDB Atlas

A major feature is the interactive Case Comparison Tool, where users can compare two nearly identical cases side-by-side and observe how changing variables can impact sentencing outcomes.


How we built it

We built SentenceGap using:

  • React + TypeScript frontend
  • Flask Python backend
  • MongoDB Atlas for live sentencing data storage
  • Gemini AI for natural-language explanations
  • Recharts and react-simple-maps for visual analytics and the national disparity heatmap

The frontend communicates with a Flask API that queries MongoDB in real time to generate sentencing analytics and dashboard insights.


Challenges we ran into

One challenge was balancing ethical concerns with predictive modeling. We wanted the platform to highlight statistical disparities responsibly without presenting the system as proof of discrimination.

We also faced technical challenges integrating:

  • live MongoDB analytics
  • AI-generated explanations
  • interactive dashboards
  • national map visualizations within a limited hackathon timeframe.

Accomplishments that we're proud of

We are proud that SentenceGap evolved into a fully interactive analytics platform with:

  • live MongoDB-powered analytics
  • AI-generated sentencing insights
  • an interactive national disparity map
  • a side-by-side case comparison engine
  • a polished and responsive UI

Most importantly, we are proud that the project encourages transparency and conversation around an important social issue.


What we learned

Through this project, we gained experience with:

  • full-stack development
  • Flask APIs
  • MongoDB Atlas
  • AI integration with Gemini
  • interactive data visualization
  • fairness considerations in AI systems

We also learned how important presentation and accessibility are when communicating complex statistical information.


What's next for SentenceGap

In the future, we would like to:

  • integrate real federal sentencing datasets
  • add judge-level and county-level analytics
  • improve AI-generated insights
  • expand the national disparity map
  • support legal research and public transparency efforts

Built With

Share this project:

Updates