Skip to content
Siddhant75Public

About

Autonomous SRE & Code Brain powered by FalkorDB: Multi-agent ACID blackboard, sub-ms GraphBLAS RCA, GRAPH.COPY sandboxing & closed-loop O(1) shortcut nets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

75 Commits

Folders and files

Repository files navigation

GraphSRE: Autonomous SRE & Code Brain

FalkorDB + WeMakeDevs GraphHacks Hackathon (2026) Submission
Powered by FalkorDB (GraphBLAS Linear Algebra, ACID Central Blackboard, Embedded HNSW Vector Memory & GRAPH.COPY Zero-Cost Sandboxing)


πŸ“Œ About GraphSRE

GraphSRE is an Autonomous Site Reliability Engineering & Code Intelligence platform powered by FalkorDB.

During high-severity outages (Sev-1/Sev-2), SRE war rooms are inundated by noisy alert storms. Traditional multi-agent frameworks rely on natural-language message passing, inducing quadratic token bloat ($O(N^2)$), context loss, and hallucination cascades. Furthermore, traditional Vector RAG is "topologically blind"β€”it retrieves semantically similar log text but cannot compute directed causal reachability across complex microservices, API contracts, code AST hierarchies, and Git commit history.

GraphSRE eliminates conversational message passing by using FalkorDB as an ACID Central Blackboard. Four specialized autonomous agents (Triage, RCA, Memory, and Remediation) collaborate strictly through atomic OpenCypher transactions and FastMCP tools:

  • 5-Layer Connected Graph: Traverses telemetry alerts $\to$ microservices $\to$ API endpoints $\to$ AST functions $\to$ Git commits & on-call engineers.
  • Sub-Millisecond GraphBLAS Traversal: Traces causal paths from symptom to root cause in $< 1\text{ ms}$.
  • Mathematical Anti-Hallucination Guardrail: Enforces a formal invariant ($C_{\text{SRE}} \ge 0.75$) where ungrounded agent theories are mathematically vetoed.
  • Zero-Risk Ephemeral Sandboxing: Clones production state in $< 10\text{ ms}$ via GRAPH.COPY to test canary rollbacks safely before live execution.
  • Closed-Loop $O(1)$ Shortcut Net: Compiles learned shortcut edges with Bayesian temporal decay, dropping repeat incident MTTR from 78s to 0.18s ($433\times$ speedup).
  • Shift-Left CI/CD Blast Gate: Analyzes pull request code diffs against the production call graph to block outages before deployment.

🎬 Official 3-Minute Hackathon Demo Video

Watch Demo on YouTube

πŸŽ₯ Watch on YouTube: https://youtu.be/4hPKV3G3fvE

  • Act 1: Clean Baseline Monitoring β€” FalkorDB Central Blackboard monitoring 5 microservices across 3 tiers with GraphBLAS sparse reachability engine.
  • Act 2: Chaos Injection & Autonomous Cross-Layer RCA β€” HTTP 504 storm clustered via CDLP, golden causal path traversed across 5 layers down to commit c3d9a107 (Alice Chen).
  • Act 3: Multi-Agent Quorum & Sub-15ms GRAPH.COPY Sandboxing β€” Agents persist votes directly to FalkorDB (WCS = 0.88 >= 0.75), ephemeral sandbox cloned and verified, 1-click canary rollback executed.
  • Act 4: Closed-Loop O(1) Shortcut Net & Shift-Left CI/CD Blast Gate β€” Persistent emerald shortcut edge compiled (mttr: 78s -> 0.18s), and PR #412 blocked via AST diff call-graph reachability!

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚                       GRAPHSRE MULTI-AGENT ARCHITECTURE                         β”‚
   β”‚               Autonomous Site Reliability Engineering & Code Intelligence        β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚ Triage Agent β”‚      β”‚  RCA Agent   β”‚      β”‚ Memory Agent β”‚      β”‚ Remediation  β”‚
     β”‚   (Alerts)   β”‚      β”‚  (Causality) β”‚      β”‚ (Knowledge)  β”‚      β”‚   (Action)   β”‚
     β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚                     β”‚                     β”‚                     β”‚
            β”‚   Model Context Protocol (FastMCP) Tools  β”‚                     β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚                     β”‚
                           β–Ό                     β–Ό
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β”‚                       FALKORDB CENTRAL BLACKBOARD                              β”‚
     β”‚                                                                                β”‚
     β”‚   ACID Graph State Store  β€’  Vector Index  β€’  AST & Topology Knowledge Base   β”‚
     β”‚                                                                                β”‚
     β”‚   (:Incident) ──[:HAS_ALERT]──> (:Alert) ──[:AFFECTS]──> (:Service)           β”‚
     β”‚        β”‚                                                     β”‚                 β”‚
     β”‚   [:HAS_HYPOTHESIS]                                     [:CALLS]               β”‚
     β”‚        β–Ό                                                     β–Ό                 β”‚
     β”‚   (:Hypothesis) ──[:SUPPORTED_BY]──> (:Evidence) ──> (:Function)              β”‚
     β”‚        β”‚                                                     β–²                 β”‚
     β”‚   [:LEADS_TO]                                           [:MODIFIES]            β”‚
     β”‚        β–Ό                                                     β”‚                 β”‚
     β”‚   (:RemediationPlan) ──[:TESTED_IN]──> (:SandboxGraph) ── (:Commit)            β”‚
     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Project Setup & Quickstart Guide

πŸ“‹ Prerequisites

Before running GraphSRE, ensure you have:

  • Docker & Docker Compose (v20.10+ / Compose v2.0+) β€” Get Docker
  • Python 3.10+ (if running bare-metal backend or test suites)
  • Node.js 18+ & npm / pnpm (if running bare-metal frontend)
  • Git

Option A: 1-Click Launch via Docker Compose (Recommended)

To ensure developers and hackathon judges experience zero local compilation overhead, all container images are pre-built via GitHub Actions cloud CI/CD and hosted on Docker Hub:

  • sid7899999/graphsre-backend:latest
  • sid7899999/graphsre-frontend:latest
  • falkordb/falkordb:latest
# 1. Clone the repository
git clone https://github.com/Siddhant75/GraphSRE.git
cd GraphSRE

# 2. Configure environment (defaults work out-of-the-box)
cp .env.example .env

# 3. Pull pre-built images from Docker Hub (zero local compilation disk space!)
docker compose pull

# 4. Start all services in the background
docker compose up -d

# 5. Seed FalkorDB with the 5-layer socio-technical graph & HNSW vector memory
docker compose exec backend python scripts/seed_mock_topology.py

Access Points:


Option B: Bare-Metal Local Development

For developers wishing to run backend services and frontend interfaces directly on their host machine:

1. Start FalkorDB

docker run -d -p 6379:6379 --name falkordb falkordb/falkordb:latest

2. Configure Environment Variables

cp .env.example .env

(On Windows PowerShell: Copy-Item .env.example .env)

Variable Default Value Description
FALKORDB_HOST localhost FalkorDB server host address
FALKORDB_PORT 6379 FalkorDB Redis-compatible port
PRIMARY_GRAPH graphsre_production Primary production graph key
NEXT_PUBLIC_API_URL http://localhost:8000 Backend API base URL for frontend
NEXT_PUBLIC_WS_URL ws://localhost:8000 WebSocket endpoint for real-time updates
OPENAI_API_KEY mock-openai-key Optional LLM provider key
GROQ_API_KEY mock-groq-key Optional Groq LLM key

3. Backend Setup (Python)

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate       # Windows PowerShell: .venv\Scripts\Activate.ps1

# Install dependencies
pip install -r requirements.txt

# Seed FalkorDB knowledge graph, AST call hierarchies, and HNSW vector index
python scripts/seed_mock_topology.py

# Launch FastAPI backend with WebSocket support
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload

4. FastMCP Tool Server (Optional for Agent Workflows)

python server/mcp_server.py

5. Frontend Setup (Next.js 14)

In a separate terminal:

cd frontend
npm install
npm run dev

Open http://localhost:3000 in your browser.


πŸ§ͺ Verifying the Installation

Run the complete test suite to ensure FalkorDB connectivity, graph invariants, and lifecycle engines are operational:

# Run unit and invariant tests
python -m unittest tests/test_graph_invariants.py tests/test_fsm_lifecycle.py tests/test_docker_cicd.py

# Run standalone end-to-end incident lifecycle test (< 90s MTTR SLA)
python tests/test_e2e_lifecycle.py

# Run interactive CLI incident simulation
python scripts/run_demo_simulation.py

πŸ“Š What Data is GraphSRE Checking?

GraphSRE bridges the gap between runtime telemetry and code-level version control by constructing a living 5-layer socio-technical graph inside FalkorDB:

[Layer 1: Telemetry]     (:Alert {name: "HTTP 504 Gateway Timeout Storm", metric: 4800ms})
                                  β”‚
                              [:AFFECTS]
                                  β–Ό
[Layer 2: Architecture]  (:Service {name: "PaymentService", tier: "TIER_1"})
                                  β”‚
                              [:EXPOSES]
                                  β–Ό
[Layer 3: API Surface]   (:Endpoint {path: "/api/v1/charge", method: "POST"})
                                  β”‚
                        [:IMPLEMENTED_BY]
                                  β–Ό
[Layer 4: Code AST]      (:Function {name: "call_stripe_webhook", file: "services/payment/stripe.py"})
                                  β”‚
                            [:MODIFIED_BY]
                                  β–Ό
[Layer 5: Git & People]  (:Commit {sha: "c3d9a107", author: "Alice Chen"})

1. Benchmark Open-Source Reference Topology

The default seeded dataset in scripts/seed_mock_topology.py is directly modeled on the industry-standard Google Cloud Microservices Demo (Online Boutique) and Weaveworks Sock Shop:

  • Services: FrontendAPI, CheckoutService, PaymentService, InventoryService, NotificationService, AuthService.
  • Telemetry: Ingests Prometheus/OpenTelemetry alert streams (P99 Latency > 2000ms, HTTP 504 Gateway Timeout, DB Connection Pool Starvation).
  • Failure Scenario: A real-world distributed outage pattern β€” an unhandled third-party gateway read timeout (timeout=None) inducing thread pool exhaustion and cascading ingress 504s.

2. Generic Open-Source Codebase Ingestion

The underlying engines are completely open and generic:

  • AST Code Ingestion Engine (backend/ast_parser.py): Can parse any open-source Python repository. It automatically walks the AST, extracts function call hierarchies ([:CALLS]), generates structural SHA256 hashes, and emits OpenCypher statements to populate FalkorDB.
  • Shift-Left CI/CD Blast Gate (backend/api/cicd.py): Ingests arbitrary GitHub Pull Request diff patches, sanitizes unified diffs, extracts modified symbols, and calculates a 4-hop Structural Risk Index (SRI) before code is merged into production.
  • HNSW Vector Memory: Ingests 384-dimensional sentence-transformer embeddings of historical SRE postmortems into native FalkorDB vector indices (vecf32) for sub-millisecond episodic recall.

πŸ—ΊοΈ Graph Schema: Nodes, Relationships & Cypher Queries

GraphSRE represents the entire engineering ecosystem as a unified, queryable connected knowledge graph in FalkorDB, bridging runtime telemetry, service architectures, polyglot code Abstract Syntax Trees (AST), git versioning, and multi-agent coordination state.

πŸ“– Exhaustive Schema Catalog: For detailed property specifications, data types, and index DDL, see docs/GRAPH_SCHEMA.md.

1. Cross-Layer Architecture

                                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                β”‚          (:Incident {id, sev})        β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ [:HAS_ALERT]
                                                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  [:DEPENDS_ON]  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ (:Service {Frontend}) β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ίβ”‚ (:Service {Pay})β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ [:EXPOSES]
                                                   β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚  (:Endpoint)    β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ [:IMPLEMENTED_BY]
                                                   β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚ (:Function)     β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ [:CALLS*]
                                                   β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚ (:Function)     │◄─ ─ ─ ─ ─ ─ ─ ─[:SHORTCUT_TO_ROOT_CAUSE]─ ─ ─(:Service {Pay})
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ [:MODIFIED_BY]
                                                   β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚   (:Commit)     β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                   β”‚ [:AUTHORED_BY]
                                                   β–Ό
                                          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                          β”‚  (:Engineer)    β”‚
                                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

2. Multi-Layer Knowledge Graph Schema

graph TD
    subgraph L1 ["Layer 1: Telemetry and Incidents"]
        Inc["Incident (id, state, sev)"]
        Alt["Alert (id, metric, threshold)"]
    end

    subgraph L2 ["Layer 2: Architecture and Topology"]
        SvcUp["FrontendAPI (Tier 1)"]
        SvcPay["PaymentService (Tier 1)"]
    end

    subgraph L3 ["Layer 3: API Surface and Code AST"]
        Ep["Endpoint (/api/v1/charge)"]
        FnRoot["process_charge()"]
        FnCulprit["call_stripe_webhook()"]
    end

    subgraph L4 ["Layer 4: Git Versioning and Ownership"]
        Cmt["Commit c3d9a107 (Alice Chen)"]
        Eng["Alice Chen (Payment Squad)"]
        Tm["Payment Platform Team"]
        Sched["OnCall Schedule (Primary)"]
    end

    subgraph L5 ["Layer 5: Multi-Agent Blackboard and Quorum"]
        Hyp["Hypothesis (WCS: 0.88)"]
        Evi["Evidence (Metric Spike)"]
        AgTriage["Triage Agent"]
        AgRCA["RCA Agent"]
        AgMem["Memory Agent"]
        Plan["Remediation Plan (Canary Rollback)"]
    end

    subgraph L6 ["Layer 6: Episodic Memory and Runbooks"]
        Past["PastIncident (384-d HNSW Vector)"]
        Rb["Runbook (rb_net_042)"]
    end

    Inc -->|HAS_ALERT| Alt
    Alt -->|AFFECTS| SvcPay
    SvcUp -->|DEPENDS_ON| SvcPay

    SvcPay -->|EXPOSES| Ep
    Ep -->|IMPLEMENTED_BY| FnRoot
    FnRoot -->|CALLS| FnCulprit
    FnCulprit -->|MODIFIED_BY| Cmt

    Cmt -->|AUTHORED_BY| Eng
    Eng -->|MEMBER_OF| Tm
    SvcPay -->|OWNED_BY| Tm
    Eng -->|ON_CALL| Sched
    Tm -->|HAS_SCHEDULE| Sched

    Inc -->|HAS_HYPOTHESIS| Hyp
    Hyp -->|TARGETS| Cmt
    Hyp -->|SUPPORTED_BY| Evi
    AgTriage -->|VOTED_APPROVE| Hyp
    AgRCA -->|VOTED_APPROVE| Hyp
    AgMem -->|VOTED_APPROVE| Hyp
    Hyp -->|GENERATES_PLAN| Plan

    Inc -->|ARCHIVED_AS| Past
    Past -->|AFFECTED_SERVICE| SvcPay
    Past -->|RESOLVED_BY| Rb

    SvcPay -.->|SHORTCUT_TO_ROOT_CAUSE| FnCulprit
Loading

3. Node Schema Catalog

Node Label Core Properties Semantic Role & Purpose
(:Incident) id, state, severity, started_at, blast_radius_count, mttr_seconds Root entity coordinating multi-agent incident lifecycle (DETECTED $\to$ TRIAGED $\to$ HYPOTHESIS_FORMED $\to$ QUORUM_VERIFIED $\to$ REMEDIATING $\to$ RESOLVED).
(:Alert) id, fingerprint, name, source, metric_value, threshold, timestamp Raw telemetry event from Prometheus/OTel clustered by Community Detection (CDLP).
(:Service) id, name, tier (TIER_1/2/3), health_status, p99_latency_ms, error_rate, pagerank Microservice infrastructure node with GraphBLAS structural centrality metrics.
(:Endpoint) id, path, method, protocol, sla_p99_ms Ingress API contract exposed by a service (/api/v1/charge).
(:Function) id, qualified_name, file_path, line_start, line_end, ast_hash AST code node representing discrete executable units parsed via Python AST / Tree-sitter.
(:Commit) sha, author, timestamp, message, diff_summary Git commit node linking code modifications to code authors.
(:Engineer) id, name, email, github_handle, slack_handle Human author responsible for code, on-call schedules, and incident notification.
(:Team) id, name, slack_channel Engineering team with service ownership (Payment Platform Team).
(:OnCallSchedule) id, shift, escalation_policy, layer PagerDuty rotation schedule linked to engineers and owning teams.
(:Hypothesis) id, agent_id, statement, composite_confidence, status, created_at Candidate root-cause theory requiring multi-agent consensus and topological verification.
(:Evidence) id, type, source, payload, confidence_score, timestamp Telemetry timeseries spike, stack trace, or Git diff supporting or refuting a hypothesis.
(:Agent) id, name, role Specialized swarm agent (Triage_Agent, RCA_Agent, Memory_Agent, Remediation_Agent).
(:RemediationPlan) id, action_type, command_payload, rollback_payload, execution_state Executable mitigation recipe tested inside ephemeral sandbox before live execution.
(:PastIncident) id, root_cause_summary, resolution, mttr_seconds, embedding (384-d vector) Historical postmortem indexed with native FalkorDB HNSW vector index (vecf32).
(:Runbook) id, title, success_rate, embedding (384-d vector) Standard Operating Procedure (SOP) with proven historical remediation success rate.

4. Relationship Schema Catalog

Relationship Source $\to$ Target Properties Semantics & Graph Function
[:HAS_ALERT] (:Incident) -> (:Alert) β€” Binds active telemetry alarms to the root incident blackboard.
[:AFFECTS] (:Alert) -> (:Service) β€” Maps runtime telemetry anomaly to the impacted infrastructure component.
[:DEPENDS_ON] (:Service) -> (:Service) protocol, timeout_ms Directed inter-service dependency graph used for upstream blast-radius traversal.
[:EXPOSES] (:Service) -> (:Endpoint) β€” Connects microservice to its public API routes.
[:IMPLEMENTED_BY] (:Endpoint) -> (:Function) β€” Bridges network architecture into the code Abstract Syntax Tree (AST).
[:CALLS] (:Function) -> (:Function) is_async Static AST call hierarchy graph traversed by RCA and CI/CD blast gate.
[:MODIFIED_BY] (:Function) -> (:Commit) β€” Pinpoints the exact Git commit altering an AST function body.
[:AUTHORED_BY] (:Commit) -> (:Engineer) β€” Links code changes to the author for instant Slack/PagerDuty routing.
[:MEMBER_OF] (:Engineer) -> (:Team) β€” Maps engineers to functional squads.
[:OWNED_BY] (:Service) -> (:Team) β€” Defines service ownership and team-level escalation policies.
[:ON_CALL] (:Engineer) -> (:OnCallSchedule) status, tier Active on-call rotation tracking.
[:HAS_HYPOTHESIS] (:Incident) -> (:Hypothesis) β€” Hypotheses posted by RCA agents to the shared blackboard.
[:TARGETS] (:Hypothesis) -> (:Commit | :Function) β€” Connects proposed causal theory to the suspect commit or function.
[:SUPPORTED_BY] (:Hypothesis) -> (:Evidence) weight Binds corroborating telemetry, diffs, and logs to a hypothesis.
[:VOTED_ON] (:Agent) -> (:Hypothesis) decision, weight, reasoning Persistent quorum vote record stored directly in the graph blackboard.
[:GENERATES_PLAN] (:Hypothesis) -> (:RemediationPlan) β€” Links validated hypothesis to executable remediation recipe.
[:ARCHIVED_AS] (:Incident) -> (:PastIncident) β€” Preserves resolved incident postmortem in episodic vector memory.
[:AFFECTED_SERVICE] (:PastIncident) -> (:Service) β€” Associates past postmortems with infrastructure services for hybrid retrieval.
[:RESOLVED_BY_PLAYBOOK] (:PastIncident) -> (:Runbook) β€” Links historical incident to the validated runbook that resolved it.
[:SHORTCUT_TO_ROOT_CAUSE] (:Service) -> (:Function) weight, occurrences, last_seen Self-curating $O(1)$ learned edge bypassing multi-hop RCA on repeat incidents.

πŸ›‘οΈ The Graph in Action: How FalkorDB Drives Agent Decisions

Why FalkorDB is the Decision Engine, Not LLM Hallucinations

In traditional LLM agent frameworks (e.g., CrewAI, AutoGen, LangGraph message rings), agents pass free-form natural language text to each other. When an agent hallucinates a root cause (e.g., "Database connection exhausted by billing"), downstream agents accept it as fact and execute catastrophic remediation actions.

In GraphSRE, agents make ZERO autonomous decisions on their own. Every single agent decision is:

  1. Grounded in Graph State: Derived from directed graph walks in FalkorDB's GraphBLAS sparse matrix engine.
  2. Mathematically Bound: Gated by formal graph invariants ($T_{\text{graph}}$ reachability, $C_{\text{SRE}} \ge 0.75$, Quorum Consensus).
  3. Persisted as Graph Entities: Recorded as immutable nodes and edges on the blackboard, providing a deterministic audit trail.

Agent Decision Matrix

# Decision Stage Agent What is Decided FalkorDB Graph Mechanism Decision Logic & Outcome
1 Alert Triage & Blast Radius Triage Agent Severity level (SEV_1 vs SEV_3) and blast radius count. 3-hop reverse path matching: (upstream:Service)-[:DEPENDS_ON*1..3]->(s) + in-degree centrality. Computes $\text{SevScore} = 40 \cdot \text{Tier} + 35 \cdot \text{PR} + 25 \cdot \text{InDegree}$. If $\ge 85 \implies \mathbf{SEV-1}$.
2 Root-Cause Blame RCA Agent Which function and Git commit broke production. 5-layer cross-layer OpenCypher traversal + Topological Reachability Invariant. If no directed walk exists in GraphBLAS matrix between alert and commit ($T_{\text{graph}} = 0$), hypothesis is mathematically rejected ($C_{\text{SRE}} \le 0.65 &lt; 0.75$).
3 Episodic Knowledge Recall Memory Agent Prior outages and validated recovery runbooks. Embedded HNSW vector index: CALL db.idx.vector.queryNodes('PastIncident', 'embedding', ...) joined with service dependencies. Recalls historical MTTR and runbook rb_net_042 with 98% proven success rate.
4 Quorum Consensus & Guardrail Blackboard Hub Whether autonomous remediation is permitted or blocked. Multi-agent quorum votes stored as (:Agent)-[v:VOTED_ON]->(:Hypothesis) edges. If any agent votes VETO or $C_{\text{SRE}} &lt; 0.75$, the graph blocks mutation with HTTP 403 Forbidden.
5 Counterfactual Simulation Remediation Agent Is canary rollback safe without collateral damage? Sub-15ms zero-cost graph cloning: GRAPH.COPY graphsre_production graphsre_sandbox. Tests canary mitigation on sandbox clone; deletes sandbox on verification pass.
6 Self-Curating Shortcut Net Company Brain Can repeat incidents bypass multi-hop RCA? Direct shortcut edge synthesis: [:SHORTCUT_TO_ROOT_CAUSE] with Bayesian reinforcement $\Delta W = \eta(1 - W)$. Bypasses 5-layer RCA on recurring alert: MTTR drops from 78s to 0.18s ($433\times$ speedup).
7 Shift-Left CI/CD Blast Gate Pre-Merge Gatekeeper Can incoming Pull Request diff be safely merged? Python AST parsing + 4-hop FalkorDB reverse call graph reachability. Computes Structural Risk Index ($SRI$). If $SRI &gt; 0.60$, blocks PR merge in GitHub CI!

