Project-Ease
Multi-tenant AI platform for law firms
Python · Quart · Azure OpenAI · Azure AI Search · Azure AI Document Intelligence · RAGAS · React 19
The problem
A legal-practice platform for Pakistani law firms needs to retrieve from a case-law corpus shared across every tenant, while keeping each firm’s own matters strictly isolated — and legal answers are high-stakes enough that an ungrounded or hallucinated citation is a real liability, not just a bad user experience.
The approach
An extension of Microsoft’s azure-search-openai-demo reference architecture into a full legal-practice platform: matter lifecycle tracking, hearing and deadline management, OCR-assisted document extraction, statutory fee calculation, WhatsApp/Twilio reminders with Whisper voice transcription, per-seat plan enforcement, audit logging, and an Urdu/RTL interface with language-matched prompting, on a Quart backend over Azure OpenAI, Azure AI Search and Azure AI Document Intelligence.
The interesting decision
Organisation-scoped retrieval resolved in a single hybrid BM25 + vector + semantic query, alongside the shared case-law corpus — with tenancy enforced server-side from the JWT organisation claim rather than trusting any client-supplied value, so one firm’s matters can’t leak into another’s results no matter what the client sends. On top of that, a two-pass anti-hallucination check: a second, temperature-zero model call verifies every answer against its retrieved sources before the user sees it. A RAGAS evaluation harness is wired into that same response path, scoring faithfulness, answer relevancy and context precision.
What I’d do differently
The harness is built and instrumented; it hasn’t been run yet. That’s the single highest-value thing left on this project — running it converts "an evaluation harness is wired in" into a measured, comparable retrieval-quality baseline, and it would be the first measured result anywhere in this portfolio. Everything else here is described as instrumentation, deliberately, until that run happens.