Inspiration

Encounters with law enforcement are inherently high-stakes and stressful. For the average citizen, the line between a consensual encounter, a legal detainment, and a violation of constitutional rights is often blurred. We realized there is a massive knowledge gap regarding local police protocols (like BPD Rules) and fundamental 4th and 5th Amendment rights. We built Badge Bridge Boston to bridge this gap, empowering citizens with the procedural knowledge and legal confidence needed to navigate complex street and traffic stops safely, legally, and effectively.

What it does

Badge Bridge Boston is an interactive, AI-powered legal education platform simulating real-world law enforcement encounters.

  • Data-Driven Context: Users start on an interactive map of Boston, viewing real-world arrest metrics, juvenile impact rates, and threat profiles for specific neighborhoods (e.g., Dorchester, Beacon Hill, Roxbury).
  • Interactive Modules: Users navigate branching, choice-based scenarios ranging from OUI traffic stops and street-level Terry Frisks to high-value shoplifting accusations. Every choice is evaluated against actual Massachusetts law and Boston Police Department procedural guidelines.
  • AI Legal Assistant: If a user makes a procedural error (a "Waiver" of rights), they can consult an integrated AI Legal Assistant for clarification without breaking immersion.
  • Dynamic Performance Debrief: Upon completing a module, the platform analyzes the user's first-attempt choices and uses a specialized legal Large Language Model to generate a personalized, highly detailed performance report evaluating their legal maneuvering.

How we built it

  • Frontend: We built a responsive, dynamic UI using React.js. We deliberately designed a clean, minimalist "Justice" aesthetic (utilizing slate, amber, and serif typography) to maintain a professional, authoritative tone.
  • Backend: We developed a Python/Flask REST API to handle request routing and context management between the user and the AI.
  • Artificial Intelligence: We integrated SaulLM, a specialized legal Large Language Model. To ensure absolute user privacy and reduce latency, we ran a quantized 4-bit version of the model completely locally using Apple's MLX framework.
  • Content Engineering: We meticulously researched MA state laws, Supreme Court precedents (e.g., Pennsylvania v. Mimms, Riley v. California), and BPD internal guidelines to construct highly accurate, realistic scenario trees.

Challenges we ran into

  • UI/UX Tone: Initially, our interface leaned heavily into a "cyberpunk/hacker" aesthetic. We quickly realized this gamified the experience too much, detracting from the serious nature of civil rights. We had to pivot our CSS and component architecture mid-development to a refined, professional legal theme.
  • LLM Context Management: Getting the local LLM to accurately answer procedural questions without hallucinating or leaking hidden system prompts required rigorous prompt engineering and strict chat-history rebuilding in the Flask backend.
  • State Management: Tracking the user's first choice per phase for accurate scoring, while still allowing them to acknowledge mistakes and retry for educational purposes, required complex React state management (useRef, Set objects) to prevent double-penalization.

Accomplishments that we're proud of

  • Local AI Integration: Successfully deploying a specialized legal LLM locally via MLX. This ensures that a user's sensitive procedural questions are never sent to external servers, upholding strict privacy standards.
  • The Smart Debrief Engine: We are incredibly proud of the dynamic reporting system. Feeding the user's exact branching pathway into SaulLM to generate a cohesive, personalized two-paragraph legal debrief makes the educational feedback highly engaging.
  • Translating Law into Logic: Taking dense, complex legal doctrines (like the limits of Shopkeeper's Privilege or the Plain Feel Doctrine) and translating them into clear, accessible, and interactive decision trees.

What we learned

  • Technical: We deepened our knowledge of integrating local ML models (MLX) with standard web stacks (React/Flask), effectively managing conversational context windows, and utilizing advanced CSS/Flexbox for complex modal overlays.
  • Legal: Our team gained a profound understanding of constitutional law, specifically how easily 4th Amendment protections against unreasonable search and seizure can be legally waived through simple conversational missteps.

What's next for Badge Bridge Boston

  • Expansion to New Jurisdictions: Adapting the curriculum to encompass NYPD, LAPD, and LAPD procedural rules, expanding the platform's utility nationwide.
  • Voice-Interactive Scenarios: Implementing Web Speech API to allow users to practice speaking their rights out loud, analyzing their tone and exact phrasing for better retention.
  • Community Partnerships: Partnering with public defender offices, civil rights organizations, and driver's education programs to deploy the tool as a standard educational resource for vulnerable populations.

Built With

Share this project:

Updates