Skip to content

LegalDocs AI: An AI-powered legal intelligence platform that transforms complex court cases and contracts into clear, verifiable summaries with grounded source references. Built with FastAPI, React, and LangChain.

Notifications You must be signed in to change notification settings

prakritea/LegalDocs-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LegalDocs AI

Hero Banner

LegalDocs AI is a professional-grade legal intelligence platform that transforms complex court cases, contracts, and statutes into clear, actionable summaries in seconds. Built for speed and reliability, it uses a RAM-Lite Architecture to deliver high-performance legal analysis even on resource-constrained hosting environments.


🚀 Key Features

  • Instant Legal Analysis: Process complex PDFs using state-of-the-art models via OpenRouter.
  • 🔍 Verifiable Sources: Every claim in the summary is grounded with inline citations and transparent page references.
  • 💾 Permanent Persistence: Full accounts and document history managed via PostgreSQL (Neon).
  • ⚡ RAM-Lite Optimization: Custom "Stuffing" RAG logic designed to run efficiently on 512MB RAM environments like Render.
  • 🛡️ Secure Auth: JWT-protected dashboard with organizational data isolation.
  • 📄 Multi-format Exports: Download analysis reports in PDF, DOC, or TXT formats.

🛠️ Tech Stack

Layer Tools / Frameworks
Frontend React 18, TypeScript, Vite, TailwindCSS, Shadcn/UI
Backend FastAPI, Python 3.10+, SQLAlchemy, Pydantic
Database PostgreSQL (Production via Neon), SQLite (Local Dev)
LLMs Arcee-ai Trinity Large (via OpenRouter)
Deployment Netlify (Frontend), Render (Backend)

📁 Project Structure

LegalDocs-AI/
├── backend/
│   ├── main.py              # FastAPI Entry Point
│   ├── summarizer.py        # persistence & History Logic
│   ├── model_pipeline.py    # RAM-Lite AI Core (Stuffing RAG)
│   ├── auth.py              # JWT Authentication
│   ├── models.py            # Database Schema (Postgres/SQLite)
│   └── requirements.txt     # Optimized Dependency List
│
├── client/
│   ├── App.tsx              # Main Router
│   ├── global.css           # Design System & Animations
│   ├── components/          # Reusable UI Blocks (Shadcn)
│   ├── pages/               # Dashboard, SignIn, Features
│   └── lib/                 # Utility functions
│
└── render.yaml              # Infrastructure as Code (Blueprint)

🚦 Getting Started

1. Prerequisites

  • Python 3.10+
  • Node.js 18+
  • OpenRouter API Key

2. Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Set DATABASE_URL in .env (defaults to local sqlite)
uvicorn main:app --reload

3. Frontend Setup

npm install
npm run dev

⚙️ Configuration

Create a .env file in the root directory:

# OpenRouter API
OPENROUTER_API_KEY=your_key_here
OPENROUTER_MODEL=arcee-ai/trinity-large-preview:free

# Database
DATABASE_URL=postgresql://user:pass@host/dbname

# JWT Security
SECRET_KEY=your_random_secret
ALGORITHM=HS256

📜 License & Credits

Developed by @prakritea.
Special thanks to OpenRouter and the FastAPI community.

LegalDocs AI — Grounded Legal Intelligence at Scale. your fingertips.*

About

LegalDocs AI: An AI-powered legal intelligence platform that transforms complex court cases and contracts into clear, verifiable summaries with grounded source references. Built with FastAPI, React, and LangChain.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published