Multi-Agent Therapeutic AI · Real-Time Crisis Detection · HIPAA Compliant
Python · Go · PyTorch · Transformers · RAG · LLM · Microservices · PostgreSQL · Redis
A complete AI system I designed and built from scratch — 65K+ lines, 15 microservices, 7 therapeutic agents, 100% crisis detection recall
Every 11 minutes, a senior in assisted living experiences a mental health crisis. Most go unnoticed for 15-30 minutes — or longer.
I built Lilo Engine to ensure none go unnoticed. It's a production-ready AI platform that provides:
- 24/7 therapeutic companion with evidence-based interventions
- Real-time crisis detection in under 1 second (regulatory requirement: 30s)
- Instant care team alerts with severity-based escalation
- Full HIPAA compliance for healthcare deployment
|
Crisis Recall Zero false negatives on 871 test scenarios |
Intent Accuracy 214 prototypes, BGE semantic matching |
Lines of Code 15 microservices built in 4 months |
Complete Modules XAI, streaming, emotion detection |
AI Agents Evidence-based therapeutic interventions |
| You Are | Start Here | Then Explore |
|---|---|---|
| Recruiter / Hiring Manager | Technical Portfolio | Code Samples |
| Investor / Partner | Executive Summary | Investor Overview |
| Engineer | Process Flow | Technical Portfolio |
| Healthcare Professional | Demo Showcase | FAQ |
|
|
| Metric | Value |
|---|---|
| Total Addressable Market | $3T+ (Elderly Care + Mental Health) |
| Target Market | 30,600 US Assisted Living Facilities |
| Revenue Potential | $720M-2.16B ARR at scale |
| Unit Economics | $50-75/resident/month |
| Facility ROI | $50K-150K annual savings per 100 beds |
| Path to $1M ARR | 30 facilities by Dec 2027 |
Full Market Analysis | Partnership Models
| Milestone | Status | Date |
|---|---|---|
| Platform Architecture (15 services, 65K+ lines) | ✅ Complete | Done |
| HIPAA Compliance (§164.312) | ✅ Complete | Done |
| Crisis Detection (100% recall) | ✅ Validated | Done |
| 9 Additional Modules (XAI, streaming, emotion) | ✅ Complete | Dec 2025 |
| Module Integration & Edge Prototype | 🔄 In Progress | Feb 2026 |
| Pilot Study (n=20) | 📋 Planned | Apr 2026 |
| First Enterprise Contracts (3 facilities) | 📋 Planned | Jul 2026 |
| FDA De Novo Submission | 📋 Planned | Oct 2026 |
| FDA Clearance (target) | 📋 Planned | Q2-Q3 2027 |
Built with founder's capital — $875K-$1.7M equivalent value, $0 external funding
Complete platform architecture showing all 15 microservices (14 Docker + 1 Host), data flows, and integration points
View Interactive Mermaid Diagrams
flowchart LR
Client[Clients] --> Gateway[API Gateway<br/>NGINX + Auth]
Gateway --> AI[AI Router<br/>Intent + Crisis]
AI --> Processing[Core Processing<br/>Safety · Agents · RAG]
Processing --> LLM[Generation<br/>Qwen 2.5-7B]
LLM --> Data[(Data Layer<br/>PostgreSQL + Redis)]
style AI fill:#ff6b6b,color:#fff
style Processing fill:#4ecdc4,color:#fff
style LLM fill:#96ceb4,color:#fff
flowchart TB
subgraph Clients["CLIENT LAYER"]
C1["6 Healthcare Dashboards"]
C2["WebSocket Chat"]
C3["Voice Interface"]
C4["REST API"]
end
subgraph Gateway["API GATEWAY"]
G1["NGINX + Rate Limiting"]
G2["JWT Auth + RBAC"]
G3["HIPAA Middleware"]
end
subgraph AI["AI ROUTER - Port 8100"]
direction TB
A1["Intent Classification"]
A2["Crisis Detection"]
A3["Agent Orchestrator"]
end
subgraph Core["CORE PROCESSING"]
subgraph Safety["SAFETY LAYER"]
S1["Crisis Detector V4"]
S2["Trajectory Analysis"]
S3["Clinical Context"]
end
subgraph Agents["7 THERAPEUTIC AGENTS"]
AG1["Behavioral Activation"]
AG2["Reminiscence"]
AG3["Grounding"]
AG4["Safety Assessment"]
end
subgraph RAG["RAG PIPELINE"]
R1["Knowledge Base"]
R2["Life Story"]
R3["Clinical Assessments"]
R4["Chat History"]
end
end
subgraph Gen["GENERATION LAYER"]
E1["BGE Embeddings<br/>Port 8005"]
L1["Qwen 2.5-7B LLM<br/>Port 8006"]
V1["Whisper + Piper<br/>Port 8007"]
end
subgraph Data["DATA LAYER"]
D1[("PostgreSQL 16<br/>+ pgvector")]
D2[("Redis 7<br/>Cache + PubSub")]
D3["Langfuse<br/>Observability"]
end
Clients --> Gateway
Gateway --> AI
AI --> Safety
AI --> Agents
AI --> RAG
Safety --> Gen
Agents --> Gen
RAG --> Gen
Gen --> Data
style Safety fill:#ff6b6b,color:#fff
style Agents fill:#4ecdc4,color:#fff
style RAG fill:#45b7d1,color:#fff
style Gen fill:#96ceb4,color:#fff
|
AI/ML
|
Backend
|
AI Models
|
| Category | Technologies | Evidence |
|---|---|---|
| AI/ML | PyTorch, Transformers, RAG, BGE Embeddings, XAI | Crisis Detection |
| Backend | Python (FastAPI), Go (Gin), WebSockets | Code Samples |
| Data | PostgreSQL, pgvector (768-dim), Redis, Vector Search | Process Flow |
| Infrastructure | Docker (14 services), Edge Deployment, HIPAA Compliance | Architecture |
| LLM Engineering | Qwen 2.5-7B, Streaming, Context Management, Caching | Technical Portfolio |
The safety-first architecture processes every message through the crisis detection pipeline before any other operation:
| Detection Layer | Method | Performance |
|---|---|---|
| Semantic Matching | BGE embeddings against 871 crisis patterns (214 crisis + 657 non-crisis) | <50ms |
| Clinical Context | PHQ-9, GAD-7, UCLA-3, life story risk factors | Integrated |
| Trajectory Analysis | 5-message sliding window for deterioration | Real-time |
| 4-Level Stratification | IMMEDIATE → URGENT → ELEVATED → MODERATE | <1s total |
| Risk Level | Response Time | Actions |
|---|---|---|
| 🔴 IMMEDIATE | <30s (regulatory) | Auto-escalate 911, emergency protocol |
| 🟠 URGENT | <5 minutes | Physician + nurse notification, C-SSRS assessment |
| 🟡 ELEVATED | <1 hour | Physician + social worker, enhanced monitoring |
| 🟢 MODERATE | <24 hours | Routine monitoring, schedule follow-up |
Result: 100% recall (zero missed crises), <5% false positive rate
Full implementation of HIPAA §164.312 Technical Safeguards:
| Requirement | Implementation |
|---|---|
| Access Control | JWT + Redis token blacklist, 15-min sessions |
| Audit Controls | Tamper-proof logging with HMAC chains |
| Integrity | End-to-end verification |
| Transmission Security | TLS 1.3 |
| Document | Audience | Description |
|---|---|---|
| Technical Architecture Brief | CTOs/Architects | Comprehensive 9-section technical deep-dive + 12 appendices |
| Demo Showcase | Everyone | 33+ screenshots of all dashboards |
| Technical Portfolio | Engineers/Recruiters | 12 engineering deep-dives |
| Code Samples | Engineers | Production code patterns |
| Process Flow | Tech Evaluators | Complete 11-step request flow |
| Executive Summary | Investors/Partners | 1-page overview |
| Investor Overview | Investors | Market opportunity & roadmap |
| FAQ | Everyone | Common questions answered |
This is a showcase repository for the Lilo Engine platform. The full source code is proprietary and maintained in a private repository.
What's demonstrated here:
- System architecture and design decisions
- Technical capabilities and performance metrics
- Production UI screenshots
- Code patterns and engineering approaches
I'm open to opportunities in AI/ML Engineering, Healthcare Technology, and Backend Systems.
| Interest | Action |
|---|---|
| Technical Discussion | Review Technical Portfolio then connect on LinkedIn |
| Investment Inquiry | Read Executive Summary then schedule a discussion |
| Partnership Opportunity | Explore Partnership Models then reach out |
Built by Aejaz Sheriff · AI/ML Engineer · Healthcare AI Specialist
Python · Go · PyTorch · Transformers · LLM · RAG · Multi-Agent AI · Healthcare AI · HIPAA · Microservices · Crisis Detection · Real-time Systems
