Inspiration
Legal problems rarely arrive in a format that software expects.
A tenant does not usually begin with a perfectly structured list of facts such as:
- move-out date
- deposit amount
- amount returned
- deductions
- notice type
- deadline
- dates of repair requests
- supporting documentation
They begin with a story.
They might write several paragraphs explaining what happened, mention dates out of order, leave out a detail that turns out to matter, or simply not know which facts are legally important.
That creates a difficult gap between what a person knows happened and what a legal-information system needs to evaluate the situation.
RightsPath was built around that gap.
The goal was not to build another general-purpose "AI lawyer" that gives a confident answer to a legal question. That approach creates a dangerous illusion of certainty, especially when the user's information is incomplete.
Instead, we wanted to build a system that could take a messy tenant story and turn it into something structured, transparent, and actionable.
The central question became:
Can we help a renter understand what their story contains, what it does not contain, which verified rules are relevant, and what they can practically do next without pretending that an AI model is the legal authority?
That question shaped the entire architecture of RightsPath.
We intentionally narrowed the initial scope to California residential tenancy and three concrete issue types:
- Security deposit disputes
- Repair neglect
- Eviction notices
The narrow scope is deliberate. Rather than pretending to cover every possible legal problem, RightsPath focuses on a defined set of tenant situations where the system can provide a controlled and understandable workflow.
What it does
RightsPath turns a renter's ordinary-language story into a structured case and a practical next step.
The workflow is:
TENANT STORY → STRUCTURED FACTS → MISSING-FACT DETECTION → VERIFIED LEGAL RULE → DETERMINISTIC CHECK → PLAIN-LANGUAGE EXPLANATION → ACTION PLAN → LETTER → PDF
A renter begins by describing what happened in their own words.
RightsPath then extracts the facts that can actually be supported by that story.
For example, in a security-deposit case, the system can work with structured information such as:
- move-out date
- security deposit amount
- amount returned
- deductions
- return date
- whether an itemized statement was received
- information relevant to the reason for deductions
The important part is that RightsPath does not treat missing information as permission to guess.
If a required fact is unavailable, the system explicitly identifies it.
That creates three important states in the product:
- READY — enough information is available for the relevant evaluation.
- NEEDS_INFORMATION — an important fact is missing and should be clarified before reaching a stronger conclusion.
- ESCALATE — the situation requires additional caution or professional/legal assistance rather than an unsupported automated conclusion.
This makes uncertainty part of the product instead of hiding it.
RightsPath then connects the structured case to verified California legal information.
The AI is not treated as the legal authority.
Instead:
- AI helps interpret and structure the renter's story.
- Verified legal rules provide the legal basis.
- Deterministic logic handles structured calculations and rule conditions where appropriate.
- The interface explains what is known, what is unknown, and what the user can do next.
The result is more than an explanation.
RightsPath produces a practical action plan and a personalized action letter based on the information the renter provided. The letter can then be downloaded as a PDF.
The intended outcome is simple:
A renter should leave RightsPath knowing what happened in their case, what information is still missing, what source supports the relevant rule, and what practical step comes next.
How we built it
RightsPath is built as a full-stack Next.js application using TypeScript and Tailwind CSS.
The core stack includes:
- Next.js
- TypeScript
- Tailwind CSS
- OpenAI API
- Zod
- Lucide React
- Framer Motion
- pdf-lib
- Vercel
- GitHub
The architecture separates interpretation from evaluation.
At a high level, the system can be understood as several layers.
1. Intake layer
The renter provides a natural-language description of their situation.
The interface is intentionally human-first. The renter does not need to know the correct legal terminology before starting.
2. AI interpretation layer
The OpenAI API is used to interpret the user's narrative and organize relevant information into structured facts.
The model's role is deliberately constrained.
It helps answer:
"What facts did the user actually provide?"
It is not treated as answering:
"What is the law?"
That distinction is fundamental to RightsPath.
3. Validation layer
Structured case data is validated using explicit schemas.
This prevents the rest of the system from blindly consuming arbitrary model output.
The application maintains structured case information including the jurisdiction, issue type, extracted facts, missing facts, matched rules, and case status.
4. Rule layer
California-specific legal rules are represented separately from the language-model interpretation layer.
This allows the system to reason about a defined legal scope rather than asking an LLM to invent or infer legal rules from scratch.
5. Deterministic evaluation
Where the problem can be represented through structured conditions or calculations, RightsPath uses deterministic application logic.
For example, structured dates and monetary amounts can be compared programmatically rather than relying on an LLM to perform the calculation.
This creates a deliberate division of responsibility:
AI interprets.
Verified rules provide authority.
Deterministic logic evaluates structured conditions.
6. Explanation layer
The system translates the structured result into plain language.
The objective is not to overwhelm a renter with legal terminology.
Instead, the interface makes the reasoning visible:
What we understood → What we still need → What the relevant source says → What you can do next
7. Action-plan layer
The result is transformed into practical next steps.
This is an important product decision because the system should not stop at:
"Here is some legal information."
It should help the user understand how to move from information to action.
8. Letter-generation layer
RightsPath uses the structured case information to generate a personalized action letter.
The letter is based on the user's provided facts rather than invented details.
9. PDF generation
The final letter can be generated as a downloadable PDF using pdf-lib.
This turns the output from something that exists only inside a chatbot-style interface into a tangible artifact that the user can take with them.
Safety and legal boundaries
Legal information requires a different standard from ordinary conversational AI.
A system can be technically impressive and still be unsafe if it confidently fills gaps in the user's story or presents an uncertain conclusion as established law.
RightsPath was designed around the opposite principle:
When the system does not know, it should say that it does not know.
The application is intentionally not designed to tell a renter that they have definitively "won," that an eviction is automatically illegal, or that they should take a consequential legal action without sufficient support.
Instead, RightsPath identifies:
- what the renter actually told it
- what information is missing
- which rule is relevant
- what the available facts can support
- what remains uncertain
- what practical next step makes sense within the product's scope
The system also includes an explicit informational/legal disclaimer.
This is why missing-information handling is not merely a UX feature. It is part of the safety architecture.
Challenges we ran into
The biggest challenge: preventing confident guesses
The easiest way to build a legal AI demo would have been to send the user's story to an LLM and display the response.
That would also have undermined one of the most important goals of the project.
A renter may omit a date, misunderstand a notice, leave out a document, or describe a situation without realizing that a particular fact matters.
If the system simply fills in the gap, the resulting answer can sound convincing while being unsupported.
We therefore had to design the application around explicit missing-information detection.
Separating interpretation from authority
Another challenge was deciding what the AI should actually be responsible for.
The solution was to separate:
language interpretation
from
legal rule evaluation
This required building structured data and rule logic around the model rather than allowing the model to control the entire decision.
Keeping different screens consistent
A case can appear in multiple places in the application:
- analysis
- case review
- rights
- action plan
- letter
A change in one representation should not silently contradict another.
Testing therefore had to cover not only individual functions but also behavior across the complete workflow.
Handling incomplete and ambiguous cases
Real users do not provide perfect inputs.
RightsPath had to distinguish between:
- information that is known
- information that is unknown
- information that is ambiguous
- information that should not be inferred
This became particularly important for security-deposit cases where multiple deduction categories can be stated without enough information to determine which specific legal condition applies.
Rather than forcing a classification, RightsPath can surface that additional information is needed.
Turning the result into something useful
Another challenge was avoiding the "interesting demo, useless product" problem.
A legal explanation alone is not necessarily actionable.
That is why the workflow continues into an action plan and personalized letter.
The system is designed to produce something a renter can actually use after the analysis is complete.
Accomplishments we're proud of
The biggest accomplishment is that RightsPath became a complete end-to-end workflow rather than a collection of disconnected AI features.
A renter can move from:
messy story
to
structured facts
to
missing-information detection
to
verified legal source
to
rule evaluation
to
plain-language explanation
to
action plan
to
personalized letter
to
downloadable PDF
within the same product.
We are also particularly proud of the testing discipline behind the prototype.
The current test suite contains:
234 passing tests across 9 suites.
Testing covers areas including:
- intake behavior
- structured fact extraction
- missing-fact detection
- case analysis
- case review
- rule evaluation
- security-deposit rules
- date calculations
- derived calculations
- adversarial cases
- action-plan generation
- letter generation
- PDF generation
- cross-surface consistency
- safety behavior around unsupported conclusions
The project was also tested using a realistic California security-deposit scenario rather than relying only on idealized demo inputs.
That scenario exercises the system's ability to extract monetary amounts and dates, recognize that an itemized statement was not received, identify unresolved information, evaluate the case without inventing facts, and continue through the action-plan and letter workflow.
What we learned
The biggest lesson was that building an AI system is not primarily about making the model say more.
Sometimes the better system is the one that knows when not to say more.
For RightsPath, this meant treating uncertainty as a first-class product state.
We learned that an LLM is particularly useful for understanding messy human language, but that does not mean it should automatically become the authority for every downstream decision.
That led to a much clearer architecture:
AI interprets the story.
Structured data represents the case.
Verified rules provide the legal basis.
Deterministic logic handles structured evaluation.
The interface explains the result and its uncertainty.
We also learned that the final artifact matters.
A renter may understand an explanation and still have no idea what to do next.
An action plan and personalized letter make the system substantially more useful because they bridge the gap between understanding a problem and taking a practical next step.
Finally, we learned the value of deliberately narrowing scope.
RightsPath currently focuses on California residential tenancy and three issue categories rather than pretending to solve every legal problem.
For a legal-information product, controlled scope is a feature, not a weakness.
Why RightsPath is different
RightsPath is not designed as a general-purpose legal chatbot.
The distinction is the workflow.
A conventional chatbot interaction might look like:
Question → AI answer
RightsPath is designed as:
Story → Facts → Missing information → Verified rule → Evaluation → Explanation → Action plan → Letter
That difference affects both the user experience and the technical architecture.
The system is designed so that the user can inspect the reasoning path rather than simply receiving a final AI-generated paragraph.
This makes RightsPath particularly focused on the question:
"What comes next?"
rather than simply:
"What does the law say?"
What's next for RightsPath
The current prototype intentionally focuses on a narrow California scope.
Future development could expand the system carefully into additional tenant-rights scenarios and additional jurisdictions, but only where the underlying rules and sources can be represented with the same level of control.
Potential future directions include:
- additional California tenant-rights issue types
- broader document and notice analysis
- stronger evidence/document intake
- additional verified legal-source coverage
- expanded jurisdiction support
- improved accessibility
- deeper escalation pathways to appropriate legal or community resources
- more structured support for tracking a user's next steps
The guiding principle would remain the same:
Expand the system's coverage without sacrificing transparency, source grounding, or uncertainty handling.
RightsPath is intentionally not trying to make legal decisions for people.
It is trying to make the path from "Something happened to me" to "I understand what I know, what I don't know, where the information comes from, and what I can do next" much clearer.
That is the problem we set out to solve.
Built With
- framermotion
- lucide
- next.js
- openai
- pdf-lip
- tailwindcss
- typescript
- vercel
- zod
Log in or sign up for Devpost to join the conversation.