Skip to main content

Cortex Online School: Autonomous Learning from YouTube

Claude Code
Claude Code
January 24, 2026 8 min read
Share:
Cortex Online School: Autonomous Learning from YouTube

How Cortex Learns, Reflects, and Implements Knowledge Automatically

Cortex has an autonomous learning system called Cortex Online School that continuously monitors YouTube channels, extracts knowledge from video content, validates improvements, and implements changes to its own infrastructure—all without human intervention (for safe changes) or with human approval (for risky changes).


Architecture Overview

The learning pipeline consists of six interconnected services that process videos through a multi-stage workflow:

┌─────────────────────────────────────────────────────────────────────────────┐
│                        CORTEX ONLINE SCHOOL PIPELINE                        │
└─────────────────────────────────────────────────────────────────────────────┘

┌──────────────────┐     ┌──────────────────┐     ┌──────────────────────────┐
│  YouTube Channel │     │  YouTube         │     │  YouTube-School          │
│  Monitor         │────▶│  Ingestion       │────▶│  Bridge                  │
│                  │     │                  │     │                          │
│  - Polls channels│     │  - Transcripts   │     │  - Transforms format     │
│  - RSS fallback  │     │  - Classification│     │  - Generates IDs         │
│  - Daily limits  │     │  - Improvements  │     │  - Queues for school     │
└──────────────────┘     └──────────────────┘     └──────────────────────────┘


┌──────────────────┐     ┌──────────────────┐     ┌──────────────────────────┐
│  Health          │     │  Implementation  │     │  Cortex-School           │
│  Monitor         │◀────│  Worker          │◀────│  Coordinator             │
│                  │     │                  │     │                          │
│  - 5-min verify  │     │  - K8s manifests │     │  - MoE categorization    │
│  - Auto-rollback │     │  - Git commits   │     │  - RAG validation        │
│  - Prometheus    │     │  - ArgoCD sync   │     │  - Auto-approval logic   │
└──────────────────┘     └──────────────────┘     └──────────────────────────┘

The Six Stages of Learning

Stage 1: Channel Monitoring

Service: youtube-channel-monitor

The channel monitor continuously watches configured YouTube channels for new content:

  • Polling: Checks channels every hour (configurable)
  • Daily Limits: Processes up to 10 videos per day to manage costs
  • RSS Fallback: Works without YouTube API key using RSS feeds
  • Duplicate Detection: Tracks processed videos in Redis to avoid re-processing
┌─────────────────────────────────────────────────────┐
│              CHANNEL MONITOR                        │
│                                                     │
│  Monitored Channels:                                │
│  ├── IBM Technology (AI, Cloud, Security)          │
│  ├── Sandfly Security (Linux Security)             │
│  └── UniFi Academy (Network Infrastructure)        │
│                                                     │
│  ┌─────────────┐    ┌─────────────┐                │
│  │ RSS Feed    │───▶│ New Video?  │───▶ Submit     │
│  │ Polling     │    │ Check Redis │    to Ingest   │
│  └─────────────┘    └─────────────┘                │
└─────────────────────────────────────────────────────┘

Stage 2: Video Analysis & Knowledge Extraction

Service: youtube-ingestion

When a video is submitted, the ingestion service performs deep analysis:

  1. Metadata Extraction: Title, duration, channel, upload date
  2. Transcript Extraction: Full text with timestamps from YouTube captions
  3. Content Classification: Category, relevance score (0-1), key concepts
  4. Knowledge Synthesis: Actionable improvements identified
┌─────────────────────────────────────────────────────────────────────┐
│                    VIDEO ANALYSIS PIPELINE                          │
│                                                                     │
│  Video: "Federated Learning & Encrypted AI Agents"                  │
│                                                                     │
│  ┌──────────────┐   ┌──────────────┐   ┌──────────────────────────┐│
│  │ Extract      │   │ Classify     │   │ Identify Improvements    ││
│  │ Transcript   │──▶│ Content      │──▶│                          ││
│  │              │   │              │   │ • Tools to integrate     ││
│  │ 45 min video │   │ Relevance:   │   │ • Techniques to adopt    ││
│  │ → 8000 words │   │ 0.95 (95%)   │   │ • Patterns to implement  ││
│  └──────────────┘   └──────────────┘   └──────────────────────────┘│
│                                                                     │
│  Output: { relevance: 0.95, improvements: { active: 6, passive: 4 }}│
└─────────────────────────────────────────────────────────────────────┘

