Inspiration
Court backlogs are a major challenge, and we wanted to explore whether AI could help with one part of the problem: identifying where limited time and attention could be focused first.
We wanted to build something that supports judicial work rather than replacing human judgment. This idea led us to NyayaFlow, an AI-assisted judicial triage system that uses historical Indian court data to identify cases that may be suitable for consideration in a faster procedural workflow.
What it does
NyayaFlow analyzes historical court case information using a Random Forest machine learning model to identify patterns associated with on-time and delayed case outcomes.
Based on these patterns, it generates a NyayaFlow Priority Score and groups cases into Fast-Track Candidate, Standard, or Requires Further Review.
The score is only a decision-support signal. It does not predict verdicts, guilt, innocence, or make judicial decisions.
We also integrated Google Gemini to generate a concise AI-assisted case brief from the available case information, helping a human reviewer understand the case more quickly.
The basic idea is simple: ML helps surface cases, AI summarizes the case, and humans make the final decision.
How we built it
We started with historical Indian lower-court case data from 2010–2018. We explored and cleaned the dataset, handled missing values, selected relevant features, and carefully checked for data leakage.
Some fields contained information that would only be available after a case had reached its outcome, so we removed them from the model. We also avoided using sensitive demographic information as model features.
For the machine learning component, we used Python, Pandas, NumPy, Scikit-learn, and a Random Forest classifier.
The model achieved approximately 79% accuracy and 0.87 ROC-AUC on our held-out test set.
We then connected the model to a Streamlit dashboard and integrated Google Gemini for AI-assisted case briefs.
Challenges we ran into
One of our biggest challenges was working with the historical dataset. It contained missing values, inconsistent fields, and some columns that could introduce data leakage.
We had to carefully think about which information would realistically be available when a case is being considered, rather than simply using every available column.
Another challenge was deciding how to interpret the model's prediction. We did not want to claim that AI could determine which cases should legally be prioritized. Instead, we designed the output as a triage signal for human consideration.
Integrating an LLM into a sensitive domain was also challenging. We added guardrails so that the AI-generated brief does not make claims about guilt, innocence, sentencing, or judicial decisions.
Accomplishments that we're proud of
We are proud that we built a complete working prototype rather than stopping at the machine learning model.
NyayaFlow brings together historical Indian court data, machine learning, priority scoring, data visualizations, AI-generated case briefs, and a human-in-the-loop approach in one application.
We are especially proud of focusing on responsible AI. Instead of presenting AI as a replacement for judicial expertise, we designed NyayaFlow to assist human decision-making.
What we learned
This project taught us that building an AI solution for a real-world problem involves much more than getting a good model score.
We learned how important it is to understand the dataset, identify data leakage, select features carefully, and think about how a model's output will actually be used.
We also learned that when using an LLM in a sensitive domain, defining what the AI should not do is just as important as defining what it can do.
Most importantly, we learned how to turn a machine learning model into a complete user-facing application while keeping human oversight at the center.
What's next for NyayaFlow
NyayaFlow is currently a prototype, and there is a lot of room for improvement.
We would like to work with larger and more recent datasets, improve model validation, evaluate fairness and bias, add better explainability for the priority score, and incorporate more detailed procedural information.
In the future, we would also like to explore secure integration with official court data systems and get feedback from legal and judicial domain experts.
Our goal is not to replace judicial decision-making with AI, but to explore how AI can help courts make better use of their time and information while keeping important decisions with qualified human professionals.
Built With
- ai
- artificial
- data
- forest
- gemini
- generative
- intelligence
- language
- learning
- machine
- natural
- numpy
- pandas
- processing
- python
- random
- responsible
- science
- scikit-learn
- streamlit

Log in or sign up for Devpost to join the conversation.