Skip to content

Repository files navigation

Legal Intake & Triage System

AI-powered legal request intake portal that auto-classifies requests, assesses urgency, extracts key details, and routes to the right team member.

Getting Started

Option 1: Run locally (one command)

./start.sh        # macOS/Linux
start.bat         # Windows

This will install dependencies, start the API and dashboard, and open your browser. No setup required.

Option 2: Docker

docker compose up

Then open http://localhost:8501.

Optional: Add AI-powered classification

By default, the system uses keyword-based classification (no API key needed). To enable AI-powered classification with Claude:

  1. Copy .env.example to .env
  2. Add your Anthropic API key: ANTHROPIC_API_KEY=sk-ant-...
  3. Restart the application

Features

  • Smart intake form - submit legal requests with structured fields
  • Auto-classification - AI or keyword-based classification into configurable request types (contract review, NDA, procurement, regulatory, employment, general)
  • Urgency assessment - automatic priority assignment (low/medium/high/critical) with reasoning
  • Key detail extraction - pulls out counterparties, deadlines, dollar amounts, and other structured data from free text
  • Routing - configurable rules automatically assign requests to the right team member
  • Dashboard - queue depth, volume by type, average cycle times, recent requests
  • Admin panel - manage request types, team members, and routing rules through the UI

For Developers

API Documentation

With the server running, visit http://localhost:8000/docs for interactive Swagger documentation.

Project Structure

src/legal_intake/          # FastAPI backend
  main.py                  # App entry point
  config.py                # Settings (env vars)
  models.py                # SQLAlchemy ORM models
  schemas.py               # Pydantic validation
  routers/                 # API endpoints
  services/                # AI classification, urgency, extraction, routing
  seed.py                  # Sample data seeding
lit_frontend/                  # Streamlit UI
  app.py                   # Main app
  pages/                   # Submit, dashboard, admin pages
tests/                     # pytest test suite
data/sample/               # Synthetic demo data

Running Tests

pytest tests/ -v

Tech Stack

  • Backend: Python 3.11+, FastAPI, SQLAlchemy 2.0, Pydantic v2
  • AI: Anthropic API (Claude Haiku) with keyword fallback
  • Frontend: Streamlit
  • Database: SQLite (prototype), designed for PostgreSQL migration
  • Deployment: Docker, Railway

Deploy Your Own

Railway:

  1. Fork this repository
  2. Connect to Railway
  3. Set ANTHROPIC_API_KEY in Railway environment variables (optional)
  4. Deploy

License

MIT

About

AI-powered legal request intake portal that auto-classifies requests, assesses urgency, extracts key details, and routes to the right team member.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages