Inspiration
Navigating legal and administrative paperwork is overwhelming for most people—especially in high-stress situations like reporting an incident or filing a claim. We realized that many individuals struggle not because they lack the information, but because systems expect them to translate messy, real-life experiences into rigid, structured forms. This gap inspired us to build DocFlow: a tool that bridges human stories and legal systems.
What it does
DocFlow is an AI-powered legal assistant that transforms natural language incident descriptions into structured, actionable documents. Instead of manually filling out forms, users simply describe what happened, and DocFlow extracts key details, converts them into structured data, and auto-fills legal documents such as incident reports and small claims forms. It also highlights relevant legal considerations, surfaces risks, and provides guidance on next steps, helping users navigate complex legal processes with greater clarity and confidence.
How we built it
We built DocFlow as a full-stack application that combines AI, document processing, and data-driven insights into a seamless pipeline. On the frontend, we used React and Next.js to create an interface that brings together a document viewer, a spreadsheet-style input system, and an interactive analysis panel. On the backend, we used large language models (Gemini) to extract structured information from user narratives and generate contextual insights. We designed a canonical data schema to map user input across multiple documents and ensure consistency throughout the system. For document automation, we used pdf-lib to dynamically fill PDF forms using structured JSON outputs generated by the AI. In addition, we implemented regression models to estimate the number of days a case may take based on features such as case type and court department, providing users with a data-driven expectation of timelines.
Challenges we ran into
One of the biggest challenges was translating unstructured narratives into consistent and accurate structured data. Designing prompts and schemas that worked reliably across different types of incidents required multiple iterations. We also encountered inconsistencies in PDF form structures, which made automated filling more difficult than expected. On the analytics side, building a reliable regression model was challenging due to limited and noisy data, which impacted predictive performance. Finally, aligning all parts of the system—from AI extraction to document generation to analytics—into a cohesive and reliable pipeline required careful coordination and refinement.
Accomplishments that we're proud of
We are proud of building an end-to-end system that turns real-world incident stories into structured legal documents and actionable insights. We created an intuitive interface that mirrors how users naturally think—starting from a story and progressing into structured data and completed forms. We also successfully integrated multiple complex components, including AI extraction, document automation, and predictive analytics, into a unified experience that feels seamless and useful.
What we learned
We learned that AI is most powerful when it is used to structure and guide information rather than simply generate text. Building a strong underlying data schema was critical to making different parts of the system work together. We also saw firsthand how important user experience is, especially in high-stress scenarios like legal reporting. Finally, we learned that focusing on a clear, cohesive workflow is more impactful than trying to build too many features at once.
What's next for DocFlow
Moving forward, we plan to expand DocFlow to support a wider range of legal and administrative documents and improve the accuracy of our data extraction and validation. We aim to enhance cross-document consistency checks and incorporate retrieval-based systems to provide more context-aware legal insights. We are also interested in exploring real-world integrations with legal aid organizations and public services to make DocFlow accessible to the communities that need it most.
Built With
- elevenlabs
- express.js
- gemini
- next.js
- pdfviewer
- python
- randomforrestmodel
- render
- supabase
- vercel


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