Step-by-Step Graph-Driven Decisions

Decision 1: Incident Blast Radius & Dynamic Severity (Triage Agent)

The agent does not ask the LLM "how severe is this incident?". Instead, FalkorDB calculates severity deterministically using topological centrality:

MATCH (s:Service {name: $target_service})
MERGE (i:Incident {state: 'DETECTED'})
  ON CREATE SET i.id = $incident_id, i.started_at = $timestamp
CREATE (a:Alert {id: $alert_id, fingerprint: $fingerprint, name: $alert_name, metric_value: $metric_value})
CREATE (i)-[:HAS_ALERT]->(a)
CREATE (a)-[:AFFECTS]->(s)

WITH i, s
// Compute 3-hop upstream blast radius
OPTIONAL MATCH path = (upstream:Service)-[:DEPENDS_ON*1..3]->(s)
WITH i, s, count(DISTINCT upstream) AS upstream_count, collect(DISTINCT upstream.name) AS blast_services

// In-degree structural centrality
OPTIONAL MATCH (s)<-[:DEPENDS_ON]-(caller:Service)
WITH i, s, upstream_count, blast_services, count(DISTINCT caller) AS in_degree
WITH i, s, upstream_count, blast_services,
     (CASE s.tier WHEN 'TIER_1' THEN 1.0 WHEN 'TIER_2' THEN 0.6 ELSE 0.3 END) AS tier_w,
     coalesce(s.pagerank, 0.5) AS pr_w,
     (CASE WHEN in_degree > 5 THEN 1.0 ELSE (in_degree / 5.0) END) AS indegree_w

WITH i, s, upstream_count, blast_services,
     ((40.0 * tier_w) + (35.0 * pr_w) + (25.0 * indegree_w)) AS sev_score

SET i.blast_radius_count = upstream_count,
    i.state = 'TRIAGED',
    i.severity = CASE WHEN sev_score >= 85.0 OR s.tier = 'TIER_1' THEN 'SEV_1' ELSE 'SEV_2' END
RETURN i.id, i.severity, upstream_count, blast_services, sev_score;

Decision 2: 5-Layer Cross-Layer RCA & The Anti-Hallucination Invariant (RCA Agent)

The RCA Agent identifies the root cause by traversing from the alerted service down to the exact commit modifying the AST call graph:

MATCH (i:Incident {id: $incident_id})
MATCH (s:Service {name: $service_name})-[:EXPOSES]->(e:Endpoint)-[:IMPLEMENTED_BY]->(root_fn:Function)
MATCH call_path = (root_fn)-[:CALLS*0..4]->(target_fn:Function)
MATCH (target_fn)-[:MODIFIED_BY]->(c:Commit)
WHERE length(call_path) <= $max_depth
  AND c.timestamp >= (timestamp() - ($time_window_hours * 3600000))
OPTIONAL MATCH (c)-[:AUTHORED_BY]->(eng:Engineer)
OPTIONAL MATCH (s)-[:OWNED_BY]->(tm:Team)
RETURN target_fn.qualified_name AS culprit_function,
       target_fn.file_path AS file_path,
       c.sha AS culprit_commit,
       c.author AS author,
       eng.slack_handle AS author_slack,
       tm.name AS owning_team,
       c.diff_summary AS diff_summary,
       length(call_path) AS call_depth
ORDER BY c.timestamp DESC, call_depth ASC
LIMIT 5;

