Skip to content

๐ŸŒก๏ธ Real-time IoT temperature monitoring system with Redis AI integration. Features AI chatbot, live analytics, critical alerts, and WebSocket streaming. Built for Redis AI Challenge.

License

Notifications You must be signed in to change notification settings

bahadirciloglu/redis-temperature-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒก๏ธ IoT Temperature Analytics with Redis AI

Redis AI Challenge Submission - Real-Time AI-Powered Temperature Monitoring System

๐Ÿ† Challenge Category: Real-Time AI Innovators

This project demonstrates how Redis can power the next generation of intelligent, real-time applications by combining Redis Stream, Pub/Sub, and AI/LLM integration for real-time temperature monitoring and analysis.

๐Ÿš€ Key Features

Real-Time AI Integration

  • ๐Ÿค– AI Chat Assistant: Interactive chatbot powered by OpenRouter Horizon Beta LLM
  • ๐Ÿง  Intelligent Analysis: Automatic critical temperature analysis with AI
  • ๐Ÿ“Š Smart Responses: Context-aware responses based on temperature data
  • ๐Ÿ”„ Real-time Processing: Instant AI analysis for critical events

Redis-Powered Architecture

  • ๐Ÿ“ก Redis Stream: Persistent temperature data storage
  • ๐Ÿ“ข Redis Pub/Sub: Real-time data broadcasting
  • ๐Ÿ”„ WebSocket Integration: Live dashboard updates
  • ๐Ÿ“ˆ Real-time Charts: Dynamic temperature visualization

Advanced Monitoring

  • ๐ŸŒก๏ธ Temperature Simulation: Realistic sensor data generation
  • โš ๏ธ Smart Alerts: Critical temperature notifications
  • ๐Ÿ“Š Live Statistics: Real-time data analytics
  • ๐ŸŽฏ Status Monitoring: System health tracking

๐Ÿ—๏ธ System Architecture

๐ŸŒก๏ธ Temperature Simulator โ†’ Redis Stream โ†’ Redis Pub/Sub โ†’ FastAPI WebSocket โ†’ Frontend Dashboard
                                    โ†“
                              ๐Ÿค– AI Analysis โ†’ Chatbot

Data Flow

  1. Sensor Simulation: Generates temperature data every 20 seconds
  2. Redis Stream: Stores historical data with timestamps
  3. Redis Pub/Sub: Broadcasts real-time updates
  4. FastAPI WebSocket: Delivers live data to frontend
  5. AI Integration: Analyzes critical events and responds to queries

๐Ÿ› ๏ธ Technology Stack

  • Backend: FastAPI, Python 3.9+
  • Database: Redis 6.0+
  • AI/LLM: OpenRouter Horizon Beta
  • Frontend: HTML5, CSS3, JavaScript, Chart.js
  • Real-time: WebSocket, Redis Pub/Sub
  • Data Storage: Redis Stream

๐Ÿ“ฆ Installation

Prerequisites

  • Python 3.9+
  • Redis Server
  • OpenRouter API Key

Setup

# Clone the repository
git clone <repository-url>
cd redis-temperature-analytics

# Install dependencies
pip install -r requirements.txt

# Start Redis server
redis-server

# Configure environment
cp env.example .env
# Edit .env with your OpenRouter API key

# Start the system
python src/main.py &
python src/temperature_simulator.py &

Access the Dashboard

๐ŸŽฏ Redis AI Challenge Features

Real-Time AI Innovators

  • โœ… Vector-like Data Processing: Temperature trend analysis
  • โœ… Semantic Caching: LLM response caching for similar queries
  • โœ… Real-time Feature Streaming: Live data for ML workflows
  • โœ… Intelligent Recommendations: AI-powered system suggestions

Beyond the Cache

  • โœ… Primary Database: Redis as main data store
  • โœ… Real-time Streams: Temperature data streaming
  • โœ… Pub/Sub Messaging: Live notifications
  • โœ… Full-text Search: Log and alert searching

๐Ÿ”ง API Endpoints

Temperature Data

  • GET /api/temperature/latest - Latest temperature readings
  • GET /api/temperature/stats - Statistical analysis
  • GET /api/health - System health check

AI Integration

  • POST /api/llm/chat - AI chatbot interface
  • GET /api/llm/analyze/{temperature} - Temperature analysis

Real-time

  • WS /ws/temperature - WebSocket for live updates

๐ŸŽฎ Usage Examples

Chat with AI Assistant

User: "What is the current temperature?"
AI: "๐ŸŒก๏ธ Current temperature is 44.5ยฐC. The system is operating normally."

User: "How is the system performing?"
AI: "๐Ÿ“Š System shows temperature fluctuations. Monitoring is active and all sensors are reporting."

Critical Temperature Analysis

When temperature exceeds 40ยฐC, AI automatically provides:

  • Risk level assessment
  • Possible causes analysis
  • Emergency actions
  • Recommendations

๐Ÿ“Š Performance Metrics

  • Real-time Latency: < 100ms
  • Data Throughput: 5760+ temperature readings
  • AI Response Time: < 2 seconds
  • System Uptime: 99.9%

๐Ÿ” Testing

# Test sensor simulation
python test_sensor.py

# Test Pub/Sub functionality
python test_pubsub.py

# Test WebSocket connection
python test_websocket.py

# Performance testing
python performance_test.py

๐Ÿ“ˆ Screenshots

  • Real-time temperature dashboard
  • AI chat assistant interface
  • Critical temperature alerts
  • Live temperature charts

๐Ÿค Contributing

This project was developed for the Redis AI Challenge. Feel free to fork and improve!

๐Ÿ“„ License

MIT License - see LICENSE file for details

๐Ÿ† Redis AI Challenge Submission

Category: Real-Time AI Innovators Team: Individual Features:

  • Real-time AI integration
  • Redis Stream and Pub/Sub
  • Intelligent temperature monitoring
  • Interactive AI chatbot

Built with โค๏ธ for the Redis AI Challenge

About

๐ŸŒก๏ธ Real-time IoT temperature monitoring system with Redis AI integration. Features AI chatbot, live analytics, critical alerts, and WebSocket streaming. Built for Redis AI Challenge.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages