Skip to content

Case study · Legal-tech

Enterprise Legal Intelligence Platform

A production RAG platform that turns 50,000+ French-language court decisions into a searchable, privacy-safe knowledge base, with triple-search retrieval, role-based access, compliance-grade PII anonymization and AI-assisted drafting.

Client
Legal-tech platform · French-language case law, Côte d'Ivoire & OHADA
Project
Data Greffe Justice
Status
Live in production
Legal documents indexed
50K+
PII detection accuracy
98%
Query response time
<2s
Faster document drafting
80%
Retrieval confidence
95%+
Documents anonymized before indexing
100%

The challenge

Legal professionals were searching tens of thousands of French-language court decisions with keyword tools that missed meaning, context and precedent. Finding the right decision, and the appeals that followed it, took hours.

The documents carried sensitive personal data, including information about minors, so nothing could be indexed or surfaced without rigorous anonymization. Access had to be controlled by role, and the platform had to respect OHADA business-law conventions across multiple jurisdictions.

legal-search · data-greffe-justice
Hybrid · RBAC
résiliation abusive d’un bail commercial, OHADA

50K+ décisions· < 2 s· BM25 + vecteurs· réponses citées

  • Cour d’appel · Commercial0.94

    …la juridiction relève que [PARTIE A] a procédé à la résiliation du bailsans préavis, en méconnaissance de l’Acte uniforme OHADArelatif au droit commercial général…

    [1] Arrêt n° ••• · chaîne d’appel ↗

  • Tribunal de commerce · Bail0.86

    …[PARTIE B], preneur, sollicite des dommages-intérêts pour rupture abusive…

rôle : juristePII masquées3 index
Illustrative interface · client data never shown

Architecture · 6 stages

  1. 01

    Ingest

    PDF/Word extraction, structure-aware chunking

  2. 02

    Redact

    Triple-search PII anonymization, minor-protection rules

  3. 03

    Comply

    OHADA + privacy rules, three-tier RBAC

  4. 04

    Index

    Triple-index Elasticsearch + Pinecone vectors

  5. 05

    Retrieve

    Hybrid BM25 + dense fusion, metadata filters

  6. 06

    Generate

    Cited answers and document drafting

The solution

I architected and built the platform end to end. A multi-stage ingestion pipeline extracts text from PDF and Word files and applies structure-aware chunking with overlap, so legal reasoning is not cut mid-argument.

Retrieval runs on a triple-index Elasticsearch layer (semantic, metadata and appeal-chain indices) alongside Pinecone vector search. Fusing BM25 keyword scoring with dense vectors improved retrieval accuracy by 15% over either method alone.

A Claude-powered anonymization engine with a triple-search architecture detects and masks personal data before anything is indexed, with dedicated safeguards for minors and vulnerable parties. Three-tier RBAC governs who sees what, and an AI document-generation module drafts legal documents from retrieved precedent.

Compliance is enforced by the pipeline, not by policy: no document reaches the index or the model without passing anonymization first, so 100% of indexed content is privacy-safe by construction. OHADA conventions and multi-jurisdiction privacy rules are applied at ingestion, and every access is scoped by role.

Every architecture change was validated against a 200-question evaluation set built with a practicing lawyer, which caught regressions before they reached users.

Engineering highlights

  • Hybrid BM25 + vector retrieval, 15% more accurate than either alone
  • Triple-index Elasticsearch: semantic, metadata and appeal-chain search
  • Triple-search anonymization engine: 98% PII detection, safeguards for minors
  • Compliance by design: 100% of documents anonymized before indexing
  • OHADA-aware, multi-jurisdiction privacy rules applied at ingestion
  • 200-question lawyer-built evaluation set gating every release
  • Three-tier role-based access control (RBAC)
  • AI document generation that cut drafting time by 80%
  • Around 23 documented REST endpoints for integration

Technology

  • Python
  • Flask
  • Claude API
  • OpenAI
  • Pinecone
  • Elasticsearch
  • Docker
  • REST API

Building something similar?

Get a candid view of the architecture, risks and timeline on a free 30-minute call, or ask the AI assistant how this approach would map to your project.

Book a discovery call
Available for new engagements

Have an AI initiative in mind? Let’s scope it in 30 minutes.

Free discovery call. You'll leave with a clear view of the architecture, risks and next steps, whether or not we work together. I reply within 24 hours.

Not ready to talk yet? Get an instant project plan.