π§ AI-powered infrastructure debugging orchestrator
Organize, automate, and share debugging workflows with ease
Quick Start β’ Features β’ Architecture β’ Documentation β’ Contributing
Cortex helps teams organize debugging knowledge into reusable components called neurons (discrete tasks) and chain them into automated synapses (workflows). Think of it as bringing structure and science to the art of infrastructure debugging.
flowchart LR
A["Neurons<br/>(Debugging Tasks)"] --> B["Synapses<br/>(Workflows)"]
B --> C["Insights<br/>(Results)"]
D["AI Generator"] -.->|generates| A
style A fill:#e1f5ff,stroke:#3b82f6,stroke-width:2px,color:#1f2937
style B fill:#fff4e1,stroke:#f59e0b,stroke-width:2px,color:#1f2937
style C fill:#c8e6c9,stroke:#10b981,stroke-width:2px,color:#1f2937
style D fill:#f3e5f5,stroke:#8b5cf6,stroke-width:2px,color:#1f2937
- π§ Knowledge Organization: Turn debugging scripts into reusable neurons
- π Workflow Automation: Chain neurons into powerful synapses
- π€ AI-Powered: Generate debugging scripts from natural language (coming soon)
- π Visual Insights: Modern web UI with real-time execution tracking (coming soon)
- π Deploy Anywhere: Single 50MB binary OR Kubernetes cluster
- β Neuron Execution: Run discrete debugging tasks with structured output
- β Synapse Orchestration: Chain neurons in sequential or parallel workflows
- β CLI Interface: Powerful command-line tool with intuitive commands
- π§ AI Generation: Generate neurons from natural language (OpenAI, Anthropic, Ollama)
- π§ Web Dashboard: Real-time monitoring with WebSocket streaming
- π§ Visual Builder: Drag-and-drop synapse creation
- π Fleet Management: Monitor distributed edge devices
- π Plugin System: Extend functionality with custom plugins
# Clone the repository
git clone https://github.com/anoop2811/cortex.git
cd cortex
# Build the binary
make build
# Verify installation
./cortex --versionA neuron is a discrete debugging task (shell script + config).
# Create a neuron
cortex create-neuron check-nginx
# This creates:
# check-nginx/
# βββ config.yml
# βββ run.shHow it works:
sequenceDiagram
participant User
participant Cortex
participant Neuron
participant System
User->>Cortex: cortex exec -p check-nginx
Cortex->>Neuron: Load config.yml
Neuron-->>Cortex: Configuration loaded
Cortex->>System: Execute pre_exec_debug
System-->>User: Checking nginx status...
Cortex->>System: Execute run.sh
System->>System: systemctl is-active nginx
System-->>Cortex: Exit code 0
Cortex->>User: Success - Nginx is running!
Edit check-nginx/config.yml:
---
name: check_nginx
type: check
description: "Check if nginx is running"
exec_file: run.sh
pre_exec_debug: "Checking nginx status..."
post_exec_success_debug: "Nginx is running!"Edit check-nginx/run.sh:
#!/bin/bash
systemctl is-active nginxExecute:
cortex exec -p check-nginxA synapse is a workflow that chains multiple neurons.
# Create a synapse
cortex create-synapse health-checkConfigure health-check/config.yml:
---
name: health-check
description: "Complete system health check"
neurons:
- check-nginx
- check-database
- check-disk-space
execution: sequential # or parallel
stopOnError: trueExecute:
cortex exec -p health-checkSynapse Execution Flow:
flowchart LR
Start([Execute Synapse]) --> N1[check-nginx]
N1 -->|Success| N2[check-database]
N1 -->|Failure| Stop1[Stop<br/>stopOnError]
N2 -->|Success| N3[check-disk-space]
N2 -->|Failure| Stop2[Stop]
N3 -->|Success| Done[All Checks Passed]
N3 -->|Failure| Stop3[Failed]
style Start fill:#e1f5ff,stroke:#3b82f6,stroke-width:2px,color:#1f2937
style N1 fill:#fff4e1,stroke:#f59e0b,stroke-width:2px,color:#1f2937
style N2 fill:#fff4e1,stroke:#f59e0b,stroke-width:2px,color:#1f2937
style N3 fill:#fff4e1,stroke:#f59e0b,stroke-width:2px,color:#1f2937
style Done fill:#c8e6c9,stroke:#10b981,stroke-width:2px,color:#1f2937
style Stop1 fill:#ffcdd2,stroke:#ef4444,stroke-width:2px,color:#1f2937
style Stop2 fill:#ffcdd2,stroke:#ef4444,stroke-width:2px,color:#1f2937
style Stop3 fill:#ffcdd2,stroke:#ef4444,stroke-width:2px,color:#1f2937
High-Level System Design:
graph TB
subgraph "User Interfaces"
CLI[CLI Interface<br/>cobra + viper]
WebUI[Web Dashboard<br/>React + Vite]
end
subgraph "Core Engine"
Orchestrator[Orchestrator]
NeuronExec[Neuron Executor]
SynapseDAG[Synapse DAG Engine]
AIGen[AI Generator<br/>OpenAI/Anthropic/Ollama]
end
subgraph "Storage"
FileSystem[(File System<br/>YAML + Shell)]
end
CLI --> Orchestrator
WebUI -.->|future| Orchestrator
Orchestrator --> NeuronExec
Orchestrator --> SynapseDAG
Orchestrator --> AIGen
NeuronExec --> FileSystem
SynapseDAG --> FileSystem
AIGen -.->|future| FileSystem
style CLI fill:#e1f5ff,color:#1f2937
style WebUI fill:#e1f5ff,stroke-dasharray: 5 5,color:#1f2937
style Orchestrator fill:#fff4e1,color:#1f2937
style NeuronExec fill:#c8e6c9,color:#1f2937
style SynapseDAG fill:#c8e6c9,color:#1f2937
style AIGen fill:#f3e5f5,stroke-dasharray: 5 5,color:#1f2937
style FileSystem fill:#fce4ec,color:#1f2937
π See detailed diagrams: Architecture Diagrams
- Neurons: Discrete debugging tasks (shell scripts with metadata)
- Synapses: Workflows that chain neurons in DAGs
- Execution: Sequential or parallel neuron execution
- AI Generation: Generate neurons from natural language (coming soon)
See Architecture Documentation for details.
- Getting Started Guide - Install and run your first neuron
- User Guide - Complete feature documentation (coming soon)
- Contributing Guide - How to contribute
- Testing Guide - TDD workflow with Ginkgo and Playwright
- Architecture Docs - System design and components
- AI Neuron Generation - AI feature design
- Web UI Specification - Web interface design
- Dependencies - All open source dependencies
Check out the examples/ directory for sample neurons and synapses:
system_health_check/- Basic system diagnosticsk8s/k8s_cluster_health/- Kubernetes cluster health check
Common Debugging Workflows:
flowchart TB
subgraph devops["DevOps and SRE"]
Daily[Daily Health Checks]
Incident[Incident Response]
Auto[Automated Remediation]
end
subgraph k8s["Kubernetes"]
K8sHealth[Cluster Health]
PodDebug[Pod Diagnostics]
Resource[Resource Analysis]
end
subgraph db["Database"]
DBHealth[Health Checks]
Replication[Replication Status]
Performance[Query Performance]
end
subgraph ai["AI-Generated"]
PortCheck[Port Process Check]
DiskAlert[Disk Usage Alerts]
LogAnalysis[Log Analysis]
end
style Daily fill:#e1f5ff,stroke:#3b82f6,stroke-width:2px,color:#1f2937
style Incident fill:#ffcdd2,stroke:#ef4444,stroke-width:2px,color:#1f2937
style Auto fill:#c8e6c9,stroke:#10b981,stroke-width:2px,color:#1f2937
style K8sHealth fill:#fff4e1,stroke:#f59e0b,stroke-width:2px,color:#1f2937
style DBHealth fill:#f3e5f5,stroke:#8b5cf6,stroke-width:2px,color:#1f2937
style PortCheck fill:#e8f5e9,stroke:#10b981,stroke-width:2px,color:#1f2937
# Daily health checks
cortex exec -p daily-health-check
# Incident response
cortex exec -p incident-diagnostics
# Automated remediation
cortex exec -p auto-fix-nginx# Check cluster health
cortex exec -p k8s-cluster-health
# Debug pod issues
cortex exec -p k8s-pod-diagnostics
# Analyze resource usage
cortex exec -p k8s-resource-analysis# Solve real debugging problems with natural language
cortex generate-neuron \
--prompt "Find which process is using port 8080 and show full command with PID" \
--provider openai
# Complex multi-step diagnostics
cortex generate-neuron \
--prompt "Check if PostgreSQL is running, accepting connections, and responding to queries" \
--provider anthropic
# Local generation (no API key needed)
cortex generate-neuron \
--prompt "Show disk usage for all mounts and alert if any exceeds 80%" \
--provider ollama- Go 1.25.4+
- Node.js 24.x LTS (for web UI)
- Make
# Install dependencies
make install-deps
# Run tests
make test-all
# Build
make build
# Run in watch mode (TDD)
make watchWe follow Test-Driven Development (TDD) with outer/inner loops:
# All tests
make test-all
# Unit tests (inner loop)
make test-unit
# Acceptance tests (outer loop)
make test-acceptance
# Coverage report
make coverageTDD Workflow:
flowchart LR
Red1[RED: Acceptance<br/>Test Fails] --> Red2[RED: Unit<br/>Test Fails]
Red2 --> Green[GREEN: Write<br/>Code]
Green --> Pass{Tests<br/>Pass?}
Pass -->|No| Red2
Pass -->|Yes| Refactor[REFACTOR:<br/>Improve Code]
Refactor --> Done[Feature Complete]
style Red1 fill:#ffcdd2,stroke:#ef4444,stroke-width:2px,color:#1f2937
style Red2 fill:#ffcdd2,stroke:#ef4444,stroke-width:2px,color:#1f2937
style Green fill:#c8e6c9,stroke:#10b981,stroke-width:2px,color:#1f2937
style Refactor fill:#e1bee7,stroke:#8b5cf6,stroke-width:2px,color:#1f2937
style Done fill:#c8e6c9,stroke:#10b981,stroke-width:2px,color:#1f2937
See Testing Guide for details.
We welcome contributions! Please see our Contributing Guide.
# 1. Fork the repository
# 2. Clone your fork
git clone https://github.com/YOUR-USERNAME/cortex.git
# 3. Create feature branch
git checkout -b feature/my-feature
# 4. Make changes and test
make test-all
# 5. Submit pull request- π Report bugs
- π‘ Suggest features
- π Improve documentation
- π§ͺ Write tests
- π» Submit pull requests
- π Translate documentation
- Version: 1.0 (in development)
- License: Apache 2.0
- Language: Go 1.25.4
- Dependencies: 100% open source
- β Core neuron/synapse execution
- β CLI interface
- β Test infrastructure (Ginkgo v2 + Playwright)
- π§ AI neuron generation (OpenAI, Anthropic, Ollama)
- π§ Web UI dashboard (React + Vite)
- π§ Visual synapse builder
- π§ Kubernetes deployment
- π Fleet management
- π Plugin marketplace
- Backend: Go 1.25.4, Cobra, Viper, Zerolog
- Frontend: React 19, Vite 6, Tailwind CSS 4, TanStack Query
- Testing: Ginkgo v2, Gomega, Playwright
- Deployment: Docker, Kubernetes, Helm
All dependencies are verified as 100% open source. See DEPENDENCIES.md.
Debugging infrastructure is often an art, with knowledge scattered across:
- Personal scripts on laptops
- Slack conversations
- Tribal knowledge
- "What did I do 2 weeks ago?"
Cortex brings science to the art by:
- Organizing debugging steps into reusable neurons
- Automating workflows with synapses
- Sharing knowledge across teams
- AI-powered script generation (coming soon)
- Edge-First: Run on anything (Raspberry Pi to Kubernetes)
- Shell-Native: Embrace existing bash/PowerShell scripts
- Progressive: Start simple, add features as needed
- Privacy-First: AI is optional, local mode available
- Open Source: 100% Apache 2.0, no bait-and-switch
Cortex takes security seriously. We use automated scanning and follow secure development practices.
- Security Policy: See SECURITY.md for vulnerability reporting
- Automated Scanning: Dependabot, CodeQL, Trivy, Gosec
- Dependency Updates: Weekly automated security patches
Found a security issue? Please report it privately - see SECURITY.md
- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: Questions and ideas
- Pull Requests: Contribute code
Apache License 2.0 - See LICENSE for details.
Built with β€οΈ by the Cortex community.
Special thanks to all contributors.
Documentation β’ Getting Started β’ Contributing β’ Architecture