Skip to content

RTS-Technology-Solutions/mock-trial-simulator

Repository files navigation

Legal Mock Trial Simulator

Application Purpose

The Legal Mock Trial Simulator is an AI-powered web application designed to assist legal professionals, including attorneys and paralegals, in preparing for trials. It analyzes uploaded PDF case documents and evidence to generate potential arguments, counter-arguments, and rebuttals. The goal is to provide a creative starting point for users to enhance their case strategies and defenses, leveraging modern AI tools in a simple, professional interface.

Key Features

  • PDF Document Intake: Users can upload multiple PDF legal case documents and evidence files. The application extracts text from these documents for analysis.
  • AI-Powered Argument Generation: Based on the ingested documents and user settings, the AI generates comprehensive arguments for relevant legal counts or claims. This includes:
    • The initiating party's argument.
    • The opposing party's potential counter-argument.
    • A potential rebuttal from the initiating party.
  • Role Selection: Users can specify whether they represent the "Plaintiff" or "Defendant," tailoring the AI's output.
  • Access Key Authentication: Secure access using pre-defined Access Keys, restricting application usage to authorized individuals.
  • Fine-Tuning Settings: Intuitive options to refine AI output:
    • Argument Depth: (Basic, Intermediate, Advanced)
    • Focus Areas: Prioritize specific legal claims (e.g., Breach of Contract, Negligence).
    • Argumentative Tone: (Aggressive, Conservative, Balanced)
    • Citation Request: Option for AI to attempt citing document sections.
  • Usage Management: Client-side daily simulation limits to manage potential AI API costs, with notifications and options to request increases.
  • User Support: In-app help request system and a user guide.
  • Legal Disclaimer: Users must acknowledge the AI-generated nature of the content and its limitations.
  • Professional UI/UX: Designed to be extremely simple, stylish, sleek, minimalist, and professional for ease of use by legal professionals.

Technology Stack

  • Frontend: React (TypeScript, Vite/ESM setup), Tailwind CSS
  • AI Integration: Google Gemini API (@google/genai SDK) for argument generation.
  • PDF Processing: pdf.js for client-side text extraction from PDF files.
  • Deployment Target: Google Cloud Run (as a static site or containerized application).

How it was Built

The application is a single-page application (SPA) built with React and TypeScript. State management is handled within React components using hooks (useState, useEffect, useCallback).

  1. Authentication: Users enter an Access Key. This key is validated against a predefined list.
  2. File Upload: PDF files are selected, and pdf.js extracts their text content in the browser.
  3. Settings Configuration: Users adjust parameters like their role, desired argument depth, tone, etc.
  4. AI Prompt Construction: A detailed prompt is constructed for the Gemini API, incorporating the extracted PDF text, user settings, and specific instructions for the desired output format (arguments, counter-arguments, rebuttals per claim).
  5. Gemini API Call: The generateContent method of the Gemini API is called with the constructed prompt.
  6. Results Display: The AI's textual response is parsed and displayed in a structured, readable format.
  7. Client-Side Features: Disclaimer acceptance, daily usage limits, and help requests are managed client-side using localStorage and mailto: links, respectively.

Disclaimer

This application is for demonstration and mock trial preparation purposes only. AI-generated content can be inaccurate or incomplete and should always be verified by qualified legal professionals. It is not a substitute for professional legal advice.

About

An locally powered AI web application designed to assist legal professionals, including attorneys, paralegals and students, in preparing better arguments for trials.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors