EdgeBrain

agent
Guvenlik Denetimi
Uyari
Health Uyari
  • License รขโ‚ฌโ€ License: MIT
  • Description รขโ‚ฌโ€ Repository has a description
  • Active repo รขโ‚ฌโ€ Last push 0 days ago
  • Low visibility รขโ‚ฌโ€ Only 6 GitHub stars
Code Gecti
  • Code scan รขโ‚ฌโ€ Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions รขโ‚ฌโ€ No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

๐Ÿง  EdgeBrain โ€” Lightweight edge AI inference engine. Run ML models locally with sub-100ms latency. No cloud. No API keys. Just fast, private AI.

README.md

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

๐Ÿง  EdgeBrain โ€” AI-Powered Edge Intelligence Platform

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Autonomous real-world decision systems. Runs locally. No paid APIs required.

https://github.com/rudra496/EdgeBrain

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

Version



A comprehensive open-source edge AI platform.

Simulate โ†’ Process โ†’ Decide โ†’ Act โ€” all locally, all free.

CI
Release
License
Docker Pulls
Python
FastAPI
React
PostgreSQL
Redis
MQTT
Stars
Forks
Issues
Free & Open Source
No Cloud
Local First
Privacy


Zero paid APIs ยท Zero cloud lock-in ยท Zero proprietary dependencies


๐ŸŽฌ Demo

EdgeBrain Dashboard Demo

# Clone & run in under 2 minutes
git clone https://github.com/rudra496/EdgeBrain.git && cd EdgeBrain
docker compose up --build -d
# Open http://localhost:3000 โ€” done.

What you'll see:

  • ๐ŸŒก๏ธ Live temperature, humidity, energy, light charts
  • ๐Ÿค– AI agents making decisions in real-time
  • ๐Ÿšจ Alerts firing when anomalies are detected
  • ๐Ÿ’ก Lights auto-on with motion, auto-off after 5 min
  • ๐ŸŒ€ Fan activation when temperature exceeds 30ยฐC
  • ๐Ÿ“Š Full agent message pipeline visualization

โœจ Features

๐Ÿ  Smart Device Simulation (11 devices)
  • 3 rooms โ€” Living Room (5 sensors), Bedroom (3 sensors), Server Room (3 sensors)
  • 5 sensor types โ€” Temperature, Motion, Energy, Humidity, Light
  • Realistic patterns โ€” circadian rhythms, Gaussian noise, mean reversion
  • Rare event simulation โ€” temperature spikes (1%), energy surges (0.5%)
  • Configurable โ€” base values, noise scale, spike probability per device
  • Time-aware โ€” energy peaks during work hours, light follows sunrise/sunset
๐Ÿค– Multi-Agent AI System
  • Data Agent โ€” validates ranges, stores readings, routes to decision pipeline
  • Decision Agent โ€” runs all strategies, deduplicates, ranks by confidence
  • Action Agent โ€” creates alerts, sends MQTT commands, updates actuator state
  • Message Bus โ€” full queryable log with agent performance tracking
  • Per-agent metrics โ€” average processing time, message count, error rate
๐Ÿง  AI Decision Engine (3 strategies)
  • Threshold Rules โ€” configurable per device type, with hysteresis to prevent flapping
  • Anomaly Detection โ€” 3 statistical methods vote: Z-Score, IQR, Gradient
    • Requires 2+ methods to agree (reduces false positives by ~70%)
  • No-Motion Timeout โ€” turns off lights after configurable inactivity period
  • Plugin Architecture โ€” add custom strategies via DecisionStrategy interface
    • Just implement evaluate() and name โ€” that's it
๐Ÿ“ˆ Predictive Analytics
  • Trend Prediction โ€” linear regression on recent readings to forecast next value
  • Moving Averages โ€” SMA and EMA for smoothing noisy sensor data
  • Anomaly Score โ€” combined confidence from all detection methods
  • Forecasting โ€” 10-step ahead prediction for temperature and energy
๐Ÿ“Š Real-Time Dashboard (5 pages)
  • Dashboard โ€” stats overview, live charts, event feed, recent alerts
  • Devices โ€” all sensor states with room grouping, online/offline status
  • Analytics โ€” historical charts, trend predictions, device comparisons
  • Agents โ€” pipeline visualization, message log, strategy config, performance
  • Settings โ€” system configuration, thresholds, export data, system info
๐Ÿ”Œ Communication & Integration
  • MQTT 3.1.1 โ€” topic-based architecture with QoS support
  • WebSocket โ€” real-time bidirectional dashboard updates
  • REST API โ€” 20+ endpoints with auto-generated OpenAPI docs
  • Data Export โ€” CSV and JSON export for any device's readings
  • Webhook Support โ€” configurable webhook for alert notifications
๐Ÿ—๏ธ Production Infrastructure
  • Docker Compose โ€” 6 services, health checks, restart policies, volumes
  • PostgreSQL โ€” composite indexes, JSONB fields, time-series optimized
  • Redis โ€” event queuing, pub/sub, alert cache, live telemetry
  • GitHub Actions โ€” CI (tests + lint) + Release (Docker + Git tag)
  • Makefile โ€” one-command operations: make dev, make test, make release
๐Ÿ”ง Optional Hardware
  • ESP32 firmware โ€” Arduino C++ with WiFi + MQTT
  • DHT11 โ€” temperature sensor (code simulated by default, real sensor supported)
  • PIR โ€” passive infrared motion sensor
  • LED โ€” actuator indicator
  • Configurable โ€” just edit WiFi + MQTT credentials

โšก Quick Start

Prerequisites

Install & Run

git clone https://github.com/rudra496/EdgeBrain.git
cd EdgeBrain
docker compose up --build -d

Or use Make

make setup        # Clone (if not already), build, and start
make dev          # Start in development mode
make test         # Run test suite
make logs         # Tail all service logs
make stop         # Stop all services
make clean        # Stop + remove volumes

Access Points

Service URL Description
๐Ÿ–ฅ๏ธ Dashboard http://localhost:3000 React real-time dashboard
๐Ÿ“ก Swagger API http://localhost:8000/docs Interactive API explorer
๐Ÿ“– ReDoc http://localhost:8000/redoc Alternative API docs
โค๏ธ Health http://localhost:8000/api/v1/health System health check
๐Ÿ MQTT localhost:1883 Mosquitto broker
๐Ÿ“ก MQTT/WS localhost:9001 MQTT over WebSocket

Verify Everything

# Health check
curl -s http://localhost:8000/api/v1/health | python3 -m json.tool

# System statistics
curl -s http://localhost:8000/api/v1/stats | python3 -m json.tool

# Device list
curl -s http://localhost:8000/api/v1/devices | python3 -m json.tool

# Recent alerts
curl -s http://localhost:8000/api/v1/alerts | python3 -m json.tool

# Agent performance
curl -s http://localhost:8000/api/v1/agents/stats | python3 -m json.tool

๐Ÿ—๏ธ Architecture

graph TB
    subgraph Edge["๐Ÿ”Œ Edge Layer"]
        S1["๐ŸŒก๏ธ Temp โ€” Room 1"]
        S2["๐Ÿƒ Motion โ€” Room 1"]
        S3["โšก Energy โ€” Room 1"]
        S4["๐Ÿ’ง Humidity โ€” Room 1"]
        S5["โ˜€๏ธ Light โ€” Room 1"]
        S6["๐ŸŒก๏ธ Temp โ€” Room 2"]
        S7["๐Ÿƒ Motion โ€” Room 2"]
        S8["โšก Energy โ€” Room 2"]
        S9["๐ŸŒก๏ธ Temp โ€” Server Room"]
        S10["๐Ÿ’ง Humidity โ€” Server Room"]
        S11["โšก Energy โ€” Server Room"]
        ESP["๐Ÿ“ก ESP32 โ€” Optional"]
    end

    subgraph Comms["๐Ÿ“ก Communication Layer"]
        MQTT["Mosquitto MQTT 3.1.1"]
    end

    subgraph BE["๐Ÿง  Backend (FastAPI)"]
        API["REST + WebSocket API"]
        PIPE["Data Pipeline"]
        EVT["Event Engine"]
        EXEC["Execution Engine"]
        PRED["Prediction Engine"]
    end

    subgraph AI["๐Ÿค– AI / Decision Engine"]
        DA["Data Agent"]
        DEC["Decision Agent"]
        AA["Action Agent"]
        RULE["Rule Engine<br/>+ Hysteresis"]
        ANOM["Anomaly Detector<br/>Z-Score ยท IQR ยท Gradient"]
        PREDAI["Predictor<br/>Linear Regression"]
        PLUG["Plugin System"]
    end

    subgraph Data["๐Ÿ’พ Data Layer"]
        PG[("PostgreSQL 16")]
        REDIS[("Redis 7")]
    end

    subgraph FE["๐Ÿ–ฅ๏ธ Frontend"]
        DASH["React Dashboard<br/>5 Pages ยท WebSocket"]
    end

    S1 & S2 & S3 & S4 & S5 & S6 & S7 & S8 & S9 & S10 & S11 & ESP -->|"device/+/data"| MQTT
    MQTT -->|"subscribe"| PIPE
    PIPE -->|"store"| PG
    PIPE -->|"route"| DA
    DA -->|"validate"| DEC
    RULE & ANOM & PREDAI --> DEC
    PLUG --> DEC
    DEC -->|"decisions"| AA
    AA -->|"alerts"| EVT
    AA -->|"commands"| EXEC
    EVT --> REDIS
    REDIS -->|"broadcast"| DASH
    EXEC -->|"device/+/command"| MQTT
    MQTT -->|"actuate"| S1 & S2 & S3
    API <-->|"HTTP/WS"| DASH
    API --> PG
    API --> REDIS

Decision Pipeline

sequenceDiagram
    participant S as Sensor
    participant M as MQTT
    participant DA as Data Agent
    participant DB as PostgreSQL
    participant DEC as Decision Agent
    participant AA as Action Agent
    participant A as Alert/Redis
    participant CMD as MQTT Command
    participant ACT as Actuator

    S->>M: device/room-1/data {temp: 35ยฐC}
    M->>DA: route message
    DA->>DA: validate range
    DA->>DB: store reading
    DA->>DEC: evaluate(device, type, value)
    DEC->>DEC: ThresholdStrategy โ†’ fan ON
    DEC->>DEC: AnomalyDetector โ†’ normal
    DEC->>DEC: deduplicate + rank
    DEC->>AA: [Decision: activate fan]
    AA->>A: push alert to Redis
    AA->>CMD: device/room-1-actuator-fan/command
    CMD->>ACT: activate fan
    A-->>Dashboard: WebSocket broadcast

๐Ÿ“ Project Structure

EdgeBrain/
โ”œโ”€โ”€ .github/
โ”‚   โ”œโ”€โ”€ ISSUE_TEMPLATE/
โ”‚   โ”‚   โ”œโ”€โ”€ bug_report.yml          # Structured bug reports
โ”‚   โ”‚   โ””โ”€โ”€ feature_request.yml     # Structured feature requests
โ”‚   โ””โ”€โ”€ PULL_REQUEST_TEMPLATE.md    # PR checklist
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ api/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ routes.py           # 20+ REST endpoints + WebSocket
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ schemas.py          # Pydantic request/response models
โ”‚   โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ config.py           # Settings with env vars
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ database.py         # SQLAlchemy engine + sessions
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ mqtt_client.py      # Thread-safe MQTT with reconnect
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ events.py           # Redis queue + pub/sub
โ”‚   โ”‚   โ”œโ”€โ”€ ai/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ rules.py            # Rule engine + hysteresis + plugin
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ anomaly.py          # Z-Score + IQR + Gradient detection
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ prediction.py       # Linear regression + forecasting
โ”‚   โ”‚   โ”œโ”€โ”€ agents/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ multi_agent.py      # Data โ†’ Decision โ†’ Action pipeline
โ”‚   โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ models.py           # 5 SQLAlchemy models + indexes
โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ingestion.py        # Data validation + storage
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ execution.py        # Commands + alerts + actuator state
โ”‚   โ”‚   โ””โ”€โ”€ main.py                 # FastAPI app + lifespan
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”‚   โ”œโ”€โ”€ test_ai.py              # 20+ AI engine tests
โ”‚   โ”‚   โ””โ”€โ”€ test_api.py             # API endpoint tests
โ”‚   โ”œโ”€โ”€ requirements.txt
โ”‚   โ””โ”€โ”€ Dockerfile
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.js                  # Main app + 5-page router
โ”‚   โ”‚   โ”œโ”€โ”€ App.css                 # Complete dark theme design system
โ”‚   โ”‚   โ””โ”€โ”€ index.js                # React entry point
โ”‚   โ”œโ”€โ”€ public/index.html
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ Dockerfile
โ”‚
โ”œโ”€โ”€ device-simulator/
โ”‚   โ””โ”€โ”€ simulator.py                # 11 devices, 3 rooms, realistic data
โ”‚
โ”œโ”€โ”€ simulator/
โ”‚   โ””โ”€โ”€ Dockerfile                  # Simulator container
โ”‚
โ”œโ”€โ”€ esp32-firmware/
โ”‚   โ”œโ”€โ”€ main/main.ino               # ESP32 Arduino firmware
โ”‚   โ””โ”€โ”€ README.md                   # Hardware setup guide
โ”‚
โ”œโ”€โ”€ docker/
โ”‚   โ”œโ”€โ”€ init.sql                    # Database schema + indexes
โ”‚   โ””โ”€โ”€ mosquitto.conf              # MQTT broker config
โ”‚
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md             # Detailed system design
โ”‚   โ”œโ”€โ”€ SETUP.md                    # Setup with/without Docker
โ”‚   โ””โ”€โ”€ ROADMAP.md                  # Development roadmap
โ”‚
โ”œโ”€โ”€ Makefile                        # Convenience commands
โ”œโ”€โ”€ docker-compose.yml              # 6-service orchestration
โ”œโ”€โ”€ LICENSE                         # MIT
โ”œโ”€โ”€ CODE_OF_CONDUCT.md              # CoC
โ”œโ”€โ”€ CONTRIBUTING.md                 # Contribution guide
โ””โ”€โ”€ README.md                       # This file

๐Ÿ”Œ Custom Strategies

from app.ai.rules import DecisionStrategy, Decision

class MyCustomStrategy(DecisionStrategy):
    """Example: Alert when humidity exceeds threshold."""

    @property
    def name(self) -> str:
        return "humidity_alert"

    def evaluate(self, device_id, device_type, value, history):
        if device_type != "humidity":
            return []

        if value > 80:
            return [Decision(
                action="activate",
                device_id=device_id,
                params={"actuator": "alarm"},
                reason=f"High humidity: {value:.1f}%",
                confidence=0.85,
                severity="warning",
                source=self.name,
            )]
        return []

# Register:
from app.agents.multi_agent import agents
agents.engine.add_strategy(MyCustomStrategy())

๐Ÿ› ๏ธ Tech Stack

Layer Technology Version Purpose
Backend Python 3.11+ Runtime
Framework FastAPI 0.110 Async REST + WebSocket
Database PostgreSQL 16 Time-series storage
Cache Redis 7.2 Queue, pub/sub, cache
Messaging Mosquitto 2.0 MQTT broker
AI/Math NumPy + SciPy 1.26 / 1.12 Anomaly detection, prediction
Frontend React 18.3 Dashboard UI
Charts Recharts 2.12 Real-time visualizations
Icons Lucide 0.344 Icon library
Infra Docker Compose 2.x Local orchestration
Hardware ESP32 Arduino Optional real sensors

๐Ÿ“– Documentation

Document Description
Architecture System design, data flow, plugin system
Setup Guide Docker + native setup instructions
Roadmap Future plans and milestones
Contributing How to contribute code
API Reference Interactive Swagger (when running)

๐Ÿš€ Release Strategy

Releases are versioned using Semantic Versioning:

  • v1.x.x โ€” Current stable. Core features complete.
  • v2.x.x โ€” Planned: distributed edge, TimescaleDB, Grafana.
  • v3.x.x โ€” Planned: plugin marketplace, multi-tenant.

See Releases for changelog.


๐Ÿค Contributing

We โค๏ธ contributions! See CONTRIBUTING.md.

# Fork, branch, code, PR
git clone https://github.com/rudra496/EdgeBrain.git
cd EdgeBrain
make dev      # Start development environment
make test     # Run tests
# Make changes, then open PR

Contributors

Thanks to all contributors! Your PRs make EdgeBrain better.

Contributors


๐Ÿ“„ License

MIT โ€” free for personal and commercial use.


โญ Star History

Star History Chart

EdgeBrain โ€” Intelligence at the edge, not the cloud.

Built with ๐Ÿ”ง by Rudra


More Open Source Projects

Project Stars Description
StealthHumanizer Stars Free AI text humanizer โ€” 13 providers, no login
DevRoadmaps Stars 17 career paths, 1700+ free resources
CodeVista Stars AI code analysis & security scanner
Nexus Agent Stars Self-evolving local AI agent framework
MindWell Stars Free mental health support platform
ScienceLab 3D Stars 40+ virtual STEM experiments
SightlineAI Stars AI smart glasses for the blind

Yorumlar (0)

Sonuc bulunamadi