Skip to content

BonelessWater/Swamphacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ajourned - Legal AI Platform

A two-sided legal platform connecting lawyers with clients (citizens and business owners), featuring AI-powered document processing, case management, and intelligent agent orchestration backed by 24+ public legal data sources.

Demo Link: https://www.youtube.com/watch?v=7Snf00f-hGw Devpost Link: https://devpost.com/software/adjourned

Overview

Ajourned is an AI-powered legal assistant system designed to:

  • For Lawyers: Streamline case triage, document processing, and client management with AI-assisted recommendations
  • For Citizens: Understand legal rights, get help with forms (W-2, immigration, loans), and access legal guidance
  • For Business Owners: Navigate complex filings (patents, LLC, IPO/10-K), tax optimization, and regulatory compliance

The platform features a lawyer-in-the-loop learning system that continuously improves from human feedback.


Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                           FRONTEND (React + Vite)                       │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │
│  │ Case List   │  │ Case Detail │  │ Forms View  │  │ Dashboard   │     │
│  └─────────────┘  └─────────────┘  └─────────────┘  └─────────────┘     │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                         BACKEND (FastAPI)                               │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                    Legal Orchestrator                            │   │
│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐           │   │
│  │  │ Research │ │ Document │ │  Forms   │ │ Context  │           │   │
│  │  │  Agent   │ │  Agent   │ │  Agent   │ │  Agent   │           │   │
│  │  └──────────┘ └──────────┘ └──────────┘ └──────────┘           │   │
│  └─────────────────────────────────────────────────────────────────┘   │
│  ┌─────────────────────────────────────────────────────────────────┐   │
│  │                 Learning System (Human-in-the-Loop)              │   │
│  └─────────────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────────────┘
                                    │
                                    ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                    MCP DATA SERVERS (24 Sources)                        │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐     │
│  │  USPTO   │ │CourtList │ │ LegiScan │ │SEC EDGAR │ │  CFPB    │     │
│  │ Patents  │ │ Case Law │ │  Bills   │ │ Filings  │ │Complaints│     │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘     │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐     │
│  │   IRS    │ │  USCIS   │ │  eCFR    │ │  GovInfo │ │ FL OIR   │     │
│  │  Forms   │ │  Forms   │ │   Regs   │ │   Docs   │ │Insurance │     │
│  └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘     │
└─────────────────────────────────────────────────────────────────────────┘

User Interfaces

Lawyer Dashboard

┌─────────────────────────────────────┐
│  Cases              [Alerts]        │
│  ├─ Case #1234 - Smith v. Acme     │
│  └─ Case #1235 - Jones Insurance   │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ Case #1234                          │
│ ┌─────────────────────────────────┐ │
│ │ Situation: Insurance dispute    │ │
│ │ AI Recommendation: [analysis]   │ │
│ │                                 │ │
│ │ [Edit] [Look Deeper] [Accept]   │ │
│ │                                 │ │
│ │ Files | Transcripts | Timeline  │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────┘

Client Interface

┌──────────┬─────────────────────────┐
│ Forms    │ Your Rights             │
│ Rights   │ ─────────────────────── │
│ Alerts   │ Based on your situation │
│          │ you may be entitled to  │
│          │ [detailed guidance]     │
│          │                         │
│          │        [Call Lawyer]    │
└──────────┴─────────────────────────┘

Alerts:
 • File your W-2 by April 15
 • Copyright infringement detected

AI Agent System

Specialized Agents

Agent Function
Research Agent Legal research, case law lookup, statute analysis
Document Agent Summarization, extraction, classification
Forms Agent PDF form assistance, validation, auto-fill
Context Agent User profile management, real-time processing
Educational Agent Rights information, legal guidance
Records Agent Database management, case organization

Learning System

The platform implements lawyer-in-the-loop learning:

  1. System finds similar cases via RAG
  2. Proposes AI-generated recommendation
  3. Lawyer reviews and edits (or accepts)
  4. Feedback captured for model improvement
  5. Future cases benefit from corrections

Supported learning modes: supervised, reinforcement, few-shot, one-shot, zero-shot


Data Sources (MCP Servers)

24 Model Context Protocol servers providing access to legal data:

Intellectual Property

Server Description Tools
uspto-mcp Patents, PTAB proceedings, litigation 18
uspto-forms-mcp Patent application forms 42 forms
copyright-mcp U.S. Copyright Office registry 14

Courts & Case Law

Server Description Tools
courtlistener-mcp Case law, PACER/RECAP, judges Largest free legal DB
pacer-mcp Federal court documents -

Legislation & Regulations

Server Description Tools
legiscan-mcp All 50 states + Congress bills 24
federal-register-mcp Federal Register documents -
ecfr-mcp Code of Federal Regulations 15
openstates-mcp State legislative tracking -
uscode-mcp United States Code -
govinfo-mcp Government documents 20

Financial & Banking

