Skip to content

pradyten/lawyer.com_assignment

Repository files navigation

LegalMatch AI

AI-powered lawyer matching engine that uses 3 AI models in parallel (Claude, GPT-4o-mini, Gemini) to analyze a user's legal situation and match them with the right type of lawyer.

Live Demo: https://lawyercomassignment.vercel.app

Features

  • 3 AI Models in Parallel — Claude classifies the practice area, GPT-4o-mini extracts key entities, Gemini generates actionable guidance
  • Real-time SSE Streaming — Watch each agent complete in real-time with status indicators
  • Graceful Partial Failure — If 1 or 2 agents fail, results from the others still display
  • 20 Practice Areas — Covers Personal Injury, Family Law, Criminal Defense, Immigration, and more
  • Dark Mode — Professional legal-tech aesthetic with blue accent
  • Fully Responsive — Works on desktop and mobile

Tech Stack

  • Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS v4, shadcn/ui
  • AI Agents: Anthropic SDK (Claude), OpenAI SDK (GPT-4o-mini), Google Generative AI SDK (Gemini)
  • Validation: Zod v4 for runtime validation of AI responses
  • Deployment: Vercel

Getting Started

# Install dependencies
npm install

# Set up environment variables
cp .env.local.example .env.local
# Add your API keys to .env.local

# Run development server
npm run dev

Environment Variables

ANTHROPIC_API_KEY=your_anthropic_key
OPENAI_API_KEY=your_openai_key
GOOGLE_AI_API_KEY=your_google_ai_key

Architecture

User Input → POST /api/analyze → SSE Stream
                                    ├── Agent 1: Claude (Classifier) → Practice Area
                                    ├── Agent 2: GPT-4o-mini (Extractor) → Key Details
                                    └── Agent 3: Gemini (Advisor) → Guidance
                                    → Complete event with ensemble confidence

All 3 agents run via Promise.allSettled so partial failures are handled gracefully. Each agent has a 15-second timeout.

Built By

Pradyumn K Tendulkar

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors