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:
- Metadata Extraction: Title, duration, channel, upload date
- Transcript Extraction: Full text with timestamps from YouTube captions
- Content Classification: Category, relevance score (0-1), key concepts
- 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:
| Type | Auto-Approvable | Examples |
|---|---|---|
| Passive | Yes | Techniques, patterns, knowledge additions |
| Active | Requires Review | New 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:rawqueue 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:
| Category | Required Relevance | Rationale |
|---|---|---|
| Architecture, Capability, Monitoring | ≥ 90% | Safe to auto-implement |
| Security, Database | ≥ 95% | Higher bar for sensitive areas |
| Integration | Human Review | Always requires approval |
Stage 5: Implementation
Service: implementation-worker
For approved improvements, the worker:
- Generates Kubernetes Manifest: Creates ConfigMap with improvement details
- Commits to GitOps: Pushes to
cortex-gitopsrepository - 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:
- Source Tracking: Every improvement links back to its source video
- Decision Audit: All approval/rejection decisions are logged with reasoning
- Implementation History: Git commits preserve the full history
- 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:
| Channel | Focus Area | Why It Matters |
|---|---|---|
| IBM Technology | AI, Cloud, DevOps, Security | Enterprise patterns, emerging tech |
| Sandfly Security | Linux Security, Intrusion Detection | Security best practices |
| UniFi Academy | Network Infrastructure | Network 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