AI-powered legal request intake portal that auto-classifies requests, assesses urgency, extracts key details, and routes to the right team member.
./start.sh # macOS/Linux
start.bat # WindowsThis will install dependencies, start the API and dashboard, and open your browser. No setup required.
docker compose upThen open http://localhost:8501.
By default, the system uses keyword-based classification (no API key needed). To enable AI-powered classification with Claude:
- Copy
.env.exampleto.env - Add your Anthropic API key:
ANTHROPIC_API_KEY=sk-ant-... - Restart the application
- 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
With the server running, visit http://localhost:8000/docs for interactive Swagger documentation.
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
pytest tests/ -v- 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
Railway:
- Fork this repository
- Connect to Railway
- Set
ANTHROPIC_API_KEYin Railway environment variables (optional) - Deploy
MIT