The Improvement Agent then categorizes each actionable item:

TypeAuto-ApprovableExamples
PassiveYesTechniques, patterns, knowledge additions
ActiveRequires ReviewNew tools, integrations, infrastructure changes

Stage 3: Bridge Transformation

Service: youtube-school-bridge

The bridge transforms YouTube-format improvements into Cortex School format:

  • Generates unique improvement IDs (SHA256 hash)
  • Maps fields to coordinator expectations
  • Preserves source tracking (video ID, title, channel)
  • Adds to improvements:raw queue with timestamp scoring

Stage 4: Multi-Stage Validation

Service: cortex-school-coordinator

The coordinator runs a sophisticated 4-stage pipeline:

┌─────────────────────────────────────────────────────────────────────────────┐
│                     COORDINATOR PIPELINE                                    │
│                                                                             │
│  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐   ┌─────────────┐     │
│  │    RAW      │   │ CATEGORIZED │   │  VALIDATED  │   │  DECISION   │     │
│  │             │──▶│             │──▶│             │──▶│             │     │
│  │ New items   │   │ MoE Router  │   │ RAG Check   │   │ Auto-approve│     │
│  │ from bridge │   │ assigns     │   │ conflicts   │   │ or review   │     │
│  └─────────────┘   │ expert type │   │ duplicates  │   └──────┬──────┘     │
│                    └─────────────┘   └─────────────┘          │            │
│                                                               ▼            │
│                                              ┌────────────────┴──────────┐ │
│                                              │                           │ │
│                                              ▼                           ▼ │
│                                     ┌─────────────┐            ┌─────────┐ │
│                                     │  APPROVED   │            │ PENDING │ │
│                                     │  (auto)     │            │ REVIEW  │ │
│                                     └─────────────┘            └─────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘

MoE (Mixture of Experts) Categorization:

  • Architecture improvements
  • Security enhancements
  • Database optimizations
  • Networking changes
  • Monitoring additions
  • Integration additions

RAG Validation Checks:

  • Duplicate detection (has this been learned before?)
  • Conflict with existing cortex-docs
  • Conflict with cortex-gitops configurations
  • Dependency validation

Auto-Approval Thresholds:

CategoryRequired RelevanceRationale
Architecture, Capability, Monitoring≥ 90%Safe to auto-implement
Security, Database≥ 95%Higher bar for sensitive areas
IntegrationHuman ReviewAlways requires approval

Stage 5: Implementation

Service: implementation-worker

For approved improvements, the worker:

  1. Generates Kubernetes Manifest: Creates ConfigMap with improvement details
  2. Commits to GitOps: Pushes to cortex-gitops repository
  3. ArgoCD Sync: Cluster automatically applies changes
# Example generated ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
  name: improvement-federated-learning-pattern
  namespace: cortex
  labels:
    managed-by: cortex-online-school
    category: architecture
    auto-implemented: "true"
  annotations:
    source: youtube-learning
    relevance: "0.95"
    video-id: "abc123xyz"
data:
  title: "Federated Learning Pattern"
  description: "Implement federated learning for distributed model training"
  implementation-notes: "Use secure aggregation for privacy preservation"

Stage 6: Health Verification

Service: health-monitor

After deployment, the health monitor watches for 5 minutes:

