Autonomous AIOps platform that monitors microservices, detects anomalies with deep learning, and self-heals infrastructure β without human intervention.
Overview Β· Architecture Β· Tech Stack Β· Quick Start Β· ML Model Β· Kubernetes Β· CI/CD
Modern distributed systems run hundreds of microservices. When one degrades, a DevOps engineer gets paged at 2 AM, manually investigates logs, and applies a fix. This is reactive, slow, and doesn't scale.
NeuralOps implements the full AIOps lifecycle:
| Stage | What Happens |
|---|---|
| π Observe | 5 FastAPI microservices emit Prometheus metrics |
| π Stream | Prometheus β Kafka bridge delivers a real-time metrics stream |
| π§ Detect | An LSTM Autoencoder learns normal behaviour and flags deviations |
| π Alert | Anomaly scores are published to a Kafka topic and the dashboard |
| π§ Remediate | A rule-based engine restarts, scales, or rolls back affected pods |
| π Track | MLflow logs every experiment; Grafana visualises everything |
| π Adapt | Evidently AI detects data drift daily and triggers auto-retraining |
Every component in this project mirrors what Google, Netflix, and Datadog run at scale.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NeuralOps Pipeline β
β β
β ββββββββββββββββ /metrics ββββββββββββββ exporter βββββββββββ β
β β 5Γ FastAPI ββββββββββββΆβ Prometheus βββββββββββββΆβ Kafka β β
β β Microsvcs β ββββββββββββββ β Stream β β
β ββββββββββββββββ ββββββ¬βββββ β
β β β
β metrics-stream β
β β β
β βββββββββΌβββββββ β
β β LSTM β β
β β Autoencoder β β
β β (PyTorch) β β
β βββββββββ¬βββββββ β
β β β
β anomaly-alerts β
β β β
β βββββββββΌβββββββ β
β β Remediation β β
β β Engine β β
β βββββββββ¬βββββββ β
β β β
β restart / scale / rollbackβ
β β β
β βββββββββΌβββββββ β
β β Kubernetes β β
β β Cluster β β
β ββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Evidently Drift Monitor (daily CronJob) β β
β β training dist. vs production β auto-retrain if drifted β β
β β new model promoted only if F1 improves β ArgoCD deploys β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Technology | Role | Design Rationale |
|---|---|---|
| FastAPI | Microservices | Async-first, auto-generated OpenAPI docs, Pydantic validation β faster than Flask for I/O-bound services |
| Prometheus | Metrics collection | Pull-based scraping, native Kubernetes integration, powerful PromQL |
| Apache Kafka | Metrics streaming | Durable, replayable event log β decouples producers from consumers in a way SQS/RabbitMQ cannot |
| PyTorch LSTM Autoencoder | Anomaly detection | Learns temporal patterns across sliding windows; simple static thresholds miss gradual degradation |
| MLflow | Experiment tracking & model registry | Open-source, self-hostable, integrates natively with PyTorch |
| Evidently AI | Data drift detection | Purpose-built for ML monitoring with built-in statistical tests |
| Kubernetes | Orchestration | Industry standard; enables self-healing via native pod restart and HPA |
| Terraform | Infrastructure as Code | Declarative, state-managed provisioning with a rich provider ecosystem |
| ArgoCD | GitOps deployments | Git as the single source of truth, automatic sync, full audit trail |
| GitHub Actions | CI/CD | Native to GitHub β no separate server to maintain |
| Grafana | Observability dashboards | Best-in-class time-series visualisation |
Languages: Python 60.7% Β· TypeScript 20.2% Β· HCL 7.6% Β· JavaScript 4.2% Β· Makefile 2.8% Β· CSS 2.3%
neuralops/
βββ frontend/ # React + TypeScript observability dashboard
β βββ src/
β β βββ components/ # ServiceCard, LiveChart, AnomalyScorePanel, β¦
β β βββ App.tsx # Main app β 4 tabs
β β βββ api.ts # API client (auto-falls back to mock data)
β β βββ mockData.ts # Offline demo data
β β βββ types.ts # Shared TypeScript types
β βββ api-gateway/
β β βββ main.py # FastAPI gateway β aggregates Prometheus, MLflow, audit logs
β βββ Dockerfile # Multi-stage: build β nginx
β βββ nginx.conf
β
βββ services/ # 5Γ FastAPI microservices + shared base
β βββ base_service.py # Shared Prometheus metrics + chaos mode
β βββ user-service/
β βββ order-service/
β βββ payment-service/ # Intentionally higher latency (chaos demo)
β βββ inventory-service/
β βββ notification-service/
β βββ Dockerfile.template
β
βββ ml/
β βββ model.py # LSTM Autoencoder (PyTorch)
β βββ data_generator.py # Synthetic training data
β βββ train.py # Training loop + MLflow experiment logging
β βββ inference_server.py # FastAPI /predict endpoint
β βββ kafka_consumer.py # Reads metrics-stream, publishes anomaly alerts
β
βββ streaming/
β βββ metrics_exporter.py # Prometheus β Kafka bridge
β βββ consumer_debug.py # Debug: print all Kafka messages
β
βββ remediation/
β βββ engine.py # Rule-based Kubernetes auto-remediation
β
βββ drift/
β βββ drift_detector.py # Evidently drift reports + retrain trigger
β βββ retrain.py # Automated retraining pipeline
β
βββ infra/
β βββ terraform/ # EKS, VPC, S3, Kafka, Prometheus, ArgoCD
β βββ helm/neuralops/ # Helm chart for all components
β βββ argocd/ # ArgoCD Application manifests
β
βββ monitoring/
β βββ prometheus/prometheus.yml
β βββ grafana/dashboards/neuralops-overview.json
β
βββ .github/workflows/
β βββ ci.yml # PR: lint + test + build
β βββ cd.yml # main: build β push β update Helm values
β
βββ docker-compose.full.yml # Full local stack
βββ Makefile # Convenience targets
βββ .env.example
- Docker Desktop β₯ 4.x
- Python 3.10+
- Node.js 20+
kubectl+ Minikube (for Kubernetes features)
git clone https://github.com/Aashish-Chandr/neuralops.git
cd neuralops
cp .env.example .env # edit as needed
docker-compose -f docker-compose.full.yml up --buildOnce running, the following endpoints are available:
| Service | URL |
|---|---|
| π₯ Frontend Dashboard | http://localhost:3001 |
| π API Gateway (docs) | http://localhost:8090/docs |
| π€ User Service | http://localhost:8001/docs |
| π¦ Order Service | http://localhost:8002/docs |
| π³ Payment Service | http://localhost:8003/docs |
| π Inventory Service | http://localhost:8004/docs |
| π Notification Service | http://localhost:8005/docs |
| π Prometheus | http://localhost:9090 |
| π Grafana | http://localhost:3000 (admin / neuralops-admin) |
| π§ͺ MLflow | http://localhost:5000 |
| π€ Inference Server | http://localhost:8080/docs |
cd frontend
npm install
npm run dev # http://localhost:3001The dashboard operates in demo mode (mock data) when the backend is offline and automatically switches to live data when services are up.
cd ml
pip install -r requirements.txt
python train.py --epochs 50 --hidden 64 --latent 16Results are logged to MLflow at http://localhost:5000.
# Inject chaos into the payment service
CHAOS_PAYMENT=true docker-compose -f docker-compose.full.yml up payment-serviceWatch the Grafana dashboard β anomaly scores will climb and the remediation engine will respond automatically.
cd streaming
pip install -r requirements.txt
python consumer_debug.py # prints all messages from metrics-streamThe model is trained only on normal operating data. At inference, a high reconstruction error signals an anomaly.
Input β (batch, 60, 5) 60-step sliding window Γ 5 features
[cpu%, memory%, latency_p99_ms, error_rate%, rps]
β
βΌ
Encoder β 2-layer LSTM β Linear projection β 16-dim latent vector
β
βΌ
Decoder β Repeat latent β 2-layer LSTM β Linear projection β Reconstruction
β
βΌ
Loss β MSE reconstruction error
Anomaly threshold: 95th percentile of reconstruction errors observed on the training set. Anything above this at inference time is flagged as anomalous.
MLflow tracking: Every training run logs hyperparameters, train/val loss curves, the computed threshold, and precision/recall/F1 scores. The best model is registered under neuralops-lstm-autoencoder in the Model Registry.
When an anomaly alert lands, the engine applies a rule-based decision tree and acts on Kubernetes:
| Observed Pattern | Automated Action |
|---|---|
| High error rate + low RPS | Restart pod β suspected crash loop |
| High CPU + high memory + high latency | Scale up replicas β suspected overload |
| High errors + normal latency | Rollback deployment β suspected bad release |
After each action the engine waits 5 minutes, re-evaluates service health, and if the issue persists it escalates via Slack webhook.
A Kubernetes CronJob runs Evidently AI daily:
- Compares the training-time feature distribution against the last 24 h of production metrics.
- If > 30 % of features show statistically significant drift, the retraining pipeline is triggered.
- The newly trained model is promoted to
Productionin the MLflow registry only if its F1 score improves over the current champion. - ArgoCD detects the updated model reference in
helm/values.yamland deploys automatically.
minikube start --memory=8192 --cpus=4
# Install ArgoCD
kubectl create namespace argocd
kubectl apply -n argocd \
-f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Deploy NeuralOps
helm install neuralops infra/helm/neuralops/ \
-n neuralops --create-namespace
# Hand off to GitOps
kubectl apply -f infra/argocd/app-neuralops.yamlcd infra/terraform
terraform init
terraform plan -var="environment=prod"
terraform applyTerraform provisions: EKS cluster Β· VPC Β· S3 (artifact storage) Β· MSK (Kafka) Β· Prometheus Β· ArgoCD.
Pull Request opened
βββΆ flake8 lint β pytest β docker build (no push)
Merge to main
βββΆ Build & push images to GHCR (tagged with commit SHA)
βββΆ Update image tags in helm/values.yaml
βββΆ ArgoCD detects diff β auto-deploys to cluster
| Variable | Default | Description |
|---|---|---|
CHAOS_MODE |
false |
Enable fault injection in microservices |
KAFKA_BOOTSTRAP_SERVERS |
localhost:9092 |
Kafka broker address |
PROMETHEUS_URL |
http://localhost:9090 |
Prometheus API base URL |
MLFLOW_TRACKING_URI |
http://localhost:5000 |
MLflow tracking server URL |
DRIFT_THRESHOLD |
0.3 |
Fraction of drifted features required to trigger retraining |
VERIFY_WAIT_SECONDS |
300 |
Seconds to wait before verifying post-remediation health |
SLACK_WEBHOOK_URL |
(empty) | Slack incoming webhook URL for escalation alerts |
Copy .env.example to .env and override as needed before starting the stack.
- Add LLM-assisted root-cause explanation surfaced in the dashboard
- Extend LSTM model to multivariate cross-service correlations
- Support GKE and AKS alongside EKS in Terraform
- Prometheus Alertmanager integration as a secondary alert channel
- Demo video walkthrough
Contributions, issues, and feature requests are welcome!
# Fork the repo, then:
git checkout -b feature/my-feature
git commit -m "feat: add my feature"
git push origin feature/my-feature
# Open a Pull RequestPlease ensure flake8 passes and relevant tests are added before opening a PR.
Distributed under the MIT License. See LICENSE for details.
Built by Aashish Chandr Β· Give it a β if you found it useful!