AI Legal Tender - Multi-Agent Intake Orchestration
💡 Inspiration
Morgan & Morgan, the largest personal injury law firm in the United States, processes over 10,000 client inquiries every month. Each inquiry requires a paralegal to spend 15+ minutes on:
- Reading and understanding the message
- Classifying the request type
- Extracting critical information (names, dates, providers)
- Drafting professional responses
- Ensuring HIPAA compliance for medical requests
This translates to 2,500 paralegal hours per month spent on repetitive intake tasks. We saw an opportunity to use autonomous AI agents to handle this at scale while maintaining the quality standards required in legal work.
🎯 What it does
AI Legal Tender is an autonomous multi-agent orchestration system that processes legal client intake messages with quality validation:
Core Capabilities
- Intelligent Classification: Automatically routes messages to specialist agents based on content
- Multi-Agent Processing: Three specialist agents handle different request types:
- RecordsWrangler Agent: Medical records requests with HIPAA compliance
- Scheduling Agent: Appointment coordination and rescheduling
- Status Agent: Case status inquiries and updates
- Quality Guardian System: Validates every output with 85% minimum confidence threshold
- Bulk Processing: Handles 20+ messages in parallel (42 seconds for 20 messages)
🔥 Killer Feature: Multi-Provider Workflow Detection
Real personal injury cases often involve multiple medical providers (ER visits, specialists, physical therapy, etc.). Most AI systems fail here by generating a single generic request.
Our system:
- Detects 3-7 providers in a single message
- Generates separate HIPAA-compliant requests for each provider
- Preserves provider-specific context (treatment type, dates, facility)
- Creates a tracking dashboard for all requests
Example: A client says "I was treated at Orlando Health ER, then Florida Hospital for surgery, then saw Dr. Patel for follow-ups and Dr. Anderson for physical therapy at AdventHealth."
Our agent detects 5 separate providers, generates 5 customized records requests with specific context for each, and organizes them for the paralegal.
🛠️ How we built it
Architecture
User Message → Orchestrator → Specialist Agent → Quality Validation → Human Review
Tech Stack
- Backend: Python + Flask
- AI: Google Gemini 2.5 Flash API
- Frontend: React + Tailwind CSS
- Agent Framework: Custom autonomous agent base class with retry logic
Agent Autonomy Design
Each agent inherits from BaseAgent and has:
- Self-validation: Agents check their own output quality
- Retry with feedback: Failed attempts inform next attempt
- Confidence thresholds: Won't proceed if confidence < 85%
- Critical field checking: Refuses to generate drafts with missing data
Quality scoring: Every output gets a 0-1 quality score
class BaseAgent(ABC): def __init__(self): self.max_retries = 3 self.min_confidence = 0.85 def process(self, message_text): for attempt in range(self.max_retries): result = self._call_gemini(message_text, attempt, quality_issues) # Quality checks if result['confidence'] < self.min_confidence: continue # Retry with feedback if missing_critical_fields(result): continue # Retry with feedback if not self.validate_output(result): continue # Retry with feedback return result # Success! # All retries failed - refuse to proceed return { "success": False, "requires_human_review": True, "quality_issues": [...] }
Multi-Provider Detection Algorithm
The RecordsWrangler agent uses sophisticated entity extraction:
- Identifies hospital names, doctor names, clinic names
- Detects transition phrases ("then I went to", "also saw", "transferred to")
- Associates treatment context with each provider
- Extracts provider-specific dates
- Generates N separate drafts for N providers
🚧 Challenges we ran into
1. Gemini API Rate Limits
- Problem: Free tier has 10 requests/minute, bulk processing hit limits
- Solution: Switched to Gemini 2.5 Flash (1000+ req/min), implemented batching (5 at a time)
2. Quality vs Speed Trade-off
- Problem: Fast agents made mistakes, slow validation annoyed users
- Solution: Prioritized quality, added retry logic, made validation transparent to user
3. Multi-Provider Complexity
- Problem: Detecting multiple providers without false positives is hard
- Solution: Used structured JSON output, required provider_type classification, validated each provider separately
4. HIPAA Compliance
- Problem: Generated emails must follow strict medical privacy rules
- Solution: Added compliance validation (must mention HIPAA, proper authorization language, secure transmission)
5. Zero Hallucinations
- Problem: LLMs hallucinate missing information
- Solution: Agents mark fields as "Not found" rather than guess, low confidence triggers rejection
🏆 Accomplishments that we're proud of
✅ Multi-Provider Workflow Detection - Handles complexity that breaks other systems
✅ Quality Guardian System - Refuses to send bad drafts (shows "requires human review")
✅ Processing Speed - 20 messages in 42 seconds with full validation
✅ 428x Speedup - Manual: 5 hours, Automated: 42 seconds
✅ Production-Ready Thinking - Quality scores, retry logic, error handling
✅ Zero Hallucinations - Honest about missing data instead of making it up
📚 What we learned
Technical Learnings
- Autonomous agents need guardrails: Speed without quality is useless in legal domain
- Multi-agent orchestration is powerful: Specialist agents outperform generalists
- Structured output is critical: JSON schemas prevent hallucinations
- Rate limits are a real concern: Production systems need proper API quota planning
Domain Learnings
- Legal work has zero tolerance for errors: One wrong date can delay a case 6 months
- Personal injury cases are complex: Multi-provider scenarios are the norm, not exception
- HIPAA compliance is non-negotiable: Every medical records request must follow strict rules
- Paralegals need trust: System must explain reasoning and flag uncertainty
Product Learnings
- Quality metrics matter: Showing "85% confidence" and "quality score: 0.92" builds trust
- Transparency wins: "Agent detected 5 providers" is more impressive than hiding complexity
- Demo narrative > raw features: Explaining "why this is hard" matters more than "look what it does"
🚀 What's next for AI Legal Tender
Near-term (Production Ready)
- Bidirectional Workflow: Detect and process provider responses automatically
- Real Integrations: SendGrid for emails, Google Calendar for scheduling
- Case Viability Screening: Add 4th agent that evaluates if case is worth pursuing (statute check, jurisdiction validation)
Mid-term (Scale)
- More Agent Types: Contract review, settlement negotiation, opposing counsel communication
- Learning from Corrections: When lawyers edit drafts, feed back to improve agents
- Multi-language Support: Spanish intake is critical for Morgan & Morgan's client base
Long-term (Vision)
- End-to-End Case Automation: From intake → records gathering → case building → settlement
- Predictive Analytics: "This case has 85% settlement probability based on similar cases"
- White-label Platform: Any law firm can deploy their own agent orchestrator
📊 Impact Metrics
Time Saved: 2,500 paralegal hours/month → 5.5 compute hours/month
Cost Reduction: $125,000/month in paralegal time (at $50/hr)
Scale: Can process Morgan & Morgan's entire monthly intake volume
Quality: 85%+ confidence on all approved drafts, ~80% pass quality checks on first attempt
Built with ❤️ for Morgan & Morgan and the future of legal tech automation


Log in or sign up for Devpost to join the conversation.