lex-forensics

⚖️ LexForensics — Forensic Legal Analysis in Your Pocket

LexForensics is a powerful mobile-first legal analysis engine powered by Claude AI. It provides a structured, multi-layered framework for legal professionals to analyze claims, documents, and evidence across seven specialized forensic domains — now with an integrated AI citation citator.

Live Demo Expo SDK React Native Claude AI


🚀 Key Features

🔍 7 Forensic Analysis Frameworks

LexForensics encapsulates advanced legal reasoning into discrete, actionable modules:

Framework Domain Expertise
Forensic Review Engine Comprehensive document and claim reliability audit
Litigation Compiler Full L1–L13 compilation of claims, evidence, and authorities
Asymmetry Audit Detection of power imbalances and coerced fluency in legal systems
Constitutional Analysis Scrutiny of standing, remedy, and enforcement identity
Legal Advocacy Letter Generation of grounded advocacy grounded in controlling case law
Evidence Admissibility FRE/CEC screen: relevance, hearsay, privilege, and foundation
Deadline & Procedure SOL mapping, exhaustion traps, and procedural alerts

⚖️ AI Citation Citator

Analyze any legal citation through Claude and get a structured report covering:

Results write back to any authority record with one tap, updating its Shepard’s status. Access from any authority card or from the Add Authority screen.

Limitation: Claude’s knowledge has a training cutoff. This supplements but does not replace live Shepardizing via Westlaw or LexisNexis. Do not rely on it for filing.

📂 Matter Management

Organize your legal research by Matter. Each matter maintains its own context, including jurisdiction, framework history, evidence ledger, and authority tracker.

🛡️ Evidence Ledger

📚 Authority Tracker

⏰ Deadline Tracker

🤖 AI Analysis


🛠️ Tech Stack

Frontend & Core

Intelligence & Utilities


📦 Project Architecture

src/
├── context/
│   └── MattersContext.js        # Global state: matters, settings, CRUD
│                                #   createMatter, updateMatter, deleteMatter
│                                #   addAnalysis, addEvidence, addAuthority
│                                #   updateAuthority, addDeadline, updateSettings
├── data/
│   └── frameworks.js            # Framework definitions & system prompt engineering
├── screens/
│   ├── HomeScreen.js            # Matter dashboard
│   ├── NewMatterScreen.js       # Matter creation + framework selection
│   ├── MatterScreen.js          # 4-tab matter detail (Analysis/Evidence/Authorities/Deadlines)
│   ├── AnalyzeScreen.js         # Framework field input + streaming analysis
│   ├── AnalysisResultScreen.js  # Full result viewer with copy/share
│   ├── AddEvidenceScreen.js     # Evidence intake
│   ├── AddAuthorityScreen.js    # Legal authority intake + citator shortcut
│   ├── AddDeadlineScreen.js     # Deadline tracking
│   ├── CitatorScreen.js         # AI citation citator — analyze, display, apply status
│   └── SettingsScreen.js        # API key + model config
└── utils/
    ├── claudeApi.js             # Streaming + non-streaming Claude API client
    └── citatorApi.js            # runCitatorAnalysis, mapToShepardStatus, treatmentDisplay
Home
├── NewMatter
├── Matter
│   ├── Analyze → AnalysisResult
│   ├── AddEvidence
│   ├── AddAuthority → Citator
│   ├── AddDeadline
│   └── (Authority card ⚖ Verify) → Citator
├── Settings
└── Citator  (standalone — accessible from any authority entry point)

Data model (per matter)

Matter {
  id, title, jurisdiction, frameworkId, status, createdAt, updatedAt,
  analyses:   [{ id, createdAt, result, frameworkId }],
  evidence:   [{ id, createdAt, type, description, admissibility,
                 hearsay, privilege, spoliation, proposition, notes }],
  authorities:[{ id, createdAt, authType, citation, tier, shepardized,
                 proposition, holding, jurisdiction, adverseAuthority, notes }],
  deadlines:  [{ id, label, date, type, rule, tolling, notes }]
}

⚖️ Citator Reference

The citator sends a citation to Claude with a specialized system prompt and returns structured JSON. It does not call Westlaw, LexisNexis, or any external legal database.

Entry points

Location How to open
Authority card → Authorities tab Tap ⚖ Verify
Add Authority screen Tap ⚖ Verify Citation via AI Citator under citation field
Standalone Navigate to Citator directly (no matter/authority context required)

Output fields

Field Description
treatment.status good_law / bad_law / negative_treatment / superseded / unknown
treatment.confidence high / medium / low
treatment.summary 1–2 sentence plain-language status summary
citation_parsed Structured parse + Bluebook format validation
known_history overruled_by, reversed_by, affirmed_by, distinguished_in, criticized_in, limited_by
holding_summary What the case held
related_authorities [{ citation, relationship }]
research_notes Practical attorney guidance
warnings Serious flags requiring immediate attention

Status → Shepard’s mapping

Citator status Stored as
good_law verified
bad_law bad_law
negative_treatment negative_treatment
superseded bad_law
anything else unverified

🏁 Getting Started

Installation

git clone https://github.com/fredm23579/lex-forensics.git
cd lex-forensics
npm install
npx expo start

Scan the QR code with Expo Go (Android or iOS) to open on your device.

Configuration

  1. Open the app and navigate to Settings
  2. Paste your Anthropic API key (stored locally on-device)
  3. Select your preferred model
Model ID Best for
Claude Opus 4.6 claude-opus-4-6 Maximum depth on complex matters
Claude Sonnet 4.6 claude-sonnet-4-6 Recommended — balanced speed and quality
Claude Haiku 4.5 claude-haiku-4-5-20251001 Fast, cost-effective screening

LexForensics is an organizational and research tool, not a substitute for licensed legal counsel.

AI outputs may contain inaccuracies or hallucinated citations. The AI citator operates from training data with a knowledge cutoff and cannot access live legal databases. Before filing any document, relying on any citation, or taking legal action: verify citations via Westlaw or LexisNexis, confirm all deadlines against official sources, and consult a licensed attorney in the relevant jurisdiction.


📄 License

MIT — Built with Claude Code