Website URL: https://plainspeakai.onrender.com/
Legal contracts are often written in complex jargon, making them difficult for non-lawyers to understand. Our project simplifies this process by providing an AI-powered platform that:
-
Uploads and analyzes legal documents
-
Simplifies clauses into easy-to-read language
-
Generates a timeline of key contract dates and obligations
-
Scans for risks using predefined rules and contextual AI detection, then visualizes them in a risk radar (spider chart)
-
Allows quick Q&A so users can ask questions about the contract in plain English
This tool is designed to empower individuals and businesses by making legal documents more transparent, accessible, and less intimidating.
Client: HTML, CSS, JavaScript
Server: Python, FastAPI, Uvicorn
POST /api/upload| Parameter | Type | Description |
|---|---|---|
file |
file |
Required. contract document file |
Response (JSON): { "filename": "contract.pdf", "full_text": "This Agreement is made on..." }
POST /api/rewrite| Body Field | Type | Description |
|---|---|---|
text |
string |
Required. "advanced" for legally literate |
mode |
string |
Required. "layman" for simplified mode |
Response (JSON): { "rewritten_text": "This contract means..." }
POST /api/map| Body Field | Type | Description |
|---|---|---|
contract_text |
string |
Required. Full contract text |
Response (JSON): { "timeline": [ { "date_description": "Start Date", "event": "Agreement begins on Jan 1, 2025" }, { "date_description": "End Date", "event": "Contract ends on Dec 31, 2025" } ] }
POST /api/risk/scan| Body Field | Type | Description |
|---|---|---|
text |
string |
Required. Full contract text |
Response (JSON): { "flagged_clauses": [ { "clause": "The tenant shall indemnify the landlord...", "keyword_flags": [ { "term": "indemnify", "predefined_explanation": "Potential liability concern" } ], "contextual_flags": [ { "term": "penalty", "explanation": "May indicate financial risk" } ] } ], "risk_summary": "2 high-risk terms detected: 1 keyword-based, 1 contextual." }
POST /api/ask| Body Field | Type | Description |
|---|---|---|
contract_text |
string |
Required. Full contract text |
question |
string |
Required. Question to ask about contract |
Response (JSON): { "answer": "The contract can be terminated with 30 days' notice." }
To run this project, you will need to add the following environment variables to your .env file
OPEN_API_KEY
Clone the project
git clone https://github.com/kavvyaaaa/LegalDemystifier.gitGo to the project directory
cd LegalDemystifierBackend Setup
- Create and activate a virtual environment(recommended):
python -m venv venv
source venv\Scripts\activate # On WindowsInstall dependencies
pip install -r requirements.txtStart the server
uvicorn app.main:app --reloadThe backend will run at: http://127.0.0.1:8000
Frontend Setup
- Open index.html directly in your browser, or use a simple local server:
npx serve .Frontend will be available at:http://localhost:3000 (if using server)