About
Legislation Assist is intended to be a demonstration of technologies often used in the AI legal tech space (e.g. Python, APIs, LLMs, SQL databases, etc).
It is essentially a proof of concept, and as such is lacking in some features that would be present in a public or commercial release version.
Legislation Assist is a GPT-4o powered legal research tool that allows lawyers to input a legal issue, and receive a list of potentially relevant legislation and brief summaries of same.
The App can help by:- Identifying statutes, regulations and by-laws that you may be unfamiliar or unaware of. This can be a great way to find relevant provisions that you may not have thought would be relevant to a legal issue, or it can help kickstart research to find pertinent caselaw.
- Accelerating the discovery of relevant legislation, compared to using Google, Westlaw, or browsing federal, state, or provincial (Canada) websites.
- Python Used by the Django backend, including to communicate with Open AI's API.
- Open AI's API (specifically GPT-4o) The LLM that powers the App's query and response functionality. This was selected because it is effective, and appears to be the most commonly used LLM for commercial purposes (e.g. CoCounsel, Spellbook, etc).
- PostgreSQLSQL database, using a model to save queries and responses. PostgreSQL was chosen over SQLite or JSON flat files due to its greater scalability (and higher likelihood of being used in large commercial projects), even though it is possibly "overkill" for the purpose of the App.
- Django Web framework that powers the App's backend, and handles aspects of the frontend (e.g. templates, handling static files).
- HTML For the App's UI.
- JavaScript Used for responsiveness for the App's UI (e.g. Fetch API, dropdown menus, etc).
- CSS Used to style the App's UI.
- SQL While Django's Object-Relational Mapping ('ORM') is used instead of raw SQL queries (due to benefits like speed of development, and built in SQL injection protection), SQL queries were used for basic things like initial database and user creation.
- Heroku Platform used to host the web app and the PostgreSQL database.
The App is intended to be used by legal professionals to find legislation for legal issues they may be unfamiliar with, or legal issues that may involve many pieces of legislation. Municipal lawyers and general civil litigation lawyers may find the App to be particularly helpful given the wide variety of legislation relevant to those practice areas.
Those looking for repealed legislation (e.g. to assist with interpretation of in force statutes, or for academic purposes) may also find the App helpful. However caution should be exercised to ascertain that the repealed legislation cited by the App, exists. Additionally, names used for repealed legislation appear to be more likely to be inaccurate than names for in force legislation.
Enter your legal issue, the applicable jurisdiction(s), and submit your query.
The App will then provide you with a formatted list of legislation, brief summaries and explanations of the legislation's relevance to your legal issue.
GPT-4o is well suited to the scope of the App, as the App's purpose is mostly discovery of a finite, relatively limited range of sources (i.e. legislation) that does not frequently change (e.g. does not change on a daily basis). Additionally, the legislation itself can be relatively easily summarized.
The most significant limitation with the use of GPT-4o in this context is the potential for it to inaccurately analyze the prompt and, or not provide all of the relevant legislation. For that reason I have configured the App via the API's temperature setting, setting it a little above 0 (0.2), while also adding to the instructions in the API call a request for a significant amount of legislation.
This added inclusivity may at times provide legislation that is not relevant, but this is considered preferable to omitting legislation that may be relevant and that would have otherwise been excluded with a different temperature or instruction in the API call.
The risk to including irrelevant legislation is considered fairly low, given that a legal professional will generally examine the legislation themselves to find relevant provisions, through the course of which they will be able to determine if the legislation is relevant.
LLMs are also well suited for this type of task because legal research of this kind does not require inputting sensitive client data to obtain an accurate result. In fact, a lawyer would generally not even have to make an effort to avoid inputting sensitive information, because it is typically irrelevant for this kind of research. This eases what is one of the primary concerns (i.e. confidentiality) of lawyers and law firms at this time.