Inspiration
I was inspired to build this app for two reasons. First reason, there is a sharp increase in unemployment in Ontario, Canada. Second, there is a show on a radio station called CP24. The show is called "Ask a lawyer". It mostly centers around labor and employment law. It usually runs for about 30 minutes with 3-5 callers and 2-3 interview questions. I wanted to combine both in a cohesive manner. This is where onllaw was born. A tool that will help all Ontarians especially workers, better understand their labour rights. Also wanted to provide them the ability to ask similar questions at their own time.
What it does
onllaw is a Legal Decision Support System focused on democratizing access to employment and labour law in Ontario, Canada. It gives all Ontario workers the ability to review their employment contracts before signing. It achieves this by having the ability to scan contract information. The user also has the ability to copy a particular clause in the contract. Fdurthermore, they can also ask about their labor rights using a Q&A chatbot feature.
How we built it
The app was built using Vercel for deployment, fastAPI for the app building and Airia for AI orchestration.
Data
Labour law information was taken from the Ministry of Labour's website
App Design
The app was built using FastAPI. It is well suited for async style work which is helpful when working with LLMs. It houses the app templates and api information. It was styled using tailwind css.
AI Layer
The design was Input --> Data Source --> AI Model --> Output. I used the airia studio to build it.
Input: The input was going to be text based
Data Source: Data was taken from the Ministry of Labour and embedded into the AI model. Leveraged airia semantic search and set a high relevance threshold (85%). Kept max results at 10 with neighbourhood chunking at 2.
AI Model: For the AI model, I chose Claude Haiku 4.5. I wanted to output to be succinct but focused. Used a mix of scoured multiple Ontario labour law website and the prompt builder to build out my instructions. Kept the temperature at around 0.2 and reasoning effort balanced. Designed a unique output schema in json based on the output I needed. API information and keys were easily generated and stored secretly.
Deployment
The app was deployed on Vercel. It was a smooth process as it works seamlessly with FastAPI. I also able to embed all the airia API credentials easily.
Challenges we ran into
The main challenge was finetuning the AI model so that it gives the best output. Did a mix of research and played around with some of the settings. Looked at some labour lawyers website to get a sense of what the key instructions would be for how the LLM should reason.
What we learned
It was a fun experience adding a new tool to my toolkit for building LLM based systems.
What's next for onllaw
In terms of next steps, the scope of the app will include:
- Multilingual: Add French language and the ability to toggle between English and French
- Lawyers: Expand the scope of the lawyers directory to all of Canaada
- Data: Expand the labour laws to include all provinces and territories in Canada
Built With
- airia
- fastapi
- vercel
Log in or sign up for Devpost to join the conversation.