LawSuite provides 2 things:
Search was created with OpenAI Embeddings (text-embedding-ada-002
).
First, we scrape our Law Vault which has our laws and generate embeddings for each chunk of text.
The embeddings are then stored in our supabase database where they'll be used to answer questions
Then in our app we take the user's search query, generate an embedding, and use the result to find the most similar passages from our database.
The comparison is done using cosine similarity across our database of vectors.
Our database is a Postgres database with the pgvector extension hosted on Supabase.
Results are ranked by similarity score and returned to the user.
Chat builds on top of search. It uses search results to create a prompt that is fed into GPT-3.
This allows for a chat-like experience where the user can ask questions about the law of their country and get answers.