As a law student in Morocco (Civil Law system), I have plans to pursue my Master's degree in the UK (Common Law system). I realized that thousands of international students face a "Legal Culture Shock." We don't need to relearn the law from scratch; we need to understand the differences. Existing tools just translate words, but legal concepts like "Cause" and "Consideration" are not translatable—they are fundamentally different logics. This inspired me to build LexBridge: a tool that teaches the "Delta" (the difference) rather than the basics.

LexBridge is an AI-powered "Legal Adaptation Agent." It doesn't waste time explaining basic legal concepts that a law student already knows. Instead, it:

  1. Identifies the Gap:** Compares the user's Source Jurisdiction (e.g., Morocco) with the Target Jurisdiction (e.g., UK).
  2. Focuses on the Delta:** Highlights only what is different, explaining the shift in legal logic (e.g., from "General Fault" to "Duty of Care").
  3. Simulates Scenarios:** Runs a mini-simulation to show how a specific case would have a different outcome in the new court system.

We built LexBridge using a "Low-Code, High-Reasoning" approach:

  • Frontend:** Built with Python and Streamlit for a clean, responsive interface.
  • The Innovation:** We used advanced System Prompting to instruct the model to act as a "Comparative Law Expert." We enforced constraints to prevent it from explaining basics and strictly focus on the "Legal Delta."

The biggest challenge was "Hallucination vs. Nuance." Initially, the AI would just translate legal terms literally (e.g., translating "Dommage Moral" as "Moral Damage" instead of "Pain and Suffering" or "Psychiatric Injury"). We had to refine the system prompts multiple times to ensure the AI understood the legal context of both jurisdictions, not just the language. Another challenge was handling the API integration as a first-time developer.

We are incredibly proud of building a functional, deploying AI agent in just a few weeks with limited coding experience. The most satisfying moment was seeing LexBridge correctly analyze the complex difference between Moroccan "Tort Liability" (Article 77 DOC) and the English "Tort of Negligence," accurately citing the "Neighbour Principle"—a distinction that usually takes students weeks to grasp.

We learned that Prompt Engineering is the new coding. By articulating the legal logic clearly in the system instructions, we could get Gemini to perform complex reasoning tasks. We also learned how to use Streamlit to rapidly prototype and deploy web apps without getting bogged down in HTML/CSS.

  1. What's Next? Multimodal Contract Scanning:* Leveraging Gemini's vision capabilities to let students snap a photo of a physical contract and get an instant clause-by-clause analysis against their target jurisdiction. Voice-to-Argument Simulation:* A "Mock Trial" mode where students can debate the AI (acting as a Judge) verbally to practice oral advocacy in the new language. Universal Jurisdiction Support:* Moving beyond the hardcoded dropdown menu to a Dynamic Input System. This will allow users to compare any legal system (e.g., Islamic Law/Sharia, Customary Law, or specific US State laws) by fully leveraging Gemini's vast parametric knowledge.

Built With

  • generative-ai
  • google-gemini-api
  • legal-tech
  • python
  • streamlit
Share this project:

Updates