Skip to content

kevanwee/tortrat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€ Tort Rat

Tort Rat is a CLI-based Discord chatbot developed as a side project for SMU's LAW105: Law of Torts course. It leverages Retrieval-Augmented Generation (RAG) to answer questions about key tort law cases and concepts. Trained on a curated set of case summaries, Tort Rat can:

image

  • πŸ“– Explain legal doctrines and tests;
  • βš–οΈ Address basic hypothetical questions; and
  • 🧠 Provide concise answers to enhance legal understanding.

πŸ›  Technical Details

  • Built using PostgresML and Python

πŸš€ Setup

pip install pgml-chat
python -m venv {file_path}

Clone the .env and ingest folder from the repository:

git clone https://github.com/kevanwee/tortrat.git

Edit the .env file and add the OpenAI API key, PostgresML database link, and Discord bot token:

OPENAI_API_KEY=<>
DATABASE_URL=<>
DISCORD_BOT_TOKEN=<>

πŸ“₯ Data Ingestion

To ingest data, run:

LOG_LEVEL=DEBUG pgml-chat --root_dir ingest --collection_name tort --stage {file_path/ingest}

πŸ€– Running the Bot

To start the Discord bot, use:

LOG_LEVEL=ERROR pgml-chat --collection_name tort --chat_completion_model gpt-3.5-turbo --stage chat --chat_interface discord