Skip to content

gamzeozgul/autoops-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutoOps AI

Decision & Automation Engine — Rules-first, AI-assisted business metric monitoring and automated response system.

Overview

AutoOps AI is a backend system that evaluates business metrics against configurable rules, determines severity levels, generates AI-assisted explanations for violations, and triggers automated workflows via n8n.

Core philosophy:
Rules define decisions. AI explains decisions. Automation executes decisions.

What Problem Does This Solve?

Operational teams monitor metrics such as conversion rates, error rates, or response times.
When thresholds are violated, teams need to:

  • Detect the issue reliably
  • Understand why it happened
  • Trigger the right response quickly

AutoOps AI provides a structured decision pipeline to solve this.

Key Features

  • Rule-based decision engine
    Metrics are evaluated against explicit rules with severity levels (INFO / WARNING / CRITICAL)

  • AI-assisted explanations
    AI explains why a rule was violated and suggests next actions
    (AI does not make decisions)

  • Severity-based automation
    High-severity events trigger automated workflows via n8n

  • Audit trail
    Metrics, decisions, explanations, and actions are persisted for traceability

Architecture

Metric Input
    ↓
Rule Evaluation (decision)
    ↓
Severity Assignment
    ↓
AI Analysis (explanation only)
    ↓
ActionLog Creation
    ↓
n8n Webhook (optional automation)

Design Principles

  • Rules-first: Business logic lives in code, not in AI prompts
  • AI as explanation layer: AI explains outcomes, never decides them
  • Persisted truth: Automation payloads are derived from database entities, not in-memory variables
  • Fire-and-forget automation: External failures do not block core processing

Tech Stack

  • Node.js + TypeScript
  • Express
  • Prisma ORM
  • SQLite (development) / PostgreSQL (production)
  • n8n (automation workflows — optional integration)

Project Structure

src/
├── controllers/
├── services/
│   ├── metric.service.ts      # Core business logic
│   ├── rule-evaluation.service.ts
│   ├── ai.service.ts          # AI explanation layer (OpenAI-ready)
│   ├── automation.service.ts  # Automation logic
│   └── webhook-client.service.ts
├── repositories/
├── models/
├── utils/
└── config/

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

npm install
npx prisma generate
npx prisma migrate dev
npm run dev

Server runs on http://localhost:3000

Smoke Test

node test-basic-flow.js

This test:

  1. Creates a rule
  2. Processes a metric that violates the rule
  3. Verifies severity and AI explanation
  4. Confirms ActionLog creation
  5. Processes a non-violating metric

Note: This is a real end-to-end test using the live API and database.

Visualize Data

npx prisma studio

Opens Prisma Studio at http://localhost:5555 - view Metrics, Rules, AIInsights, and ActionLogs in the database.

Environment Variables

See .env.example for required configuration.

n8n Integration

n8n integration is optional by design.

With n8n configured:

  • Webhooks trigger automated workflows (Slack, email, escalation)

Without n8n:

  • The system still evaluates rules, generates AI explanations, and records ActionLogs
  • Webhook calls are safely skipped

This mirrors real-world systems where external services are optional dependencies.

Setup n8n (Optional)

  1. Set N8N_WEBHOOK_WARNING and/or N8N_WEBHOOK_CRITICAL in .env
  2. See docs/workflows.md for n8n workflow setup

Note: The n8n integration code is production-ready. The system works fully without n8n, but when webhook URLs are configured, automation workflows are triggered automatically.

License

Private

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published