brainy/CLI_AUGMENTATION_GUIDE.md
David Snelling f7484a9467 feat: Simplify architecture with Cortex orchestrator and clear augmentation tiers
## Major Architecture Improvements

### Cortex Refactoring
- Renamed AugmentationPipeline → Cortex for clarity
- Cortex is now the central orchestrator (not an augmentation)
- NeuralImport remains as the AI-powered SENSE augmentation
- Clean brain metaphor: BrainyData → Cortex → Augmentations

### Four-Tier Augmentation System
1. **Built-in** (Free, MIT): Neural Import, basic storage, search
2. **Community** (Free, npm): Community-created augmentations
3. **Premium** ($49-299/mo): AI Memory, Agent Coordinator, Enterprise connectors
4. **Brain Cloud** ($19-99/mo): Managed service with all features

### Zero Configuration Philosophy
- Everything works out of the box - no config needed
- Automatic model detection and loading
- Seamless integration between tiers
- Brain Cloud connects with one command: `brainy cloud`

### Documentation Updates
- Added PHILOSOPHY.md outlining design principles
- Created AUGMENTATION_ARCHITECTURE.md with tier system
- Added CLI_AUGMENTATION_GUIDE.md for augmentation management
- Updated README to "sell first" with concrete use cases
- Improved documentation organization in /docs

### Developer Experience
- Backward compatibility maintained with exports
- Clean, simple API surface
- Interactive-by-default approach
- Premium features integrate seamlessly

### Removed
- Deleted demo directory and deploy workflow (moved to website)
- Removed test wrapper scripts (bash 2>&1 bug workaround)

This refactor makes Brainy incredibly powerful yet easy to use, with everything automated and no configuration required. The Brain Cloud augmentations (AI memory, sync, coordination) integrate seamlessly as our killer features.
2025-08-11 09:40:37 -07:00

5.9 KiB
Raw Blame History

🧠 Brainy CLI - Augmentation Management Guide

Complete CLI Commands for Augmentations

Core Commands

# Initialize Brainy
brainy init

# Basic operations
brainy add "data"           # Add data
brainy search "query"       # Search
brainy chat                 # Interactive chat

Augmentation Management

# List all augmentations
brainy augment              # Shows installed & available
brainy augment list         # Same as above
brainy augment available    # Shows what can be installed

# Add augmentations
brainy augment add          # Interactive mode
brainy augment add neural-import    # Built-in
brainy augment add brainy-sentiment  # Community (from npm)
brainy augment add ai-memory --premium  # Premium (needs license)

# Remove augmentations
brainy augment remove sentiment-analyzer
brainy augment disable neural-import  # Disable but keep installed

# Configure augmentations
brainy augment config neural-import
brainy augment config notion-sync --set apiKey=xxx

Installing Different Types

1. Built-in Augmentations (Free, Always Available)

# These are included - just enable them
brainy augment enable neural-import
brainy augment enable auto-save
brainy augment enable basic-cache

2. Community Augmentations (Free, From npm)

# Step 1: Install from npm
npm install -g brainy-sentiment

# Step 2: Register with Brainy
brainy augment add brainy-sentiment

# Or in one command (coming soon)
brainy augment install brainy-sentiment  # Auto-installs from npm

3. Premium Augmentations (Paid, From @soulcraft/brain-cloud)

# Step 1: Set license key
export BRAINY_LICENSE_KEY=lic_xxxxxxxxxxxxx

# Step 2: Install premium package
npm install -g @soulcraft/brain-cloud

# Step 3: Add specific augmentations
brainy augment add ai-memory --premium
brainy augment add agent-coordinator --premium
brainy augment add notion-sync --premium

# Or add all premium at once
brainy augment add-premium --all

4. Brain Cloud Service (Managed, Everything Included)

# Connect to Brain Cloud (includes all augmentations)
brainy cloud --connect YOUR_CUSTOMER_ID

# Check status
brainy cloud --status

# Force sync
brainy cloud --sync

# Open dashboard
brainy cloud --dashboard

Working with Different Instances

Local Instance

# Add augmentation to local Brainy
cd my-project
brainy init
brainy augment add neural-import

Remote Hosted Instance

# Connect to remote Brainy server
brainy config set server.url https://my-brainy-server.com
brainy config set server.apiKey xxx

# Add augmentation to remote
brainy augment add sentiment-analyzer --remote

Brain Cloud Instance

# Everything is managed
brainy cloud --connect CUSTOMER_ID
# All augmentations automatically available

Interactive Mode Examples

Adding an Augmentation (No Arguments)

$ brainy augment add
? What type of augmentation?  
  Built-in (Free)
  Community (npm)
  Premium (Licensed)
  
? Select augmentation  
  ✓ neural-import (AI understanding)
  ○ sentiment-analyzer (Emotion detection)
  ○ translator (Multi-language)
  
? Configure now? (Y/n)  

Configuring an Augmentation

$ brainy augment config notion-sync
? Notion API Token  secret_xxxxx
? Sync Mode  
  ○ Read only
  ● Bidirectional
  ○ Write only
  
? Sync Interval (minutes)  5
✅ Configuration saved!

CLI Implementation in brainy.js

// brainy augment command structure
program
  .command('augment [action] [name]')
  .description('Manage brain augmentations')
  .option('--type <type>', 'Augmentation type (sense|conduit|memory|etc)')
  .option('--premium', 'Premium augmentation')
  .option('--remote', 'Install on remote server')
  .action(async (action, name, options) => {
    if (!action) {
      // List all augmentations
      await listAugmentations()
    } else {
      switch(action) {
        case 'add':
        case 'install':
          await installAugmentation(name, options)
          break
        case 'remove':
          await removeAugmentation(name)
          break
        case 'config':
          await configureAugmentation(name, options)
          break
        case 'list':
          await listAugmentations()
          break
        case 'enable':
          await enableAugmentation(name)
          break
        case 'disable':
          await disableAugmentation(name)
          break
      }
    }
  })

Environment Variables

# For premium augmentations
export BRAINY_LICENSE_KEY=lic_xxxxxxxxxxxxx

# For Brain Cloud
export BRAIN_CLOUD_KEY=bc_xxxxxxxxxxxxx
export BRAIN_CLOUD_CUSTOMER_ID=cust_xxxxx

# For remote server
export BRAINY_SERVER_URL=https://my-server.com
export BRAINY_SERVER_KEY=xxx

Package.json Scripts

Add these to your project's package.json:

{
  "scripts": {
    "brain:init": "brainy init",
    "brain:augment": "brainy augment",
    "brain:add-sentiment": "brainy augment add brainy-sentiment",
    "brain:add-premium": "brainy augment add ai-memory --premium",
    "brain:cloud": "brainy cloud --connect"
  }
}

Error Messages & Solutions

# Missing license key
❌ Premium augmentation requires license key
💡 Set BRAINY_LICENSE_KEY or visit soulcraft.com

# Augmentation not found
❌ Augmentation 'xyz' not found
💡 Try: npm install brainy-xyz first

# Remote connection failed
❌ Cannot connect to remote server
💡 Check BRAINY_SERVER_URL and network connection

# Incompatible version
❌ Augmentation requires Brainy v0.62+
💡 Update: npm update @soulcraft/brainy

Summary

The CLI provides a unified interface for managing all augmentation types:

  • Built-in: Always available, just enable
  • Community: Install from npm, then add
  • Premium: Need license, install from @soulcraft/brain-cloud
  • Brain Cloud: Everything managed, just connect

The key is making it simple for beginners (interactive mode) while powerful for experts (direct commands).