EcoSense LG is an intelligent energy management platform that leverages AI agents and machine learning to monitor, analyze, and optimize building energy consumption. The system provides real-time anomaly detection, proactive recommendations, and automated alerts through Telegram integration.
- Real-time Energy Monitoring: Live simulation of building energy consumption with configurable focus on specific buildings
- AI-Powered Anomaly Detection: Multi-agent system using Ollama LLM for intelligent energy pattern analysis
- Proactive Recommendations: Automated generation of energy-saving suggestions based on detected anomalies
- Interactive Dashboard: Streamlit-based web interface for comprehensive energy operations management
- Agent Theater: Watch AI agents collaborate in real-time analysis with generative conversations
- Telegram Bot Integration: Receive instant alerts and control the system via Telegram
- Google Sheets Sync: Cloud-based data persistence and reporting
- Multi-Building Support: Analyze energy patterns across multiple buildings simultaneously
- Simulation Engine: Realistic energy consumption simulation with fault injection capabilities
- Local LLM Integration: Uses Ollama for privacy-preserving, offline AI capabilities
- Modular Architecture: Clean separation of concerns with agents, services, and UI components
- Extensible Pipeline: Pluggable nodes for detection, root cause analysis, action planning, and quality assurance
- Database Agnostic: Supports SQLite, PostgreSQL, and Google Sheets backends
EcoSense LG/
βββ dashboard/ # Streamlit web interface
β βββ app.py # Main application entry point
β βββ ui/ # UI components (charts, theater, etc.)
β βββ pages/ # Admin and data management pages
βββ src/ # Core application logic
β βββ agents/ # AI agent implementations
β βββ core/ # Digital twin and analytics
β βββ llm/ # LLM client and fine-tuning
β βββ nodes/ # Workflow pipeline nodes
β βββ rag/ # Retrieval-augmented generation
β βββ services/ # Business logic services
β βββ tools/ # Utility tools
βββ data/ # Sample data and configurations
βββ scripts/ # Utility scripts
βββ tests/ # Test suites
- Python 3.8+
- Ollama (for local LLM capabilities)
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/your-username/ecosense-lg.git cd ecosense-lg -
Set up Python environment:
python -m venv .venv .\.venv\Scripts\activate # On Windows # source .venv/bin/activate # On macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Install and configure Ollama:
# Download Ollama from https://ollama.ai/ ollama pull llama3.2:1b -
Configure environment variables: Create a
.envfile in the project root:# Telegram Bot (optional) TELEGRAM_TOKEN=your_telegram_bot_token MY_CHAT_ID=your_telegram_chat_id # Google Sheets (optional) GOOGLE_SHEET_ID=your_google_sheet_id GOOGLE_APPLICATION_CREDENTIALS=service_account.json
-
Start the Streamlit dashboard:
streamlit run dashboard/app.py
-
Access the application: Open your browser to
http://localhost:8501 -
Login credentials:
- Admin:
admin/admin123 - Operator 1:
operator1/op1 - Operator 2:
operator2/op2
- Admin:
- Login: Use the credentials above to access the system
- Building Selection: Choose a specific building or "All Buildings" from the sidebar
- Live Demo: Start the simulation to see real-time energy monitoring
- Agent Theater: Observe AI agents analyzing energy patterns
- Telegram Integration: Receive alerts and control via Telegram bot
- Start live simulation
- Agents automatically analyze energy streams
- View results in Agent Theater
- Receive Telegram alerts for anomalies
- Select target building from sidebar
- Restart simulation for focused analysis
- Review building-specific insights
- Access admin panel (admin role required)
- Generate PDF reports with energy analytics
| Variable | Description | Required |
|---|---|---|
TELEGRAM_TOKEN |
Telegram bot API token | No |
MY_CHAT_ID |
Telegram chat ID for alerts | No |
GOOGLE_SHEET_ID |
Google Sheets document ID | No |
GOOGLE_APPLICATION_CREDENTIALS |
Path to service account JSON | No |
Modify src/services/simulator.py to adjust:
- Simulation speed (seconds per hour)
- Fault injection frequency
- Data filtering parameters
EcoSense LG employs a sophisticated multi-agent system:
- Analyst Agent: Detects energy consumption anomalies
- Planner Agent: Cross-references anomalies with schedules
- Recommender Agent: Generates actionable energy-saving recommendations
- Action Planner: Creates implementation plans
- Critic Agent: Quality assurance and validation
- Synthesizer Agent: Final decision synthesis
All agents leverage Ollama's local LLM for intelligent analysis.
Run the test suite:
python -m pytest tests/The system includes sample datasets:
data/sample/building_energy_multi.csv: Multi-building energy consumption datadata/sample/users.csv: User account managementdata/sample/building_metadata.csv: Building specifications
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add tests for new features
- Update documentation as needed
- Ensure compatibility with Python 3.8+
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, issues, or contributions:
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: your-email@example.com
- Initial release with core energy management features
- Ollama LLM integration
- Multi-agent analysis system
- Streamlit dashboard
- Telegram bot integration
Built with β€οΈ for sustainable energy management