Retrieva Labs

Case study Legal-tech · 2025 – 2026

Datagreffe JusticeAn enterprise legal AI platform for 50,000+ court decisions.

Triple-search retrieval, multi-jurisdiction anonymization and AI drafting over 50,000+ French-language court decisions, with 98% PII detection and 100% compliance.

Client
Datagreffe Justice
Sector
Legal-tech
Engagement
Three consecutive engagements over 7+ months
Our role
Lead AI architect: retrieval, anonymization, generation and backend
Period
2025 – 2026
Status
Production platform

Interface recreation · client data anonymized

court decisions indexed
50,000+
court decisions indexed
PII detection accuracy
98%
PII detection accuracy
data-protection & OHADA compliance
100%
data-protection & OHADA compliance
faster document drafting
80%
faster document drafting
answers with citations
<2s
answers with citations

(01) The challenge

What needed solving.

Datagreffe Justice needed to make a growing archive of more than 50,000 French-language court decisions searchable and useful to legal professionals. Keyword search was failing: lawyers needed answers that understood legal meaning, cited the exact decision and passage, and followed the chain of appeals.

Every decision also contained personal data (parties, witnesses, addresses, identification and financial details), including information about minors and vulnerable people. Nothing could be published or indexed until it was anonymized to data-protection requirements and to the OHADA legal standards that apply across several jurisdictions.

The platform had to do all of this in seconds, under role-based access rules, and keep improving without regressions as the corpus grew.

(02) The solution

What we built.

Across three consecutive engagements we designed and built the platform's AI core: a document indexing and generation pipeline, a hardened document-search backend, and a multi-jurisdiction anonymization engine with a triple-search architecture.

Retrieval fuses three search methods: BM25 keyword search for exact legal terms and references, semantic vector search on Pinecone for meaning, and structured metadata and decision-chain search on Elasticsearch for court, date, jurisdiction and appeal history. Fused ranking retrieved 15% better than any single method.

A Claude-powered anonymization engine applies jurisdiction-specific rules to detect and remove personal data before indexing, with dedicated safeguards for minors and vulnerable parties. An AI drafting module retrieves relevant precedent to generate first drafts, and the platform is exposed through a documented API with three-tier role-based access control.

(03) Architecture

How the system fits together.

  1. 01 · Ingest

    • 50K+ court decisions
    • PDF & Word extraction
    • 512-token chunks
  2. 02 · Anonymize

    • Claude PII engine
    • Jurisdiction rules
    • Minors safeguards
  3. 03 · Triple search

    • BM25 keyword
    • Pinecone semantic
    • Metadata & appeals
  4. 04 · Fuse & secure

    • Hybrid ranking
    • +15% retrieval
    • Three-tier RBAC
  5. 05 · Generate

    • Cited answers
    • AI drafting
    • Under 2 seconds

(04) Engineering decisions

The choices that made it work.

  1. 01

    Triple search, fused

    Keyword, semantic and metadata indexes each catch what the others miss; fused ranking puts the best passages first.

  2. 02

    Anonymization before indexing

    Personal data is removed before it can reach a search index or a model prompt, so compliance never depends on downstream filters.

  3. 03

    Evaluation-gated changes

    200 question-and-answer pairs validated with a lawyer gated every architecture change, and chunk sizes of 256, 512 and 1,024 tokens were benchmarked rather than assumed.

  4. 04

    Access by role

    Three-tier role-based access control decides what each user can retrieve, enforced at query time.

(05) Results

What the client got.

  • 50,000+ court decisions processed and indexed (around 200,000 vectors)
  • 98% PII detection accuracy across jurisdictions, with safeguards for minors and vulnerable parties
  • 100% compliance with data-protection requirements and OHADA legal standards
  • 80% reduction in document creation time with the AI drafting module
  • Answers with source citations in under 2 seconds, end to end
  • Around 23 documented REST endpoints behind three-tier role-based access
  • The client re-engaged us twice to extend the platform
It has been a real pleasure working with Mubashir on this highly technical and time-sensitive legal-tech project. From the outset, he demonstrated strong professionalism and deep technical knowledge.
Client, Datagreffe JusticeLegal-tech document search platformVerified on Upwork

Technology

  • Claude (Anthropic)
  • OpenAI
  • Pinecone
  • Elasticsearch
  • Python
  • Flask
  • Docker

Services involved

Go deeper

Next case study Government & public sectorNational Political RAG Assistant

Taking on new projects

Let’sbuild.

Want results like these? Let's talk.

Book a free 30-minute strategy call with our founder. You’ll leave with a clear view of the right architecture, timeline and next step, whether or not we work together.

  • Reply within 24 hours
  • NDA before you share anything confidential
  • You own the code, prompts and documentation
  • Hours overlap with US, UK, EU and Gulf teams
Or get an instant AI plan with the Project Scoper
Book a free strategy call