The Mathematical Anti-Hallucination Bound:
The Composite Confidence Score is computed as: $$C_{\text{SRE}} = 0.25 S_{\text{episodic}} + 0.35 T_{\text{graph}} + 0.25 E_{\text{metric}} + 0.15 H_{\text{success}}$$ If an LLM agent hallucinates a suspect commit or function that has no verified directed walk in FalkorDB's GraphBLAS adjacency matrix, $T_{\text{graph}} = 0.0$. Even if the agent hallucinates maximum confidence across all other inputs ($1.0$), the score is strictly capped: $$C_{\text{SRE}}^{\max} = 0.25(1.0) + 0.35(0.0) + 0.25(1.0) + 0.15(1.0) = \mathbf{0.65} &lt; \mathbf{0.75}$$ An ungrounded LLM theory can NEVER trigger autonomous action.


Decision 3: Sub-Millisecond Hybrid Episodic Recall (Memory Agent)

FalkorDB embeds vector indices directly on node properties, allowing semantic vector similarity and graph topology to be queried in a single Cypher round-trip:

CALL db.idx.vector.queryNodes('PastIncident', 'embedding', $top_k, vecf32($query_vector))
YIELD node AS past_incident, score AS episodic_sim
MATCH (past_incident)-[:AFFECTED_SERVICE]->(s:Service {name: $service_name})
OPTIONAL MATCH (past_incident)-[:RESOLVED_BY_PLAYBOOK]->(rb:Runbook)
MATCH (h:Hypothesis {id: $hypothesis_id})-[:TARGETS]->(culprit)

WITH h, past_incident, episodic_sim, rb, s, culprit
OPTIONAL MATCH path = (s)-[:EXPOSES]->(:Endpoint)-[:IMPLEMENTED_BY]->(:Function)-[:CALLS*0..4]->(fn:Function)
WHERE fn = culprit OR (fn)-[:MODIFIED_BY]->(culprit)
WITH h, past_incident, episodic_sim, rb,
     (CASE WHEN count(path) > 0 THEN 1.0 ELSE 0.0 END) AS t_graph,
     coalesce(rb.success_rate, 0.70) AS h_success,
     $metric_snr AS e_metric

WITH h, past_incident, episodic_sim, rb,
     ((0.25 * episodic_sim) + (0.35 * t_graph) + (0.25 * e_metric) + (0.15 * h_success)) AS c_sre
SET h.composite_confidence = c_sre
RETURN past_incident.id AS prior_incident_id,
       past_incident.root_cause_summary AS past_summary,
       past_incident.resolution AS past_resolution,
       episodic_sim,
       rb.title AS playbook_title,
       c_sre AS composite_confidence;

Decision 4: Quorum Consensus & The Autonomous Remediation Gate

Before executing any infrastructure changes, agents cast structured votes recorded as persistent graph edges (:Agent)-[:VOTED_ON]->(:Hypothesis). The graph acts as the strict gatekeeper:

// Record atomic vote on the blackboard
MATCH (i:Incident {id: $incident_id})-[:HAS_HYPOTHESIS]->(h:Hypothesis {id: $hypothesis_id})
MERGE (a:Agent {id: $agent_id})
MERGE (a)-[v:VOTED_ON]->(h)
SET v.decision = $decision, v.weight = $weight, v.reasoning = $reasoning, v.timestamp = timestamp()

// Check consensus gate: autonomous execution blocked unless WCS >= 0.75 and zero VETO
WITH h
MATCH (any_agent:Agent)-[all_v:VOTED_ON]->(h)
RETURN collect({agent: any_agent.id, decision: all_v.decision, weight: all_v.weight}) AS votes;
# Gated directly in backend/api/incidents.py before executing remediation
stored_wcs = await db_client.execute_query(
    "MATCH (i:Incident {id: $id})-[:HAS_HYPOTHESIS]->(h:Hypothesis) RETURN max(h.composite_confidence)",
    {"id": incident_id}
)
if stored_wcs < 0.75:
    raise HTTPException(status_code=403, detail="Guardrail Violation: C_SRE must be >= 0.75")

Decision 5: Zero-Risk Blast Simulation via GRAPH.COPY (Remediation Agent)

The Remediation Agent forks the production graph in under 10ms, tests canary blast-radius counterfactuals in complete isolation, and cleans up:

# 1. Fork production graph in < 15ms via native FalkorDB GRAPH.COPY
sandbox_id = await db_client.create_sandbox(incident_id)

# 2. Simulate canary mitigation in sandbox graph
await db_client.execute_query(
    "MATCH (s:Service {name: $svc}) SET s.health_status = 'DRAINING' RETURN s.health_status",
    {"svc": "PaymentService"},
    graph=sandbox_id
)

# 3. Verify downstream invariants inside the clone
# 4. Tear down ephemeral sandbox (zero residual footprint)
await db_client.destroy_sandbox(sandbox_id)

