LegitLex
Making the law understandable for ordinary people.
Inspiration
The idea for LegitLex started with a ticket.
While riding an electric scooter, I was stopped by police, given a warning, and fined because I didn't have a license. The thing is, riding that same e-scooter without a license is completely legal in the United States, where I'd done it many times without a second thought. In Korea, it isn't.
I had no idea the rule was different until an officer was explaining it to me.
That moment stuck with me. I hadn't been reckless or careless — I just didn't know, and there was no realistic way I could have known. The law that affected me was written down somewhere, in language I'd never read, in a code I didn't know existed.
The more I thought about it, the more I realized this happens constantly: people break small laws in their daily lives without ever noticing — parking rules, noise ordinances, leash laws, permit requirements, where you can and can't ride, smoke, build, or sell.
The law is technically public, but in practice it is almost completely inaccessible to the ordinary person it governs.
LegitLex is my attempt to fix that: to make the law something you can actually check, in plain language, for exactly where you're standing, before you find out the hard way.
What it does
LegitLex tells you what's legal right where you are.
You ask a plain question — "Can I ride an e-scooter on the sidewalk?" — and it gives you a clear verdict for your specific location:
- Allowed
- Not allowed
- Conditional
- Unknown
Each answer includes:
- Confidence score
- Plain-language explanation
- Potential penalties
- Legal citations
Every answer is grounded in real legal code, so users can see not only the answer, but the laws behind it.
Photo → Laws
Point your camera at a situation — a scooter on a sidewalk, a dog off leash, or a posted sign. The AI identifies the legally relevant details and explains the local laws that apply.
Complaint Analyzer
Paste or upload a complaint, such as a neighbor noise dispute, and LegitLex checks which legal provisions apply and whether the complaint is supported by the law.
Compare Locations
Compare how the same activity is treated in different jurisdictions. This directly addresses the problem that originally inspired the project.
Ask a Lawyer
When confidence is low, the AI does not pretend to know. Instead, it explains its uncertainty and directs users toward legal aid organizations, bar associations, or government resources.
Compliance Snapshot
Generate a timestamped record of any legal answer.
LegitLex currently supports both the United States (city, county, state, and federal law) and Korea (national statutes), and is available as an installable progressive web app.
How we built it
LegitLex uses a retrieval-augmented generation (RAG) pipeline with location as the organizing context.
Database
We collected official legal sources, including:
- U.S. city ordinances
- County codes
- State statutes
- Federal law
- Korean national statutes from law.go.kr
Every document is split into clause-level chunks, including 조, 항, and 호 structures for Korean law. This resulted in approximately 93,000 searchable legal sections.
Because no single embedding model performed well in both English and Korean, we built two separate vector collections:
- English legal collection
- Multilingual legal collection
Queries are routed according to jurisdiction.
Backend
A FastAPI server handles retrieval and generation. When a question arrives, the system:
- Embeds the query.
- Searches the appropriate collection.
- Retrieves relevant legal sections.
- Sends only those sections to the language model.
AI
Claude Haiku 4.5 generates structured responses containing:
- Verdict
- Confidence
- Penalties
- Citations
Responses are grounded strictly in retrieved legal text. The same model's vision capabilities power the image analysis feature.
Frontend
The frontend is an installable React progressive web app designed primarily for mobile devices and served through the same FastAPI backend.
Deployment
The entire application, including the vector databases, backend, and models, is containerized using Docker and deployed on a permanent public URL.
Challenges we ran into
The hardest part of the project was building the legal database.
The official Korean law API required IP registration and approval, which took multiple rounds of troubleshooting before requests succeeded.
After access was granted, the original parser only extracted article titles and silently discarded the actual legal text. Rewriting the parser to properly include clauses and subclauses became necessary.
We also discovered that our English embedding model performed poorly on Korean text, which required redesigning the system around two language-specific collections.
Deployment introduced another set of challenges.
The vector database exceeds one gigabyte, which made many hosting providers unusable. Early deployments either exceeded storage limits or spent long periods rebuilding the index.
After deployment, the application experienced memory issues that caused repeated crashes and restart loops. The final solution involved shipping a prebuilt database and allocating sufficient memory to keep the index loaded.
One of our biggest lessons was that "it works on my machine" and "it stays running on the internet" are very different milestones.
Accomplishments that we're proud of
We're proud that we built a legal AI system that people can genuinely use.
The feature we're most proud of is the ability to reason across multiple levels of law.
In the United States, LegitLex considers:
- City ordinances
- County regulations
- State statutes
- Federal law
In Korea, it analyzes national statutes.
This allows the system to determine which level of law actually governs a situation.
Every answer includes legal citations, confidence estimates, and explicit uncertainty when appropriate. When the system cannot answer confidently, it directs users toward human legal resources.
What we learned
We learned that the difficult part of legal AI is not the AI itself.
Obtaining clean, structured, citable legal text had a much greater impact on answer quality than prompt engineering.
We also learned that retrieval and grounding matter more than fluency. A convincing answer is not necessarily a correct answer.
Multilingual retrieval proved more difficult than expected, and separate pipelines ultimately performed better than a single universal approach.
Finally, we learned that deployment is an engineering problem of its own. Memory usage, storage limitations, and startup performance influenced the final product as much as the AI components.
What's next for LegitLex
LegitLex currently supports three jurisdictions:
- Irvine
- Montgomery
- Seoul
These locations serve as a proof of concept rather than the final scope of the project.
Future work includes:
- Expanding to additional cities and states
- Adding more countries and languages
- Increasing legal coverage
- Automatically updating laws when they change
- Improving jurisdiction detection
- Providing saved searches and legal alerts
The goal remains simple:
No one should receive a fine for a law they had no realistic way of knowing.
Log in or sign up for Devpost to join the conversation.