๐ฌ ForensiX AI
AI-Powered Forensic Triage & Postmortem Intelligence System
An intelligent investigative support system integrating GraphRAG, NLP, Multi-Agent AI, and custom fine-tuned models to assist forensic investigations with real-time analysis, evidence correlation, and predictive risk scoring.
๐ Table of Contents
- Problem Statement
- System Architecture
- Multi-Agent System
- GraphRAG Knowledge Engine
- Custom AI Models
- Forensic NLP Engine
- Digital Evidence Correlation
- Cross-Case Intelligence
- Time-of-Death Estimation
- Risk Scoring & Explainability
- Universal LLM Provider
- Frontend Architecture
- API Reference
- Deployment
- Novelties & Innovation
- Ethical Considerations
- Future Scope
๐ฏ Problem Statement
Investigative agencies and forensic departments face critical challenges:
- Volume overload: Processing large amounts of forensic/digital evidence within limited time
- Manual bottlenecks: Autopsy reports, CCTV logs, mobile metadata analyzed separately by different teams
- Missed connections: Cross-evidence correlations invisible to siloed manual analysis
- Delayed triage: Critical leads buried under routine cases due to lack of intelligent prioritization
- No standardization: Each investigator approaches evidence differently, creating inconsistency
ForensiX AI solves this by providing an AI-powered unified platform that:
- Automatically extracts structured data from unstructured forensic reports
- Correlates physical evidence with digital traces in real-time
- Identifies anomalies and generates investigative leads
- Provides explainable risk scoring for case prioritization
- Operates with full chain-of-custody integrity (SHA-256 ledger)
๐๏ธ System Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ForensiX AI v4.0 Architecture โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ PRESENTATION LAYER โ โ
โ โ React 18 + Vite + Tailwind + Zustand + Framer Motion + Recharts โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ
โ โ โDashboard โ โ Timeline โ โ Evidence โ โ Agents โ โ AI Chat โ โ โ
โ โ โ โ โ โ โ Graph โ โ โ โ (GraphRAG)โ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ
โ โ โ Risk โ โ Autopsy โ โ Cases โ โ Custody โ โ Settings โ โ โ
โ โ โ Scoring โ โWorkspace โ โ CRUD โ โ Chain โ โ LLM Cfg โ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ REST + WebSocket + SSE โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ APPLICATION LAYER (FastAPI) โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ MULTI-AGENT ORCHESTRATOR (7 Agents) โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ Autopsy โโTimeline โโ Digital โโToxicol. โโ Risk โ โ โ โ
โ โ โ โ Agent โโ Agent โโ Agent โโ Agent โโ Agent โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ Correlation Agent โโ Explainability Agent (SHAP) โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ โ
โ โ โ GraphRAG โ โ Forensic โ โ Cross-Case โ โ Universal โ โ โ
โ โ โ Knowledge โ โ NLP Engine โ โ Intelligence โ โ LLM Prov. โ โ โ
โ โ โ (25 nodes) โ โ (Henssge) โ โ (Serial Det.)โ โ (12+ APIs)โ โ โ
โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ CUSTOM AI MODELS (Offline, No API Keys) โ โ โ
โ โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ GLiNER-biomedโ โ DeBERTa-v3 โ โ Qwen2.5-0.5B+LoRA โ โ โ โ
โ โ โ โ Zero-shot NERโ โ Classifier โ โ Extraction Model โ โ โ โ
โ โ โ โ (280MB) โ โ (180MB) โ โ (1.2GB) โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ SQLAlchemy + REST โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ DATA LAYER โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ SQLite โ โ Supabase โ โ Chain of Custody โ โ โ
โ โ โ (Local) โ โ PostgreSQL + โ โ SHA-256 Immutable โ โ โ
โ โ โ โ โ pgvector (Cloud) โ โ Ledger โ โ โ
โ โ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ค Multi-Agent System (FEAT)
Forensic Evidence Analysis & Triage โ 7 specialized AI agents that independently analyze evidence and collaborate through a master orchestrator.
โโโโโโโโโโโโโโโโโโโโโโโโ
โ FEAT ORCHESTRATOR โ
โ Sequential+Parallel โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโดโโโโโ โโโโโโดโโโโโ โโโโโโดโโโโโ
โ AUTOPSY โ โTIMELINE โ โ DIGITAL โ
โ AGENT โ โ AGENT โ โ AGENT โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โโข NER โ โโข Gap โ โโข CCTV โ
โโข COD โ โ detect โ โโข Mobile โ
โโข Injuriesโ โโข Clusterโ โโข GPS โ
โโข Toxicol.โ โโข Sequenceโ โโข Patternโ
โโโโโโฌโโโโโ โโโโโโฌโโโโโ โโโโโโฌโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโดโโโโโ โโโโโโดโโโโโ โโโโโโดโโโโโ
โTOXICOL. โ โ RISK โ โEXPLAIN- โ
โ AGENT โ โ AGENT โ โ ABILITY โ
โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ
โโข Drug IDโ โโข 6-factorโ โโข SHAP โ
โโข Levels โ โ weightedโ โโข LIME โ
โโข Lethalityโ โโข Scoring โ โโข Attrib.โ
โโโโโโฌโโโโโ โโโโโโฌโโโโโ โโโโโโฌโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโดโโโโโโโโโโโโ
โ CORRELATION AGENT โ
โ โข Temporal links โ
โ โข Spatial patterns โ
โ โข Causal inference โ
โ โข Behavioral flags โ
โโโโโโโโโโโโโโโโโโโโโโโโ
Agent Details
| Agent | Purpose | Confidence | Key Findings |
|---|---|---|---|
| Autopsy Agent | Extract COD, manner, injuries, toxicology from reports | 87-95% | Injuries, COD, toxicology entities |
| Timeline Agent | Reconstruct chronological event sequence | 84% | Gaps (>30min), clusters (<5min) |
| Digital Agent | Analyze CCTV, mobile, GPS evidence | 86% | Person discrepancy, rapid departure |
| Toxicology Agent | Interpret drug/poison findings | 90% | Sedation indicators, lethality |
| Risk Agent | 6-factor weighted risk scoring | 85% | Score 0-100, severity level |
| Explainability Agent | SHAP-style factor attribution | 82% | Top contributing factors |
| Correlation Agent | Cross-evidence relationship discovery | 88-94% | Temporal/causal/behavioral links |
๐ง GraphRAG Knowledge Engine
A Retrieval-Augmented Generation system with 25 verified forensic knowledge nodes covering:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GRAPHRAG ARCHITECTURE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ QUERY โโโโโโถโ EMBEDDING โโโโโโถโ RETRIEVAL โ โ
โ โ (User/LLM) โ โ (384-dim) โ โ (Top-K) โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโ โ
โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ FORENSIC KNOWLEDGE BASE โ โ
โ โ โ โ
โ โ POSTMORTEM (5): โ โ
โ โ livor mortis, rigor mortis, algor mortis, โ โ
โ โ PMI estimation, decomposition stages โ โ
โ โ โ โ
โ โ INJURY PATTERNS (8): โ โ
โ โ petechiae, defensive wounds, blunt force, โ โ
โ โ ligature, sharp force, gunshot, hyoid fracture, โ โ
โ โ wound tracks โ โ
โ โ โ โ
โ โ MANNER DETECTION (4): โ โ
โ โ classification, suicide criteria, staging, โ โ
โ โ drowning, fire deaths โ โ
โ โ โ โ
โ โ TOXICOLOGY (5): โ โ
โ โ CO poisoning, benzodiazepines, opioids, โ โ
โ โ alcohol, specimen collection โ โ
โ โ โ โ
โ โ EVIDENCE (3): โ โ
โ โ CCTV analysis, mobile evidence, Locard exchange โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ CONTEXT INJECTION โ LLM System Prompt โ โ
โ โ "VERIFIED FORENSIC KNOWLEDGE โ do not contradict" โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ RETRIEVAL STRATEGY (in order): โ
โ 1. Supabase pgvector (semantic, production) โ
โ 2. HuggingFace embeddings (sentence-transformers) โ
โ 3. Keyword fallback (TF-IDF, always works) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐งช Custom AI Models
Model Stack (runs offline, no API keys needed)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LOCAL ML PIPELINE โ ForensiX Custom Models โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Layer 1: ZERO-SHOT NER (GLiNER-biomed, 280MB) โ
โ โโโ Define ANY entity type at runtime โ
โ โโโ "cause of death", "weapon type", "time indicator" โ
โ โโโ No retraining needed โ labels via natural language โ
โ โ
โ Layer 2: BIOMEDICAL NER (OpenMed, ~109MB each) โ
โ โโโ Toxicology: drugs, chemicals, levels (F1=0.96) โ
โ โโโ Anatomy: body parts, organs (F1=0.91) โ
โ โโโ Pathology: diseases, conditions (F1=0.91) โ
โ โ
โ Layer 3: MANNER CLASSIFIER (DeBERTa-v3-small, 180MB) โ
โ โโโ Fine-tuned on 750 synthetic forensic samples โ
โ โโโ 5 classes: HOMICIDE/SUICIDE/ACCIDENTAL/NATURAL/UNDET. โ
โ โโโ <100ms inference, F1>0.90 โ
โ โ
โ Layer 4: EXTRACTION MODEL (Qwen2.5-0.5B+LoRA, 1.2GB) โ
โ โโโ Fine-tuned on 300 forensic Q&A pairs โ
โ โโโ Outputs structured JSON โ
โ โโโ CPU inference ~3-5s per report โ
โ โ
โ Total RAM: ~3-5GB (NER stack) or ~5-7GB (with LLM) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Training Pipeline
# 1. Generate synthetic training data
python custom-models/scripts/generate_dataset.py
# โ 750 classification samples + 300 extraction Q&A pairs
# 2. Train manner-of-death classifier
python custom-models/scripts/train_classifier.py
# โ DeBERTa-v3-small, 5 epochs, ~180MB output
# 3. Train forensic extraction model
python custom-models/scripts/train_extraction_model.py
# โ Qwen2.5-0.5B + LoRA, 3 epochs, ~50MB adapter
๐ Forensic NLP Engine
Entity Extraction Pipeline
# Input: "Blunt force trauma to the right temporal region with subdural hematoma.
# Defensive wounds on forearms. Benzodiazepines detected."
# Output:
{
"entities": [
{"text": "Blunt force trauma to the right temporal region", "label": "INJURY", "confidence": 0.92},
{"text": "subdural hematoma", "label": "INJURY", "confidence": 0.88},
{"text": "Defensive wounds on forearms", "label": "INJURY", "confidence": 0.90},
{"text": "Benzodiazepines detected", "label": "TOXICOLOGY", "confidence": 0.85}
],
"riskScore": 100,
"riskLevel": "CRITICAL",
"anomalies": [{"type": "sedation_indicator", "severity": "HIGH"}]
}
Pattern Recognition
| Pattern | Detection | Confidence |
|---|---|---|
| CAUSE_OF_DEATH | Regex + LLM extraction | 85-95% |
| MANNER_OF_DEATH | Classification + keywords | 90-95% |
| INJURY | 8 regex patterns + NER | 88% |
| TOXICOLOGY | Drug/substance detection | 90% |
| TIME_INDICATOR | Postmortem signs parsing | 85% |
| EVIDENCE | Physical trace detection | 80% |
| ANOMALIES | Cross-reference contradiction detection | 92% |
๐ก Digital Evidence Correlation
EVIDENCE TIMELINE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
01:45 CCTV: Two individuals enter warehouse โโโโโโ
01:52 CCTV: Vehicle parks near entrance โ CLUSTER
02:00 Mobile: Victim last call โโโโโโโโโโโโโโโโโโโ (<15min)
02:00 โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
โโโ 45-MIN GAP โโโ โ ANOMALY
02:45 โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ โ
02:47 CCTV: Single person exits at high speed โโโโ
02:48 Mobile: Phone signal lost (powered off) โ PATTERN
02:50 CCTV: Vehicle departs rapidly โโโโโโโโโโโโโโ
CORRELATIONS FOUND:
โ ๏ธ PERSON DISCREPANCY: 2 entered, 1 departed (CRITICAL)
โ ๏ธ COMMUNICATION CUTOFF: Phone disconnected (HIGH)
โ ๏ธ RAPID DEPARTURE: Vehicle at unusual speed (HIGH)
๐ต๏ธ Cross-Case Intelligence
Serial pattern detection against historical case database:
CURRENT CASE HISTORICAL MATCH (93% similarity)
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Manner: Homicide โโโโถ CASE-2024-0103 (93%)
Weapons: ligature+blunt โโโโถ Weapons: blunt+ligature โ
Injuries: strangulation โโโโถ Injuries: head_trauma+strangulation โ
Toxicology: diazepam โโโโถ Toxicology: diazepam โ
Location: industrial โโโโถ Location: commercial โ
MO: sedation+violence โโโโถ MO: sedation+violence+abandoned โ
Time: night โโโโถ Time: night โ
Victim: adult male โโโโถ Victim: adult male โ
โ ๏ธ SERIAL PATTERN DETECTED โ Cross-reference with cold case unit
โฑ๏ธ Time-of-Death Estimation
Henssge Nomogram (Double-Exponential Model)
Formula: Q = 1.25ยทe^(-Bยทt) - 0.25ยทe^(-5Bยทt)
Where:
Q = (T_rectal - T_ambient) / (37.2 - T_ambient)
B = 1.2815 ยท (W_effective)^(-0.625) + 0.0284
W_effective = Corrective_Factor ร Body_Weight
Multi-Method Approach:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Method โ Weight โ Conf. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Henssge Nomogram โ 70% โ HIGH โ
โ Rigor Mortis Stage โ 15% โ MOD โ
โ Livor Mortis State โ 10% โ MOD โ
โ Vitreous Potassium โ 5% โ HIGH โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Output: PMI = 6.9h ยฑ 2.8h (95% CI)
๐ Risk Scoring & Explainability
6-Factor Weighted Algorithm
Risk Score = ฮฃ (Factor_Score ร Weight)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Factor โ Weight โ Score โ Contribution โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Violence Level โ 25% โ 85/100โ 21.3 pts โ
โ Digital Patterns โ 20% โ 90/100โ 18.0 pts โ
โ Manner Match โ 15% โ 95/100โ 14.3 pts โ
โ Evidence Gaps โ 15% โ 75/100โ 11.3 pts โ
โ Temporal Cluster โ 15% โ 70/100โ 10.5 pts โ
โ Toxicology โ 10% โ 60/100โ 6.0 pts โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ TOTAL โ 100% โ โ 81.4/100 โ
โ Level: CRITICAL โ โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
SHAP Attribution (Explainable AI)
Feature Importance (case #FTI-2024-0847):
Violence Level โโโโโโโโโโโโโโโโโโโโโโ 85% (+21.3)
Digital Patterns โโโโโโโโโโโโโโโโโโโโโโ 90% (+18.0)
Manner Classification โโโโโโโโโโโโโโโโโโโโโโ 95% (+14.3)
Evidence Gaps โโโโโโโโโโโโโโโโโโโโโโ 75% (+11.3)
Temporal Clustering โโโโโโโโโโโโโโโโโโโโโโ 70% (+10.5)
Toxicology โโโโโโโโโโโโโโโโโโโโโโ 60% (+ 6.0)
๐ Universal LLM Provider
Supports 12+ LLM providers via OpenAI-compatible API:
| Provider | Speed | Quality | Cost |
|---|---|---|---|
| Featherless.ai | Medium | High (Llama-3.1-70B) | Free tier |
| Groq | Ultra-fast | High (llama-3.3-70b) | Free tier |
| Together.ai | Fast | High (Llama-3.1-70B-Turbo) | Paid |
| OpenAI | Medium | Highest (GPT-4o) | Paid |
| HuggingFace | Slow | High (Qwen2.5-72B) | Free |
| TokenRouter | Auto | Auto (cheapest route) | Variable |
| DeepSeek | Medium | High (deepseek-chat) | Paid |
| Ollama | Local | Variable | Free |
| OpenRouter | Variable | Any model | Variable |
Fallback chain: If primary fails โ tries next provider โ graceful degradation to local analysis.
๐ฅ๏ธ Frontend Architecture
src/
โโโ App.jsx # Router + route definitions
โโโ main.jsx # Entry point
โโโ pages/
โ โโโ Landing.jsx # Hero + feature grid
โ โโโ Login.jsx # JWT authentication
โ โโโ Dashboard.jsx # KPI cards + activity feed
โ โโโ ForensicCommandDashboard.jsx # Full command center
โ โโโ InvestigationWorkspace.jsx # Main workspace (panels)
โ โโโ CaseAnalysis.jsx # Deep-dive case view
โ โโโ Timeline.jsx # Forensic timeline
โ โโโ EvidenceGraph.jsx # Force-directed graph
โ โโโ RiskScoring.jsx # SHAP + radar charts
โ โโโ Agents.jsx # Multi-agent dashboard
โ โโโ InvestigationQuery.jsx # NL query + AI Chat
โ โโโ ChainOfCustody.jsx # SHA-256 ledger
โโโ components/
โ โโโ layout/ # App shell (header, nav, panels)
โ โโโ views/ # Embedded views (autopsy, evidence, etc.)
โ โโโ forensic/ # RiskGauge, SHAP chart, suspect card
โ โโโ modals/ # Upload, export, review, search
โ โโโ panels/ # Event details, evidence preview
โ โโโ timeline/ # Forensic timeline component
โโโ lib/
โโโ api.js # 50+ API endpoints connected
โโโ store.js # Zustand global state
โโโ websocket.js # Real-time connection
๐ก API Reference
Core Endpoints (19 routers, 55+ routes)
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
System health + version |
GET |
/api/status |
Full system status (12 features) |
POST |
/api/intelligence/ |
Unified intelligence engine |
POST |
/api/chat/ |
AI Chat with GraphRAG |
POST |
/api/analyze/ |
Full NLP + LLM + GraphRAG analysis |
POST |
/api/ml/ |
ML Pipeline (NER, classify, embed) |
POST |
/api/graphrag/retrieve |
Knowledge retrieval |
GET |
/api/graphrag/stats |
Knowledge base stats |
GET |
/api/triage/stream |
SSE progress events |
GET |
/cases/ |
List all cases |
GET |
/risk/{id} |
Risk assessment |
GET |
/timeline/{id} |
Timeline events |
GET |
/graph/{id} |
Evidence graph |
GET |
/agents/status |
Agent status (7 agents) |
GET |
/agents/analysis/{id} |
Full multi-agent analysis |
POST |
/query/ |
Natural language query |
GET |
/custody/{id} |
Chain of custody |
WS |
/ws/{id} |
Real-time WebSocket |
๐ Deployment
Docker (Production)
docker build -t forensix-ai .
docker run -p 7860:7860 \
-e FEATHERLESS_API_KEY=your_key \
-e HF_TOKEN=your_token \
forensix-ai
HuggingFace Spaces
Push to any HF Space with Docker SDK โ auto-deploys.
Manual
pip install -r backend/requirements.txt
cd frontend && npm install && npm run build && cd ..
uvicorn backend.main:app --host 0.0.0.0 --port 7860
๐ก Novelties & Innovation
1. Digital Stratigraphy
Unlike existing forensic systems that separately analyze pathology reports OR digital evidence, ForensiX introduces a unified multimodal architecture that semantically correlates ALL evidence types into synchronized investigative layers.
2. Zero-Shot Forensic NER
Using GLiNER-biomed, investigators can define ANY custom entity type at runtime using natural language โ no model retraining needed. Want to detect "ligature material type"? Just add it to the label list.
3. GraphRAG-Enhanced AI Chat
Every AI response is grounded in verified forensic knowledge retrieved via semantic search. The LLM cannot hallucinate forensic facts because the system prompt is injected with authoritative knowledge nodes.
4. Cross-Case Serial Pattern Detection
Automated matching against historical case database identifies potential serial offenders by comparing MO patterns, weapon types, victim profiles, and behavioral signatures.
5. Explainable Risk Scoring
Every risk score is decomposable into SHAP-style attributions. Investigators can see EXACTLY which evidence drives the score โ legally defensible transparency.
6. Universal LLM Provider
Works with ANY provider (12+ supported). Investigators aren't locked into one AI vendor. Seamless fallback chain ensures the system never goes dark.
7. Offline-Capable Custom Models
Fine-tuned models run entirely on CPU without internet. Critical for sensitive investigations where data cannot leave the network.
โ๏ธ Ethical Considerations
- Advisory only: All outputs support human decision-making, never replace forensic experts
- No legal conclusions: System uses "suggests", "indicates", "consistent with" โ never "proves"
- Explainable: Every AI output traceable to specific evidence (SHAP attribution)
- Chain of custody: SHA-256 immutable ledger ensures evidence integrity
- Data privacy: Local-first architecture, cloud optional, no mandatory data sharing
- Bias awareness: Models trained on balanced synthetic data to avoid demographic bias
- Access control: JWT authentication, role-based permissions
๐ฎ Future Scope
| Enhancement | Status | Description |
|---|---|---|
| Real-time CCTV analysis | Planned | Live video feed processing with person detection |
| Multilingual report analysis | Planned | Hindi, Tamil, Spanish autopsy report parsing |
| Federated learning | Research | Secure cross-agency model training without data sharing |
| IoT sensor integration | Planned | Real-time environmental monitoring (temp, humidity) |
| Voice-to-text dictation | Planned | Hands-free field notes during investigation |
| Mobile companion app | Planned | On-scene evidence collection with GPS tagging |
| Behavioral profiling | Research | LSTM-based suspect behavior prediction |
| 3D wound reconstruction | Research | AR-based injury pattern visualization |
๐ Project Structure
forensic-ai-triage/
โโโ backend/
โ โโโ main.py # FastAPI app (55+ routes)
โ โโโ requirements.txt # Python dependencies
โ โโโ db/ # SQLAlchemy models + init
โ โโโ routers/ # 19 API routers
โ โ โโโ agents.py # Multi-agent endpoints
โ โ โโโ analyze.py # Full analysis (NLP+LLM+RAG)
โ โ โโโ chat.py # AI Chat with GraphRAG
โ โ โโโ intelligence.py # Unified intelligence engine
โ โ โโโ ml_pipeline.py # HuggingFace ML pipeline
โ โ โโโ graphrag.py # Knowledge base management
โ โ โโโ triage_stream.py # SSE progress events
โ โ โโโ ... (12 more routers)
โ โโโ services/ # Business logic
โ โโโ llm_provider.py # Universal LLM (12+ providers)
โ โโโ graphrag_service.py # 25-node knowledge base
โ โโโ multi_agent_orchestrator.py # 7-agent system
โ โโโ forensic_engine.py # Henssge + NLP + correlation
โ โโโ supabase_client.py # Cloud persistence
โ โโโ ... (8 more services)
โโโ frontend/
โ โโโ src/
โ โ โโโ pages/ (12 pages)
โ โ โโโ components/ (28 components)
โ โ โโโ lib/ (api.js, store.js, websocket.js)
โ โโโ package.json
โโโ custom-models/ # ๐ Custom AI Models
โ โโโ datasets/ # Training data (750+300 samples)
โ โโโ scripts/ # Training + inference code
โ โ โโโ generate_dataset.py # Synthetic data generator
โ โ โโโ train_classifier.py # DeBERTa-v3-small fine-tuning
โ โ โโโ train_extraction_model.py # Qwen2.5-0.5B + LoRA
โ โ โโโ inference.py # Unified local inference
โ โโโ models/ # Trained weights (after training)
โโโ lib/ # TypeScript engines (reference)
โโโ multi-agent-system/ # Full TS agent implementation
โโโ langgraph-agents/ # LangGraph Python server
โโโ prisma/ # PostgreSQL schema
โโโ Dockerfile # Multi-stage production build
โโโ nginx.conf # Reverse proxy config
โโโ .env.example # All provider configs
โโโ README.md # This file
๐ Performance Metrics
| Metric | Value |
|---|---|
| API Endpoints | 55+ routes, all verified 200 OK |
| Multi-Agent Analysis | 7 agents, ~16s total (with LLM) |
| NLP Entity Extraction | <100ms per report (regex) |
| Risk Scoring | <50ms computation |
| Graph Building | <200ms for full evidence graph |
| WebSocket Latency | <50ms real-time updates |
| Local ML Inference | <500ms (NER), <100ms (classifier) |
| Knowledge Retrieval | <10ms (keyword), <200ms (semantic) |
๐ก๏ธ Security
- Authentication: JWT (HS256) with configurable secret
- Evidence Integrity: SHA-256 hash chain (blockchain-style)
- Data Isolation: SQLite per-instance, no shared state
- API Security: CORS configured, rate limiting available
- Sensitive Data: All LLM calls use local context โ no case data sent to external APIs unless investigator explicitly uses AI Chat
Built for Justice. Powered by AI. Guided by Ethics.
ForensiX AI โ Investigative Assistance Only. Not for legal determination.
- Downloads last month
- 37