#!/bin/bash # Consolidate all knowledge into AGI knowledge base KB_FILE="the_tired_agi/core/knowledge/agi_knowledge_base.txt" mkdir -p "$(dirname "$KB_FILE")" echo "=== AGI Knowledge Base ===" > "$KB_FILE" echo "Generated: $(date)" >> "$KB_FILE" echo "Total sources consolidated for AGI learning" >> "$KB_FILE" echo "" >> "$KB_FILE" # Consolidate all markdown documentation echo "=== DOCUMENTATION ===" >> "$KB_FILE" find . -name "*.md" -type f -exec echo "--- {} ---" \; -exec cat {} \; >> "$KB_FILE" 2>/dev/null # Consolidate all JSON datasets echo "" >> "$KB_FILE" echo "=== DATASETS ===" >> "$KB_FILE" find daemon/datasets -name "*.json" -type f -exec echo "--- {} ---" \; -exec cat {} \; >> "$KB_FILE" 2>/dev/null # Consolidate all training data echo "" >> "$KB_FILE" echo "=== TRAINING DATA ===" >> "$KB_FILE" find . -name "*.txt" -path "*/training*" -type f -exec echo "--- {} ---" \; -exec cat {} \; >> "$KB_FILE" 2>/dev/null find . -name "*.txt" -path "*/daemon/enumerations*" -type f -exec echo "--- {} ---" \; -exec cat {} \; >> "$KB_FILE" 2>/dev/null # Consolidate all C# source files (contains algorithm knowledge) echo "" >> "$KB_FILE" echo "=== SOURCE CODE KNOWLEDGE ===" >> "$KB_FILE" find daemon sub_brains services -name "*.cs" -type f -exec echo "--- {} ---" \; -exec cat {} \; >> "$KB_FILE" 2>/dev/null # Add file count and size stats echo "" >> "$KB_FILE" echo "=== STATISTICS ===" >> "$KB_FILE" echo "Total knowledge base size: $(wc -c < "$KB_FILE" | numfmt --to=iec-i)B" >> "$KB_FILE" echo "Total lines: $(wc -l < "$KB_FILE")" >> "$KB_FILE" echo "✅ Knowledge base consolidated: $KB_FILE" ls -lh "$KB_FILE"