LegallyWise created by ...
Team BBY-31
- Abhishek (Ash) Chouhan
- Gurtej Malik
- Amrit Jhatu
- Armaan Pruthi
"Our team is developing an AI-powered online law app to help individuals, small businesses, and students navigate legal issues quickly and easily with personalized results and an ever-improving database of laws and policies."
Frontend: HTML CSS Bootstrap v5.3.x/ v 5.1.3
Backend: JavaScript Node v19.3.0 Python llama_index v0.6.8 langchain v0.0.172
Database: Mongodb v6.0.5
.
βββ node_modules
β βββ @hapi
β β βββ hoek
β β β βββ lib
β β βββ topo
β β βββ lib
β βββ @mapbox
β β βββ node-pre-gyp
β β βββ bin
β β βββ lib
β β β βββ util
β β β βββ nw-pre-gyp
β β βββ node_modules
β β βββ node-fetch
β β β βββ lib
β β βββ tr46
β β β βββ lib
β β βββ webidl-conversions
β β β βββ lib
β β βββ whatwg-url
β β βββ lib
β βββ @sideway
β β βββ address
β β β βββ lib
β β βββ formula
β β β βββ lib
β β βββ pinpoint
β β βββ lib
β βββ @types
β β βββ node
β β β βββ assert
β β β βββ dns
β β β βββ fs
β β β βββ readline
β β β βββ stream
β β β βββ timers
β β β βββ ts4.8
β β β βββ assert
β β β βββ dns
β β β βββ fs
β β β βββ readline
β β β βββ stream
β β β βββ timers
β β βββ webidl-conversions
β β βββ whatwg-url
β β βββ dist
β βββ abbrev
β βββ accepts
β βββ agent-base
β β βββ dist
β β β βββ src
β β βββ src
β βββ ansi-colors
β β βββ types
β βββ ansi-regex
β βββ ansi-styles
β βββ anymatch
β βββ aproba
β βββ are-we-there-yet
β β βββ lib
β βββ array-flatten
β βββ asn1.js
β β βββ lib
β β βββ asn1
β β βββ base
β β βββ constants
β β βββ decoders
β β βββ encoders
β βββ async
β β βββ dist
β β βββ internal
β βββ asynckit
β β βββ lib
β βββ axios
β β βββ dist
β β βββ lib
β β βββ adapters
β β βββ cancel
β β βββ core
β β βββ defaults
β β βββ env
β β βββ helpers
β βββ balanced-match
β βββ bcrypt
β β βββ examples
β β βββ lib
β β β βββ binding
β β β βββ napi-v3
β β βββ src
β β βββ test
β βββ binary-extensions
β βββ biskviit
β β βββ lib
β β βββ test
β βββ bn.js
β β βββ lib
β βββ body-parser
β β βββ lib
β β β βββ types
β β βββ node_modules
β β βββ debug
β β β βββ src
β β βββ ms
β βββ boolbase
β βββ brace-expansion
β βββ braces
β β βββ lib
β βββ bson
β β βββ etc
β β βββ lib
β β βββ src
β β βββ parser
β β βββ utils
β βββ buffer-equal-constant-time
β βββ bytes
β βββ call-bind
β β βββ test
β βββ chalk
β β βββ source
β βββ cheerio
β β βββ lib
β β βββ api
β β βββ parsers
β βββ cheerio-select
β β βββ lib
β βββ chokidar
β β βββ lib
β β βββ types
β βββ chownr
β βββ color-convert
β βββ color-name
β βββ color-support
β βββ combined-stream
β β βββ lib
β βββ commander
β β βββ typings
β βββ concat-map
β β βββ example
β β βββ test
β βββ connect-mongo
β β βββ build
β β βββ main
β β βββ lib
β βββ console-control-strings
β βββ content-disposition
β βββ content-type
β βββ cookie
β βββ cookie-signature
β βββ css-select
β β βββ lib
β β βββ pseudo-selectors
β βββ css-what
β β βββ lib
β β βββ commonjs
β β βββ es
β βββ data-uri-to-buffer
β β βββ dist
β β βββ src
β βββ date-format
β β βββ lib
β βββ debug
β β βββ src
β βββ delayed-stream
β β βββ lib
β βββ delegates
β β βββ test
β βββ depd
β β βββ lib
β β βββ browser
β βββ destroy
β βββ detect-libc
β β βββ lib
β βββ dom-serializer
β β βββ lib
β β βββ esm
β βββ domelementtype
β β βββ lib
β β βββ esm
β βββ domhandler
β β βββ lib
β βββ domutils
β β βββ lib
β βββ dotenv
β β βββ lib
β βββ ecdsa-sig-formatter
β β βββ src
β βββ ee-first
β βββ ejs
β β βββ bin
β β βββ lib
β βββ emoji-regex
β β βββ es2015
β βββ encodeurl
β βββ encoding
β β βββ lib
β β βββ test
β βββ entities
β β βββ lib
β β βββ maps
β βββ escape-goat
β βββ escape-html
β βββ etag
β βββ express
β β βββ lib
β β β βββ middleware
β β β βββ router
β β βββ node_modules
β β βββ debug
β β β βββ src
β β βββ ms
β βββ express-session
β β βββ node_modules
β β β βββ cookie
β β β βββ debug
β β β β βββ src
β β β βββ ms
β β βββ session
β βββ fetch
β β βββ example
β β βββ lib
β β βββ test
β βββ fetch-blob
β βββ filelist
β β βββ node_modules
β β βββ brace-expansion
β β βββ minimatch
β β βββ lib
β βββ fill-range
β βββ finalhandler
β β βββ node_modules
β β βββ debug
β β β βββ src
β β βββ ms
β βββ flatted
β β βββ cjs
β β βββ esm
β β βββ php
β βββ follow-redirects
β βββ form-data
β β βββ lib
β βββ formdata-polyfill
β βββ forwarded
β βββ fresh
β βββ fs
β βββ fs-extra
β β βββ lib
β β βββ copy
β β βββ copy-sync
β β βββ empty
β β βββ ensure
β β βββ fs
β β βββ json
β β βββ mkdirs
β β βββ move
β β βββ move-sync
β β βββ output
β β βββ path-exists
β β βββ remove
β β βββ util
β βββ fs-minipass
β β βββ node_modules
β β βββ minipass
β βββ fs.realpath
β βββ fsevents
β βββ function-bind
β β βββ test
β βββ gauge
β βββ generic-pool
β β βββ lib
β βββ get-intrinsic
β β βββ test
β βββ glob
β βββ glob-parent
β βββ graceful-fs
β βββ growly
β β βββ example
β β βββ lib
β βββ has
β β βββ src
β β βββ test
β βββ has-flag
β βββ has-symbols
β β βββ test
β β βββ shams
β βββ has-unicode
β βββ he
β β βββ bin
β β βββ man
β βββ htmlparser2
β β βββ lib
β βββ http-errors
β βββ https-proxy-agent
β β βββ dist
β βββ iconv-lite
β β βββ encodings
β β β βββ tables
β β βββ lib
β βββ ignore-by-default
β βββ inflight
β βββ inherits
β βββ ip
β β βββ lib
β βββ ipaddr.js
β β βββ lib
β βββ is-binary-path
β βββ is-docker
β βββ is-extglob
β βββ is-fullwidth-code-point
β βββ is-glob
β βββ is-number
β βββ is-wsl
β βββ isexe
β β βββ test
β βββ jake
β β βββ bin
β β βββ lib
β β β βββ task
β β β βββ utils
β β βββ test
β β βββ integration
β β β βββ jakelib
β β βββ unit
β βββ joi
β β βββ dist
β β βββ lib
β β βββ types
β βββ jsonfile
β βββ jsonwebtoken
β β βββ lib
β βββ juice
β β βββ bin
β β βββ lib
β βββ jwa
β βββ jws
β β βββ lib
β βββ kruptein
β β βββ lib
β βββ lodash
β β βββ fp
β βββ log4js
β β βββ lib
β β β βββ appenders
β β βββ types
β βββ lru-cache
β βββ mailgen
β β βββ examples
β β βββ screenshots
β β β βββ cerberus
β β β βββ default
β β β βββ neopolitan
β β β βββ salted
β β βββ themes
β β βββ cerberus
β β βββ default
β β βββ neopolitan
β β βββ salted
β βββ make-dir
β β βββ node_modules
β β βββ semver
β β βββ bin
β βββ media-typer
β βββ memory-pager
β βββ mensch
β β βββ lib
β βββ merge-descriptors
β βββ methods
β βββ mime
β β βββ src
β βββ mime-db
β βββ mime-types
β βββ minimalistic-assert
β βββ minimatch
β βββ minipass
β βββ minizlib
β β βββ node_modules
β β βββ minipass
β βββ mkdirp
β β βββ bin
β β βββ lib
β βββ mongo-connect
β β βββ lib
β β βββ test
β βββ mongodb
β β βββ etc
β β βββ lib
β β β βββ bulk
β β β βββ cmap
β β β β βββ auth
β β β β β βββ mongodb_oidc
β β β β βββ handshake
β β β β βββ wire_protocol
β β β βββ cursor
β β β βββ gridfs
β β β βββ operations
β β β βββ sdam
β β βββ src
β β βββ bulk
β β βββ cmap
β β β βββ auth
β β β β βββ mongodb_oidc
β β β βββ handshake
β β β βββ wire_protocol
β β βββ cursor
β β βββ gridfs
β β βββ operations
β β βββ sdam
β βββ mongodb-connection-string-url
β β βββ lib
β βββ ms
β βββ negotiator
β β βββ lib
β βββ node-addon-api
β β βββ tools
β βββ node-domexception
β βββ node-fetch
β β βββ @types
β β βββ src
β β βββ errors
β β βββ utils
β βββ node-notifier
β β βββ lib
β β βββ notifiers
β β βββ vendor
β β βββ mac.noindex
β β β βββ terminal-notifier.app
β β β βββ Contents
β β β βββ MacOS
β β β βββ Resources
β β β βββ en.lproj
β β βββ notifu
β β βββ snoreToast
β βββ nodemailer
β β βββ lib
β β βββ addressparser
β β βββ base64
β β βββ dkim
β β βββ fetch
β β βββ json-transport
β β βββ mail-composer
β β βββ mailer
β β βββ mime-funcs
β β βββ mime-node
β β βββ qp
β β βββ sendmail-transport
β β βββ ses-transport
β β βββ shared
β β βββ smtp-connection
β β βββ smtp-pool
β β βββ smtp-transport
β β βββ stream-transport
β β βββ well-known
β β βββ xoauth2
β βββ nodemon
β β βββ bin
β β βββ doc
β β β βββ cli
β β βββ lib
β β β βββ cli
β β β βββ config
β β β βββ help
β β β βββ monitor
β β β βββ rules
β β β βββ utils
β β βββ node_modules
β β βββ debug
β β β βββ src
β β βββ has-flag
β β βββ semver
β β β βββ bin
β β βββ supports-color
β βββ nopt
β β βββ bin
β β βββ lib
β βββ normalize-path
β βββ npmlog
β βββ nth-check
β β βββ lib
β β βββ esm
β βββ object-assign
β βββ object-inspect
β β βββ example
β β βββ test
β β βββ browser
β βββ on-finished
β βββ on-headers
β βββ once
β βββ openai
β β βββ dist
β βββ parse5
β β βββ lib
β β βββ common
β β βββ extensions
β β β βββ error-reporting
β β β βββ location-info
β β β βββ position-tracking
β β βββ parser
β β βββ serializer
β β βββ tokenizer
β β βββ tree-adapters
β β βββ utils
β βββ parse5-htmlparser2-tree-adapter
β β βββ lib
β βββ parseurl
β βββ path-is-absolute
β βββ path-to-regexp
β βββ picomatch
β β βββ lib
β βββ proxy-addr
β βββ psl
β β βββ data
β β βββ dist
β βββ pstree.remy
β β βββ lib
β β βββ tests
β β βββ fixtures
β βββ punycode
β βββ qs
β β βββ dist
β β βββ lib
β β βββ test
β βββ random-bytes
β βββ range-parser
β βββ raw-body
β βββ readable-stream
β β βββ lib
β β βββ internal
β β βββ streams
β βββ readdirp
β βββ rfdc
β β βββ test
β βββ rimraf
β βββ safe-buffer
β βββ safer-buffer
β βββ saslprep
β β βββ lib
β β βββ test
β βββ semver
β β βββ bin
β β βββ classes
β β βββ functions
β β βββ internal
β β βββ ranges
β βββ send
β β βββ node_modules
β β βββ debug
β β β βββ node_modules
β β β β βββ ms
β β β βββ src
β β βββ ms
β βββ serve-static
β βββ set-blocking
β βββ setprototypeof
β β βββ test
β βββ shellwords
β β βββ lib
β βββ side-channel
β β βββ test
β βββ signal-exit
β βββ simple-update-notifier
β β βββ build
β β βββ node_modules
β β β βββ semver
β β β βββ bin
β β β βββ classes
β β β βββ functions
β β β βββ internal
β β β βββ ranges
β β βββ src
β βββ slick
β βββ smart-buffer
β β βββ build
β β βββ docs
β β βββ typings
β βββ socks
β β βββ build
β β β βββ client
β β β βββ common
β β βββ docs
β β β βββ examples
β β β βββ javascript
β β β βββ typescript
β β βββ typings
β β βββ client
β β βββ common
β βββ sparse-bitfield
β βββ statuses
β βββ streamroller
β β βββ lib
β βββ string-width
β βββ string_decoder
β β βββ lib
β βββ strip-ansi
β βββ supports-color
β βββ tar
β β βββ lib
β βββ to-regex-range
β βββ toidentifier
β βββ touch
β β βββ bin
β β βββ node_modules
β β βββ nopt
β β βββ bin
β β βββ examples
β β βββ lib
β βββ tr46
β β βββ lib
β βββ tslib
β β βββ modules
β βββ type-is
β βββ uid-safe
β βββ undefsafe
β β βββ lib
β βββ universalify
β βββ unpipe
β βββ util-deprecate
β βββ utils-merge
β βββ uuid
β β βββ dist
β β βββ bin
β β βββ esm-browser
β β βββ esm-node
β β βββ umd
β βββ valid-data-url
β βββ vary
β βββ web-resource-inliner
β β βββ node_modules
β β β βββ domhandler
β β β β βββ lib
β β β βββ htmlparser2
β β β β βββ lib
β β β βββ mime
β β β β βββ types
β β β βββ node-fetch
β β β β βββ lib
β β β βββ tr46
β β β β βββ lib
β β β βββ webidl-conversions
β β β β βββ lib
β β β βββ whatwg-url
β β β βββ lib
β β βββ src
β βββ web-streams-polyfill
β β βββ dist
β β β βββ types
β β β βββ ts3.6
β β βββ es2018
β β βββ es6
β β βββ ponyfill
β β βββ es2018
β β βββ es6
β βββ webidl-conversions
β β βββ lib
β βββ whatwg-url
β β βββ lib
β βββ which
β β βββ bin
β βββ wide-align
β βββ wrappy
β βββ yallist
βββ public
β βββ css
β βββ img
βββ views
βββ templates
Prerequisites Before you start, ensure you have these prerequisites installed:
Node.js & npm: You need Node.js installed to run this app. Check if you have it installed by running node -v. If not, you can download Node.js from their site.
MongoDB: This app uses MongoDB as a database. MongoDB can be found on their site.
IDE: Any text editor or IDE that supports JavaScript, HTML, and CSS will work, but we recommend Visual Studio Code. We will show instructions for VSCode now.
Create a fork of our repo
Launch VS Code and navigate to pop it open in the project directory is located.
Install Project Dependencys: Pop open the terminal in VSCode and since it is already there it should be no issue on typing out the following command to get the dependencies implemented.
npm install
Prepare environment variables: Create an .env file in the project's root directory. Add any required variables to the .env file and keep it updated with the correct keys.
Set up MongoDB and use the values in our .env file to have everything configured.
Pop open the terminal and post the following before entering to run our project.
node index.js
This will allow you to access our localhost link on any browser you have: http://localhost:3020.
Consult LegallyWise AI: Click the Consult LegallyWise AI button at the homepage or the logo located on the navbar. This will take you to a room where you can ask a question and get a response that has come from the data the AI has been trained on. You may also choose a language before you click submit to get a response in a language you feel more comfortable in or have a better understanding.
Explain your Document: This feature can be accessed on the homepage by selecting the 'Explain your Document' button. It will take you to a page that will ask you to upload a pdf file, and you can ask questions specifically after you submit the file. This will also simplify and summarize the document if a user asks it to so they can demistify the legal jargon and know what the uploaded document is about before heading into their meeting with a lawyer.
Profile: This can be accessed by clicking 'Profile' on the navbar and will take a user to a profile page where they can see the fields they had registered with.
Contact: This can be accessed by clicking 'Contact' on the navbar and will take the user to a contact page that lists some important contacts they can either send an email to or call to get more legal information.
About: This can be accessed by clicking 'About' on the navbar and will take the user to a page where the app is explained a little and some information about the team that worked on the project.
Easter Egg: When the user clicks on the 'Ask a question' button 5 or more times continuously, a GIF appears that asks user not to spam. It's a cool feature that you should try.
Password reset: In case the user forgets their password, they can click on the 'Forgot username/password' link in the login form on login page, enter their username, then answer the security question they set at the time of signing up and they will be able to set a new password. In case the user forgets their username as well, they can click on the 'Forgot username' link on the forgot password page form. Then, a custom one-time usable password reset email is sent to the user. This email contains the user's username and a link to set the new password.
OpenAI. (n.d.). OpenAI. https://openai.com/
Welcome to PyPDF2 β PyPDF2 documentation. (n.d.). Welcome to PyPDF2 &Mdash; PyPDF2 Documentation. https://pypdf2.readthedocs.io/en/3.0.0/
C. (n.d.). API_documentation/EN.md at master Β· canlii/API_documentation. GitHub. https://github.com/canlii/API_documentation
Welcome to LangChain β π¦π LangChain 0.0.181. (2023, May 26). Welcome to LangChain β π¦π LangChain 0.0.181. https://python.langchain.com/en/latest/index.html
Licenses: OpenAI Key
AI is increasingly becoming a sensation in the tech world, and more so are Natural language processing models like chatGPT by OpenAI. We realized the importance of staying up to date with the industry and decided to use a NLM model in our app. This project provided us with a deep understanding of AI technology, from staying updated with the latest models to integrating them into our application through API usage. Additionally, we explored the possibilities of training custom models to suit our specific requirements, further enhancing the capabilities of our application.
-
Utilizing API Integration: We discovered how to integrate AI models into our application using APIs. Specifically, we learned how to incorporate OpenAI's GPT model by utilizing their API. This enabled us to access the model's capabilities and generate responses based on user input, enhancing the interactive experience within our application.
-
Custom Model Training: One fascinating discovery was the ability to train our own custom model using our pre-processed dataset. We delved into the process of training the model on our specific data, which allowed us to create a model that was knowledgeable and tailored to our application's needs. By leveraging OpenAI's embedding feature, we could query the model effectively and retrieve relevant information from our dataset.
-
Data Interaction Between Servers: During the development of our application and the creation of our custom language model, we encountered a significant challenge. Our application was built in a Node.js environment, but we faced the hurdle that Python was the only supported language by OpenAI to interact with their models. Unfortunately, there was no equivalent solution available for Node.js at that time. Although we explored workarounds to run Python scripts within a Node.js environment, we encountered issues with importing modules, limiting our options to simple script imports.
To overcome this obstacle, we conducted thorough research and adopted an innovative approach. We modified the Python code to function as a standalone server, capable of responding to incoming POST requests containing questions or prompts. The Python server then returned the response text encapsulated within a JSON object. By hosting the Python and Node.js servers separately and establishing communication between them, we resolved the compatibility issue and ensured each server operated within its own environment.
This clever solution enabled us to maintain the functionality of our application while effectively utilizing the components we had developed earlier.
- Utilizing Documentation: A significant portion of our app's features were the result of extensive research and leveraging information from various sources, including the internet and the respective companies involved. We dedicated considerable time to reading documentation, conducting tests, and troubleshooting to ensure that our efforts yielded positive results. There were moments when we felt overwhelmed and unsure if we could make progress, but it's important to acknowledge that such feelings are normal. Taking breaks and returning to the task with a fresh mindset proved to be highly beneficial.
It's essential to understand that processing a vast amount of information requires time and patience before effectively applying it. It's crucial not to lose hope when initially attempting to implement new ideas or features that don't work as expected. It's a common occurrence in the development process. Most of the time, you're only a step or two away from resolving the issue. It's important not to give up and persevere through the challenges encountered.
Gurtej Malik: [email protected]
Amrit Jhatu: [email protected]
Abhishek Chouhan: [email protected]
Armaan Pruthi: [email protected]