Server Description Tools
sec-edgar-mcp SEC corporate filings -
fdic-mcp FDIC bank information -
hmda-mcp Home Mortgage Disclosure Act -
fred-mcp Federal Reserve economic data -
usaspending-loans-mcp Federal lending programs -
cfpb-complaints-mcp Consumer complaint database 17

Government Forms

Server Description Tools
irs-forms-mcp IRS tax forms library -
irs-irm-mcp IRS Internal Revenue Manual -
uscis-forms-mcp Immigration forms -
business-formation-forms-mcp FL business forms -

State-Specific

Server Description Tools
florida-insurance-mcp FL Office of Insurance Regulation 14

Other

Server Description
openlaws-mcp Open Laws data
municode-mcp Municipal codes

Use Cases

Insurance Claims

  • Search CFPB complaint database for similar cases
  • Access FL OIR for insurer information
  • Research relevant case law via CourtListener

Copyright Infringement

  • Search U.S. Copyright Office registry
  • Find prior registrations and ownership
  • Research related litigation

Financial Fraud / Loan Issues

  • Access SEC EDGAR for company filings
  • Search CFPB for consumer complaints
  • Review HMDA mortgage data

Immigration & Forms

  • USCIS form assistance
  • Jurisdiction-aware guidance
  • Document checklist generation

Business Formation

  • LLC, patent, trademark filings
  • State-specific requirements
  • Tax optimization research

Tech Stack

Frontend

  • React 18 + TypeScript
  • Vite (dev server on port 3000)
  • Radix UI (50+ accessible components)
  • TailwindCSS (styling)
  • React Hook Form (form management)
  • Recharts (data visualization)

Backend

  • FastAPI (Python, port 3002)
  • DSPy (structured LLM interactions)
  • Pydantic (data validation)
  • Uvicorn (ASGI server)

LLM Providers

  • OpenAI (GPT-4)
  • Anthropic (Claude)
  • Google (Gemini)
  • Mock provider (testing)

Deployment

  • Nginx reverse proxy
  • Azure App Service
  • EC2 deployment scripts

Project Structure

Swamphacks/
├── api/                          # FastAPI backend
│   └── server.py                 # Main API (481 lines)
├── agents/                       # AI agent system
│   ├── legal_agents.py           # Agent blueprints (38KB)
│   ├── legal_orchestrator.py     # Orchestration (35KB)
│   ├── learning.py               # Human-in-the-loop (46KB)
│   ├── llm_providers.py          # LLM abstraction (18KB)
│   └── learning_data/            # Training examples
├── src/                          # React frontend
│   ├── components/
│   │   ├── ClientDashboard.tsx   # Main dashboard (53KB)
│   │   ├── CaseDetail.tsx        # Case view (16KB)
│   │   ├── FormsView.tsx         # Legal forms
│   │   ├── TimelineView.tsx      # Case timeline
│   │   └── ui/                   # UI component library
│   └── App.tsx
├── data/                         # 24 MCP servers
│   ├── uspto-mcp/
│   ├── legiscan-mcp/
│   ├── courtlistener-mcp/
│   ├── cfpb-complaints-mcp/
│   ├── copyright-mcp/
│   ├── florida-insurance-mcp/
│   └── ... (18 more)
├── tests/                        # Test suite
├── deploy/                       # Deployment configs
├── package.json                  # Frontend deps
├── requirements.txt              # Backend deps
└── vite.config.ts

Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • API keys for LLM providers (OpenAI/Anthropic/Google)

Frontend

npm install
npm run dev          # Dev server at http://localhost:3000
npm run build        # Production build

Backend

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

# Set environment variables
export OPENAI_API_KEY=your_key
export PORT=3002

uvicorn api.server:app --host 0.0.0.0 --port 3002

MCP Servers

# Example: Start the CFPB complaints server
cd data/cfpb-complaints-mcp
npm install
npm start

API Endpoints

Method Endpoint Description
GET /health Health check
GET /agents List all agents
POST /process Process legal request
POST /execute Execute single agent
GET /reviews/pending Pending lawyer reviews
POST /reviews/submit Submit lawyer feedback
GET /learning/stats Learning system stats
GET /learning/similar-cases Find similar cases

Testing

pytest tests/ -v

Deployment

Nginx (Production)

Sample config at deploy/nginx.conf. Update server_name and SSL paths.

Azure App Service

CI/CD configured in .github/workflows/deploy.yml

EC2

./deploy/setup_ec2.sh
./deploy/deploy_to_ec2.sh

Environment Variables

# Required
OPENAI_API_KEY=sk-...

# Optional
ANTHROPIC_API_KEY=...
GOOGLE_API_KEY=...
PORT=3002
LLM_MODEL_KEY=gpt-4

# MCP Server API Keys (where required)
LEGISCAN_API_KEY=...
COURTLISTENER_API_TOKEN=...
OPENSTATES_API_KEY=...

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes with tests
  4. Submit a pull request

License

MIT


Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5