Skip to content

fredm23579/lex-forensics

Repository files navigation

⚖️ 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:

  • Treatment status — good law / bad law / negative treatment / superseded / unknown, with confidence level
  • Parsed citation — case name, reporter, volume, page, court, year, Bluebook format validation
  • Known history — overruled by, reversed by, affirmed by, distinguished in, criticized in, limited by
  • Holding summary — brief statement of what the case held
  • Related authorities — companion cases and doctrinal relatives
  • Research notes — practical guidance: what to verify, watch for, related doctrines
  • Warnings — serious flags requiring immediate attention

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.

  • Status tracking: active / closed / archived
  • Local Storage: All matter data stored on-device via AsyncStorage — nothing leaves your device except Anthropic API calls
  • Offline-First UI: Browse active matters and prior analyses without an internet connection

🛡️ Evidence Ledger

  • Types: document, email, photo, recording, screenshot, testimony
  • Flag hearsay concerns, privilege issues, and spoliation risks
  • Track admissibility status per item and map items to the propositions they prove

📚 Authority Tracker

  • Bluebook citation format
  • Tier labels: primary binding / primary persuasive / secondary / commentary
  • Shepard's verification status: unverified / verified / bad law / negative treatment
  • Per-authority ⚖ Verify button — opens citator pre-filled and can write status back
  • Adverse authority and limiting doctrine fields

⏰ Deadline Tracker

  • 10+ deadline types: SOL, EEOC charge, admin claim, appeal windows, TRO/PI hearings
  • Color-coded urgency: critical (red) / urgent (orange) / soon (yellow) / ok (green)
  • Tolling analysis fields and governing rule references

🤖 AI Analysis

  • Streams responses from Claude in real time
  • Stop mid-stream and save partial results
  • All analyses saved per matter with timestamps
  • Copy to clipboard or share via OS share sheet

🛠️ Tech Stack

Frontend & Core

  • React Native (v0.81) & Expo (v54): Modern, cross-platform mobile architecture
  • React Navigation (v7): Seamless state-driven navigation flows
  • Reanimated & Gesture Handler: Fluid animations for a premium user experience

Intelligence & Utilities

  • Anthropic Claude API: Leveraging Sonnet 4.6 for sophisticated legal reasoning
  • Streaming Responses: Real-time analysis feedback for complex queries
  • OS Integration: Clipboard, Sharing, and safe-area context for a native feel

📦 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

Navigation

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

⚠️ Legal Disclaimer

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.


Related

📄 License

MIT — Built with Claude Code

About

LexForensics — Forensic Legal Analysis Engine (React Native / Expo + Claude API)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors