Product architecture

How Lexora connects clients, firms, lenders, and AI into one auditable flow.

Three Next.js apps share a core package and a single Claude-powered AI backend. Row-level security per firm. Editable prompt files. Every consequential action audit-logged.

End-to-end flow

From client intake to lender disbursement, every step is observable.


┌───────────┐    ┌──────────────┐    ┌─────────────┐    ┌────────────┐    ┌──────────┐
│  Client   │───▶│  Firm Ops    │───▶│ AI Layers   │───▶│ Lender Pool│───▶│  Funded  │
│  Intake   │    │  Review      │    │ (1 → 9)     │    │  Bidding   │    │  Retainer│
└───────────┘    └──────────────┘    └─────────────┘    └────────────┘    └──────────┘
      │                  │                   │                  │                │
      ▼                  ▼                   ▼                  ▼                ▼
   PIPEDA           Conflicts          Risk Tier A-D       Best bid wins    Trust acct
   consent          checked            + AI explainer      auto-awarded     disbursed
      │                  │                   │                  │                │
      └──────────────────┴───────────────────┴──────────────────┴────────────────┘
                                            ▼
                                  ┌──────────────────┐
                                  │  Audit Log (L12) │  immutable, narrated
                                  └──────────────────┘

Client

Self-serve intake, retainer signing, payments.

Law Firm

Caseload, AI assessment, lender broadcast.

Lender

Packet review, bid, portfolio analytics.

Admin

Tenants, AI layers, audit oversight.

13 AI layers, orchestrated

Each layer is a discrete Claude call with a versioned prompt. Layers chain into named flows.

L01

Intake Interview

Conversational case capture.

L02

Charge Classifier

Free text → Criminal Code section.

L03

Credit Profile (mock)

Synthetic creditworthiness.

L04

Risk Scoring

Composite tier A–D.

L05

Lender Bid Simulator

Synthetic lender bids.

L06

Retainer Draft

Drafts the engagement letter.

L07

Client Explainer

Plain-language legal explanations.

L08

Document Summarizer

Summarizes disclosure files.

L09

Compliance Sentinel

Real-time policy guardrails.

L10

Conflict Checker

Cross-tenant COI detection.

L11

Portfolio Analytics

Lender risk + yield analysis.

L12

Audit Narrator

Narrated audit timelines.

L13

Tenant Health

Operational anomaly detection.

Flow: New application
Client.intake → L01 → L02
                ↓
              L09 (compliance)
                ↓
              L03 → L04 → L10
                ↓
              L05 (simulate bids)
                ↓
            Firm.review → broadcast
                ↓
        Lender.bid → L11 (yield)
                ↓
        Firm.accept → L06 (draft)
                ↓
      Client.sign → loan.disburse
                ↓
              L12 (narrate)
Rules engine
IF risk_tier IN ['A','B'] AND ai_score >= 70 THEN auto_broadcast_to_lenders AND set_status('lender_bidding') IF retainer.signed AND best_bid.accepted THEN create_loan AND notify(['client','firm','lender']) AND audit('loan.disburse') IF compliance.flags.length > 0 THEN halt AND assign_to(firm.compliance_lead)

Stack & data model

Frontend

Next.js 14 App Router, Tailwind, shadcn/ui — 3 apps, 1 core package.

Data

Supabase Postgres in ca-central-1. RLS on every tenant-scoped table.

AI

Claude 3.7 Sonnet + Haiku via Anthropic API. Prompts versioned in repo.

Compliance

OSFI-aware, PIPEDA consent capture, audit log immutability.

CI/CD

Vercel preview-per-PR. Migrations gated by review.

Security

Per-firm row-level isolation. Service role keys never client-side.

Edge

Edge functions handle webhooks, signatures, idempotency.

Multi-tenant

Firms, lenders, and admin namespaces with strict boundaries.

See it running.

Enter the platform as any role to walk the full flow.