Simply Law

🎯 What it does

The Problem: Personal injury lawyers at firms like Morgan & Morgan are drowning in messy data - overflowing inboxes, half-finished client texts, and phone transcripts full of "uhh." The legal team spends as much time sorting through chaos as fighting for justice.

Four Collaborative AI Agents:

  • AI Orchestrator: Routes requests to specialists using keyword scoring and intent analysis.
  • Document Agent: Processes any file type and extracts key legal information.
  • Sherlock Agent: Performs deep case analysis, builds timelines, and evaluates settlements.
  • Client Communications Agent: Drafts empathetic, legally-safe communications.

What makes this unique: True agent collaboration! The Orchestrator triggers Collaborative Mode where agents share context, build on each other's work, and reach consensus before delivering responses.

🔧 How we built it

  • Multi-Agent Architecture: Each agent has specialized tools and communicates through structured protocols. This isn't just API calls - it's true agent-to-agent collaboration where agents share context and build on each other's work.
  • Smart Routing System: Our Orchestrator uses keyword scoring to determine intent. "Draft an email" routes to Communications Agent, while "analyze this case" triggers Collaborative Mode with multiple agents working together.
  • Real Document Processing: Complete file processing for legal documents - from high-quality PDFs to blurry scanned faxes to audio recordings. The system automatically falls back to OCR when needed.
  • Outbound Dialing: Type a message to give clients an update on a case using Twilio.
  • Email Dispatch: Using Resend, and our domain from GoDaddy, we can send emails from our simplylaw domain.
  • Vultr Deployment: Deployed on Vultr for hosting in production.

💪 Challenges we overcame

  • Agent Communication Complexity: Enabling agents to work together like a real team. We designed protocols for sharing context and structured data without losing information.
  • Real-World Document Chaos: Legal documents are messy - password-protected PDFs, handwritten notes, blurry faxes, and poor-quality audio with "uhh" filled transcripts. We built robust error handling and multiple processing fallbacks.
  • Legal Domain Expertise: We created legal-specific classification systems and prompts that maintain accuracy while being conservative enough for legal compliance.
  • Performance vs. Accuracy Trade-offs: Lawyers need fast responses for settlement offers and court deadlines. We optimized with parallel processing and intelligent caching while maintaining analysis quality.

🏆 Accomplishments

  • Functional Multi-Agent Collaboration: Agents that genuinely work together. Our Sherlock Agent requests document processing from the Document Agent, receives structured data, and builds strategic analysis on top.
  • Real Legal Document Processing: Successfully handles actual personal injury case files including police reports, medical bills, insurance documents, and audio recordings.
  • Production-Ready System: Complete FastAPI server with 8 REST endpoints, comprehensive error handling, CORS support, and structured response formats with end-to-end test workflows.
  • Legal-Specific Intelligence: Agents understand legal concepts and maintain conservative, legally-appropriate language while providing actionable insights.

📚 What we learned

  • Multi-agent systems are fundamentally different: Each agent needs clear boundaries, specialized tools, and reliable communication protocols. Debugging requires detailed logging to trace information flow.
  • Legal AI demands extreme conservatism: Must never overstate conclusions or provide advice beyond scope. Every decision must be auditable for compliance.
  • Document processing at scale is challenging: Legal documents vary wildly in quality. Robust error handling and graceful degradation are essential.
  • Prompt engineering is critical: Each agent required dozens of iterations to behave consistently. The difference between working and unreliable often came down to specific prompt phrasing.

🚀 What's next

  • Enhanced agent conversation loops with memory persistence
  • Advanced document processing for more file formats
  • Integration with legal practice management systems
  • Mobile app for client communication

Repository: https://github.com/ballinyouup/morgan-ai-sdk

Built With

Share this project:

Updates