Enaryx LabsEnaryx Labs
Case 01 · Healthcare / Legal Technology · 2025

A records-review platform with an AI extraction pipeline

An AI-assisted, physician-reviewed medico-legal record review platform — from secure record intake through automated analysis to a source-cited, verified deliverable.

Smart Med Record Inc. logo

The problem

Personal-injury and malpractice firms work cases with thousands of pages of disorganized medical records — duplicate scans, missing date ranges, handwritten notes, mixed providers. Building a chronology by hand is slow, expensive and hard to defend once a conclusion loses its source page — but a raw LLM summary isn't defensible either.

  • A case arrives as thousands of pages — duplicate scans, missing date ranges, handwritten notes, mixed providers
  • Building the chronology and finding the decisive fact is slow and expensive by hand
  • A conclusion that loses its source page is hard to defend in a deposition
  • A raw LLM summary is faster, but it has no citations and can invent facts

The approach

  • An async pipeline runs OCR and extraction into a strict schema — the model fills fields, it can't invent them
  • Every extracted value and every search result carries its source page
  • RBAC is enforced per-endpoint on the API; the front-end route guard is only a UX convenience
  • A physician reviews and signs off before any deliverable is released

What we built

Secure intake wizard

Multi-step case creation with client-side validation, draft-and-resume, and encrypted upload to object storage.

Async AI document pipeline

Digital PDFs are parsed directly; scanned pages fall back to a vision model for OCR and extraction in one pass, validated against a strict schema.

Source-cited semantic search

Natural-language questions across a firm's whole corpus, returning ranked snippets that link back to the exact case and file.

Per-case AI summary

A generated case narrative stored with the case, with the model name recorded for auditability.

Reviewer workflow

Physicians and reviewers see only their assigned cases, update status, and upload verified deliverables.

Billing & audit trail

Consolidated multi-case invoices, sequential numbering under a DB transaction, payment-gated downloads, and an immutable per-case event log.

How it works

  1. 01

    Intake

    The firm creates a matter, selects services, and uploads records through the guided wizard.

  2. 02

    Extract

    Each file is queued to a worker: text or vision extraction into a validated schema, then chunk-and-embed for search.

  3. 03

    Review

    A physician checks the extraction and the generated summary, corrects anything, and signs off.

  4. 04

    Deliver

    The verified deliverable is released once the invoice is paid; every step lands on the case timeline.

Architecture

WebNext.js 15 App Router · React 19 · TanStack Query for server state · Redux Toolkit for UI state · Clerk auth
APINestJS 11 · Prisma 6 over PostgreSQL · BullMQ + Redis job queue · Socket.IO gateway
AIOpenAI for extraction · text-embedding-3-small for embeddings · Qdrant for semantic search
InfraS3-compatible storage · SendGrid · Puppeteer PDF · Sentry · Docker + Trivy scan · CI quality gate · Vercel

Engineering

Server-side RBAC by default

A global auth + roles guard protects every route; endpoints opt out explicitly. Four roles — client (firm-scoped, team-seat visibility), admin, reviewer, billing.

Defense-in-depth vector search

Qdrant payload filters scope results for speed, but every hit is re-checked against the caller's real RBAC scope in application code before it's returned.

Resilient job pipeline

Embedding is best-effort — a search-index failure doesn't fail the user-visible extraction. Re-running extraction clears stale vectors first.

CI quality gate

Policy checks, lint, typecheck, build, dependency audit, and a Docker build + Trivy scan (HIGH/CRITICAL fails the build) for both apps.

By the numbers

24–48h

Target turnaround per matter

99%

Accuracy goal, with mandatory human review

HIPAA-aligned

Encryption in transit and at rest, least-privilege, audit logging

The product's stated targets — mandatory human review before every delivery.

Outcome

  • Manual re-keying from records dropped to near zero
  • Every search result and extraction carries its source page — defensible, not a black box
  • Clients track case status themselves; every deliverable ties back to an approval and a payment

Stack

Next.js 15React 19TypeScriptTailwindTanStack QueryRedux ToolkitNestJS 11PrismaPostgreSQLBullMQRedisSocket.IOOpenAIQdrantClerkAWS S3PuppeteerDockerVercel
Contact

Let's build what comes next.

Have an idea, product or technology challenge? Let's talk about what we can build together.

enaryxlab@gmail.com