Made with Supabase

How It Works

LawSuite provides 2 things:

  1. A search interface for Uganda's law corpus e.g constitution, penal code.
  2. A chat interface for the information.

Search (Supabase and OpenAl Embeddings)

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 (OpenAI chat completion endpoint)

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.

Related Projects

A project by Zernonia