Inspiration

Legal professionals spend countless hours on repetitive tasks—reading messy client communications, requesting medical records, conducting legal research, and organizing evidence. We witnessed how lawyers at firms like Morgan & Morgan juggle hundreds of cases while drowning in administrative work. We asked: what if AI could handle the grunt work while lawyers stay in control? Inspired by this challenge, we built Lawgorithm - an AI-powered legal automation platform that turns chaotic inputs into polished, professional outputs in seconds.

What it does

Lawgorithm is an intelligent paralegal system that orchestrates specialist AI agents to automate law firm workflows:

Client Communication Agent - Transforms messy client messages into professional, empathetic responses Records Wrangler Agent - Generates medical records requests from case descriptions Legal Researcher Agent - Conducts automated legal research with intelligent scraping of 10.6M court opinions at 41.7 cases/second

The system features a human-in-the-loop approval workflow where lawyers review, edit, and approve AI-generated responses before they're sent via email, or voice call (powered by ChatGPT-Whisper). Tasks flow through four stages: Inbox → AI Processing → Approval Queue → Outreach Monitor.

How we built it

Hardware: AMD MI300X GPU (192GB VRAM) powering the entire AI stack

Backend (Python):

  • AMD vLLM inference server running Saul-7B legal AI model at 127 tokens/sec
  • FastAPI backend orchestrating specialist agents
  • Intelligent Legal Scraper with hyper-parallelization (20 concurrent workers) accessing CourtListener's 10.6M opinions for FREE
  • GPU-accelerated embeddings and FAISS vector search for case similarity matching
  • PostgreSQL database with Morgan & Morgan case files and Kaggle legal datasets (74GB)

Frontend (React + TypeScript):

  • React 18 with TypeScript for type safety
  • Tailwind CSS for modern, responsive design
  • Recharts for real-time performance visualization
  • React Router for seamless navigation between views

Integration:

  • Google Agent Development Kit (ADK) for multi-agent orchestration using Agent-to-Agent (A2A) protocol
  • ROCm GPU acceleration stack
  • ChatGPT-Whisper for AI-generated voice calls

Challenges we ran into

GPU Memory Management - Initially vLLM consumed 95% of our 192GB VRAM. We implemented tensor parallelism and reduced it to 60%, freeing 67GB for Whisper transcription and embeddings

Real-time Frontend Integration - Synchronizing React's polling with FastAPI's async processing required careful design of task state management

Legal AI Accuracy - Fine-tuning Saul-7B to generate professional yet empathetic responses took extensive prompt engineering and validation against real Morgan & Morgan cases

Accomplishments that we're proud of

  • Low/no cost for accessing 10.6M legal opinions by using free CourtListener API instead of expensive commercial databases
  • Self-hosted AI - all data stays on AMD infrastructure, addressing law firms' privacy concerns
  • Production-ready system - complete with error handling, logging, monitoring, and comprehensive documentation
  • Real lawyer validation - tested with actual Morgan & Morgan case files
  • Multi-modal outreach - email, and AI voice calls in one platform

What we learned

  • AMD MI300X is a beast - 192GB VRAM enables running multiple large models simultaneously
  • Legal AI requires specialized models - Saul-7B's legal training made a massive difference in output quality compared to generic LLMs
  • Human-in-the-loop is essential - lawyers want AI assistance, not AI replacement. The approval workflow is critical

What's next for Lawgorithm

RAG Integration - Deploy ChromaDB with FAISS indexing for context-aware responses using historical case knowledge Multi-case Intelligence - Enable agents to learn from similar cases and provide settlement guidance Automated Scheduling - Add calendar integration for automatic appointment booking Mobile App - Native iOS/Android apps for lawyers on the go Expanded Agent Network - Add Discovery Agent (document review), Settlement Agent (negotiation assistance), and Court Filing Agent (automated e-filing)

Built With

Share this project:

Updates