avtak/depression-detection
0
๐ง Early Depression Detection MCP Agent
Hackathon: MCP 1st Birthday - Track 2: MCP in Action (Consumer) Author: Hassan Hassanzadeh Aliabadi | LinkedIn
๐น Demo Video
๐ฏ Project Description
This MCP-enabled agent detects depression risk from social media text by orchestrating specialized tools and LLM reasoning. It is built on Master's thesis research and is rigorously validated, achieving an F1-score of 0.7668 on the eRisk 2025 test data.
๐ค Multi-Provider Agent Architecture (MCP in Action)
The agent operates in a two-tier structure:
- Tool Layer (The "Eyes"):
- Tool:
detect_depression_risk(My Longformer model). - Capability: 4,096-token context window for long user timelines.
- Core Logic: Implements thesis-derived thresholds (0.4 / 0.6) and classification based on behavioral patterns.
- Reasoning Layer (The "Brain"):
- Purpose: Provides empathetic, research-backed interpretation.
- Providers: Uses SambaNova (Meta-Llama-3.3) and Nebius (Kimi K2) via the same
OpenAIclient for enhanced robustness and sponsor stacking.
๐งช Thesis Findings Integrated
The agent doesn't just output a probability; it looks for and reports on specific linguistic biomarkers identified in my Master's Thesis:
- "Nocturnal Posting" & "High-Effort, Low-Frequency": The primary behavioral signature of high-risk users.
- "Echo Chamber Interaction": The signature of moderate-risk, supportive users engaging with high-risk topics (11.7x higher interaction rate).
๐ Research Background
Built on Master's thesis research at University of Malaya:
- Model:
avtak/erisk-longformer-depression-v1. - Validation: Rigorous 5-fold cross-validation.
- Data Augmentation: Used Gemini 2.5 Flash Lite to balance the depressed class.
โ ๏ธ Ethical Considerations
This is a research tool, not a medical diagnostic instrument. Crisis Resources:
- ๐ Crisis Text Line: Text HOME to 741741 (US)
- ๐ International: befrienders.org
