Capy cortex

From happycapy-ai/Happycapy-skills · View interactive version

Capy cortex is an AI agent skill from the GitHub repository happycapy-ai/Happycapy-skills. Autonomous learning system - learns from mistakes, reflects on sessions, and gets smarter over time. The AI brain.

How to use this skill

Skill file

Capy Cortex - Autonomous Learning System

You have a persistent learning brain powered by SQLite + FTS5 + sklearn TF-IDF.

Knowledge is automatically loaded via hooks. This file describes manual operations.

Architecture

Manual Commands

# Check system health
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py stats

# Retrieve rules for a topic
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py retrieve "react typescript"

# Add a rule manually
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-rule "Always use TypeScript strict mode" "best_practice"

# Add an anti-pattern
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-ap "Never force push to main" "critical"

# Add a preference
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-pref "User prefers functional components over class components"

# Run consolidation (clusters rules into principles)
python3 ~/.claude/skills/capy-cortex/scripts/consolidate.py

# Retrain TF-IDF model
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py retrain

# Apply confidence decay
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py decay

How It Learns

  1. Automatic (via hooks): Errors are captured, corrections noted, preferences extracted
  2. Reflection: Deep analysis of session transcripts extracts patterns
  3. Consolidation: sklearn clustering groups similar rules into principles
  4. Decay: Old, unreinforced rules fade; validated rules strengthen
  5. Retrieval: Two-stage FTS5 + TF-IDF returns only relevant knowledge (O(1) context)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.