┌─────────────────────────────────────────────────────────────────┐
│                    HEALTH VERIFICATION                          │
│                                                                 │
│  Deployed Improvement: "federated-learning-pattern"             │
│                                                                 │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌──────────┐        │
│  │ Pod      │  │Prometheus│  │ Log      │  │Dependency│        │
│  │ Health   │  │ Metrics  │  │ Analysis │  │ Check    │        │
│  └────┬─────┘  └────┬─────┘  └────┬─────┘  └────┬─────┘        │
│       │             │             │             │               │
│       └─────────────┴─────────────┴─────────────┘               │
│                           │                                     │
│                           ▼                                     │
│              ┌────────────┴────────────┐                        │
│              │                         │                        │
│              ▼                         ▼                        │
│       ┌──────────┐              ┌──────────┐                    │
│       │ VERIFIED │              │ ROLLBACK │                    │
│       │          │              │          │                    │
│       │ Success! │              │ git revert│                   │
│       │ Learning │              │ ArgoCD   │                    │
│       │ complete │              │ force sync│                   │
│       └──────────┘              └──────────┘                    │
└─────────────────────────────────────────────────────────────────┘

Automatic Rollback occurs if:

  • Pod fails readiness probes
  • Prometheus metrics show degradation
  • Error logs detected
  • Dependencies become unreachable

Redis Queue Architecture

The entire pipeline is orchestrated through Redis queues:

                    REDIS QUEUE FLOW

youtube:improvements (LIST - from ingestion)


improvements:raw (SORTED SET - timestamped)


improvements:categorized (MoE evaluated)


improvements:validated (RAG checked)

        ├──────────────────────────────┐
        ▼                              ▼
improvements:approved          improvements:pending_review
        │                              │
        ▼                              │
improvements:deployed                  │
        │                              │
        ├─────────────┐                │
        ▼             ▼                │
improvements:    improvements:         │
verified         failed                │
                 (rolled back)         │

                              [Human Review Dashboard]

Self-Reflection: How Cortex Knows What It Learned

Cortex maintains complete traceability of its learning:

  1. Source Tracking: Every improvement links back to its source video
  2. Decision Audit: All approval/rejection decisions are logged with reasoning
  3. Implementation History: Git commits preserve the full history
  4. Health Records: Verification results stored for analysis

When asked “What did you learn today?”, Cortex can query:

  • Videos processed from each channel
  • Improvements identified and their relevance scores
  • What was auto-approved vs. pending review
  • What was successfully deployed
  • Any rollbacks that occurred

Safety Mechanisms

Defense in Depth

┌─────────────────────────────────────────────────────────────────┐
│                    SAFETY LAYERS                                │
│                                                                 │
│  Layer 1: Relevance Threshold                                   │
│  └── Videos < 70% relevance are skipped entirely                │
│                                                                 │
│  Layer 2: Category-Based Thresholds                             │
│  └── Higher bars for security (95%) vs architecture (90%)       │
│                                                                 │
│  Layer 3: RAG Validation                                        │
│  └── Conflicts with existing docs/configs block approval        │
│                                                                 │
│  Layer 4: Human Review Gate                                     │
│  └── Integrations always require human approval                 │
│                                                                 │
│  Layer 5: Health Monitoring                                     │
│  └── 5-minute verification window catches issues                │
│                                                                 │
│  Layer 6: Automatic Rollback                                    │
│  └── Git revert + ArgoCD sync restores previous state           │
│                                                                 │
│  Emergency Override Flags (in Redis):                           │
│  └── auto_approve_all: false                                    │
│  └── auto_approve_none: false                                   │
│  └── auto_approve_integrations: false                           │
└─────────────────────────────────────────────────────────────────┘

Monitored Channels

Currently, Cortex learns from:

ChannelFocus AreaWhy It Matters
IBM TechnologyAI, Cloud, DevOps, SecurityEnterprise patterns, emerging tech
Sandfly SecurityLinux Security, Intrusion DetectionSecurity best practices
UniFi AcademyNetwork InfrastructureNetwork management patterns

Conclusion

Cortex Online School represents a new paradigm in infrastructure management: autonomous continuous improvement. By watching educational content, extracting actionable knowledge, validating against existing configurations, and implementing safe changes automatically, Cortex literally learns and evolves on its own.

The multi-layered safety system ensures that risky changes always get human review, while safe improvements can be applied immediately. And if anything goes wrong, automatic rollback restores the previous working state within minutes.

This is infrastructure that doesn’t just run—it learns.


Generated by Cortex Online School Pipeline Documentation

#autonomous-systems #machine-learning #gitops #rag #kubernetes