Decision 6: Closed-Loop $O(1)$ Shortcut Net & Bayesian Decay (Company Brain)

When an incident is resolved, FalkorDB synthesizes a permanent learned shortcut edge from the symptom to the root cause:

// Synthesize persistent shortcut edge on incident resolution
MATCH (s:Service {name: $service_name})
MATCH (culprit:Function {qualified_name: $culprit_function})
MERGE (s)-[sr:SHORTCUT_TO_ROOT_CAUSE]->(culprit)
  ON CREATE SET sr.weight = 0.95, sr.occurrences = 1, sr.last_seen = timestamp(), sr.stale = false
  ON MATCH SET sr.weight = sr.weight + (0.50 * (1.0 - sr.weight)),
               sr.occurrences = sr.occurrences + 1,
               sr.last_seen = timestamp(),
               sr.stale = false
RETURN sr.weight, sr.occurrences;
// On repeat incident, Triage checks for shortcut FIRST (O(1) lookup)
MATCH (s:Service {name: $target_service})-[sr:SHORTCUT_TO_ROOT_CAUSE]->(culprit:Function)
WHERE sr.weight >= 0.70 AND coalesce(sr.stale, false) = false
RETURN culprit.qualified_name AS shortcut_culprit,
       culprit.file_path AS shortcut_file,
       sr.weight AS shortcut_weight
LIMIT 1;
// Result: Bypasses 5-layer RCA, reducing MTTR from 78s to 0.18s!

Decision 7: Shift-Left CI/CD Blast Gate (CI/CD Gatekeeper)

During Pull Request evaluation, the CI pipeline parses git diffs with Python AST and queries FalkorDB to evaluate downstream blast radius before merging code:

MATCH (s:Service)-[:EXPOSES]->(ep:Endpoint)-[:IMPLEMENTED_BY]->(root:Function)
MATCH call_path = (root)-[:CALLS*0..4]->(fn:Function)
WHERE fn.file_path IN $changed_files 
   OR any(sym IN $symbols WHERE fn.qualified_name CONTAINS sym OR fn.file_path CONTAINS sym)
WITH s, ep, root, fn, length(call_path) AS hop_depth
OPTIONAL MATCH upstream = (caller:Service)-[:DEPENDS_ON*1..2]->(s)
WITH s, ep, root, fn, hop_depth, collect(DISTINCT caller.name) AS upstream_callers
RETURN s.name AS service_name,
       s.tier AS tier,
       coalesce(s.pagerank, 0.5) AS pagerank,
       fn.qualified_name AS target_fn,
       hop_depth,
       upstream_callers;

If the calculated Structural Risk Index ($SRI$) exceeds $0.60$, the gate rejects the pull request and prevents the outage from ever reaching production.


πŸ† Hackathon Track Alignment

Track Core GraphSRE Capability FalkorDB Feature
Track 1: Connected Data Multi-hop cross-layer traversal from HTTP alerts to AST functions & Git commits via 7 FastMCP tools. GraphBLAS Sparse Matrix Engine
Track 2: Memory & Coordination Central ACID blackboard replacing conversational token storms, 384-dim HNSW vector memory & quorum consensus. Sub-millisecond Cypher Transactions & GRAPH.COPY
Track 3: Company Brain Socio-technical ownership linking AST functions to git authors; Shift-Left CI/CD blast gate; $O(1)$ shortcut nets. Dynamic Edge Synthesis with Bayesian Decay
Side Prize: Technical Blog Publication-grade analysis of Vector RAG failure modes in SRE in blog.md and docs/BLOG_POST.md. Complete Platform Architecture

πŸ§ͺ Verification & Testing

All 23 test suites pass with 100% success (exit code 0, 0 errors):

# Run complete test suite (23/23 unit, invariant, and E2E lifecycle tests)
python tests/test_fsm_lifecycle.py
python tests/test_e2e_lifecycle.py
python tests/test_graph_invariants.py
python tests/test_fsm_and_chaos.py
python tests/test_ast_ingestion.py
python tests/test_docker_cicd.py

# Run standalone end-to-end incident lifecycle test (< 90s MTTR SLA)
python tests/test_e2e_lifecycle.py

# Run mathematical graph invariants test (anti-hallucination bound, bayesian decay, veto)
python tests/test_graph_invariants.py

# Run interactive CLI demonstration
python scripts/run_demo_simulation.py

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

About

Autonomous SRE & Code Brain powered by FalkorDB: Multi-agent ACID blackboard, sub-ms GraphBLAS RCA, GRAPH.COPY sandboxing & closed-loop O(1) shortcut nets.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages