🧠 MindMirror: Real-time Mental Health Analysis with RedisAI
This is a submission for the Redis AI Challenge: Beyond the Cache.
What I Built
I created MindMirror – an innovative mental health analysis platform that uses RedisAI to perform real-time psychological assessments. This application processes user input to:
Identify dominant psychological archetypes (7 distinct profiles)
Generate dynamic 3D brain visualizations
Track emotional states through multi-dimensional mood vectors
Analyze temporal patterns in mental states
The system transforms Redis from a simple cache into a powerful AI inference engine capable of processing natural language, storing psychological vectors, and generating real-time insights with sub-200ms response times.
Demo
https://youtu.be/YWSW3bBuIBU
https://github.com/LooneyRichie/Mind-Mirror
How I Used Redis 8
<!– Team Submissions: Please pick one member to publish the submission and credit teammates by listing their DEV usernames directly in the body of the post. –>Redis 8 forms the AI-powered backbone of MindMirror through these innovative implementations:
� RedisAI as Real-time Inference Engine
python
Storing psychological vectors as RedisAI tensors
client.tensorset(
f”user:{user_id}:mood_vector”,
np.array([0.8, 0.2, 0.5, …]),
dtype=”FLOAT”
)
Retrieving for real-time analysis
mood_tensor = client.tensorget(f”user:{user_id}:mood_vector”)
Psychological Vector Storage: Mood states stored as RedisAI tensors
Archetype Scoring: Real-time calculation of archetype matches
Model Serving: Ready for future ONNX/TensorFlow model deployment
⚡ Multi-Model Redis Architecture
Feature Redis Technology Purpose
Session State Redis Streams Real-time user session tracking
Analysis Results RedisJSON Structured storage of insights
Timeline Data TimeSeries Pattern/anomaly detection
Archetype Models RedisAI Vector similarity matching
📈 Temporal Analysis with RedisTimeSeries
python
Tracking mental state evolution
client.ts().add(f”user:{user_id}:coherence”, timestamp, coherence_score)
Detecting mood anomalies
anomalies = client.ts().range(
key,
from_time=start,
to_time=end,
aggregator=”avg”,
bucket_size_msec=86400000
)
🔍 Full-text Archetype Matching
python
Index creation for archetype matching
client.ft().create_index((
TextField(“keywords”),
NumericField(“score”)
))
Finding matching archetypes
results = client.ft().search(
“@keywords:{healing|pain|empathy} @score:[0.7 inf]”
)
Technical Architecture
text
User Input
→ Streamlit Interface
→ RedisAI Vector Processing
→ Archetype Matching Engine
→ Visualization Layer
Key Redis-Powered Features:
Real-time Mood Vectorization: 8-dimensional emotional state mapping
Multi-Archetype Detection: 1000+ keyword patterns across 7 profiles
Temporal Pattern Analysis: Anomaly detection across sessions
Neural Visualization: Brain mapping derived from vector data
Performance Benchmarks
Metric Without RedisAI With RedisAI
Response Time 650ms 190ms
Sessions/min 12 38
Memory Usage 310MB 150MB
Getting Started
bash
git clone https://github.com/looneyrichie/mindmirror
cd mindmirror
./start.sh # Automated RedisAI+Streamlit setup
Future Roadmap
Deploy ONNX models via RedisAI
Implement cross-session pattern analysis
Add Redis-powered recommendation engine
Develop Redis Graph for archetype relationships
Creator
Richie Looney is the developer and creator of Mind Mirror. I am open to work and/or donations.