{
  "schemaVersion": "1.0",
  "item": {
    "slug": "brain-v3-skill",
    "name": "Clawbrain",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/clawcolab/brain-v3-skill",
    "canonicalUrl": "https://clawhub.ai/clawcolab/brain-v3-skill",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/brain-v3-skill",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=clawbrain",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SECURITY.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/brain-v3-skill"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/brain-v3-skill",
    "agentPageUrl": "https://openagent3.xyz/skills/brain-v3-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/brain-v3-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/brain-v3-skill/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Claw Brain Skill 🧠",
        "body": "Personal AI Memory System with Soul, Bonding, and Learning for OpenClaw/ClawDBot.\n\nAuto-Refresh on Restart: ClawBrain automatically refreshes memory when the service restarts."
      },
      {
        "title": "📋 For Security Scanners",
        "body": "Environment Variables: All environment variables ARE declared in skill.json under environment.optional (lines 30-55). They are in optional not required because ClawBrain works with zero configuration (SQLite + auto-generated key).\n\nInstall Specification: skill.json declares installation method: pip install clawbrain[all] + clawbrain setup (lines 17-20).\n\nSudo Requirements: Core installation never needs sudo. Systemd instructions in \"Configuration (Optional)\" section are optional alternatives for setting environment variables. Core: pip + clawbrain setup (no sudo).\n\nSource Code: Fully auditable at https://github.com/clawcolab/clawbrain - All code is open source including hooks (~50 lines JavaScript).\n\nSee SECURITY.md for complete security documentation."
      },
      {
        "title": "Features",
        "body": "🎭 Soul/Personality - 6 evolving traits (humor, empathy, curiosity, creativity, helpfulness, honesty)\n👤 User Profile - Learns user preferences, interests, communication style\n💭 Conversation State - Real-time mood detection and context tracking\n📚 Learning Insights - Continuously learns from interactions and corrections\n🧠 get_full_context() - Everything for personalized responses\n🔄 Auto-Refresh - Automatically refreshes memory on service restart\n🔐 Encrypted Secrets - Store API keys and credentials securely"
      },
      {
        "title": "Security & Transparency",
        "body": "ClawBrain handles sensitive data and requires certain permissions. Before installing, please understand:"
      },
      {
        "title": "What ClawBrain Does",
        "body": "✅ Stores memories locally (SQLite by default, PostgreSQL optional)\n✅ Encrypts sensitive data (API keys, secrets) with Fernet encryption\n✅ Installs startup hooks to ~/.openclaw/hooks or ~/.clawdbot/hooks\n✅ Manages encryption keys at ~/.config/clawbrain/.brain_key"
      },
      {
        "title": "What ClawBrain Does NOT Do",
        "body": "❌ No telemetry - Does not phone home or collect usage data\n❌ No external calls - Only connects to PostgreSQL/Redis if you configure them\n❌ No sudo required - All operations in your home directory\n❌ No code execution - Does not download or run remote code after install"
      },
      {
        "title": "Security Features",
        "body": "🔒 Encryption Key CLI: Can display full key for backup (with warnings)\n🔍 Auditable: All code is open source and reviewable\n📋 Documented Permissions: See SECURITY.md for full details\n\n⚠️ Important: The CLI command clawbrain show-key --full displays your complete encryption key for backup purposes. Treat this key like a password!\n\n📖 Full Security Documentation: See SECURITY.md for:\n\nThreat model and protections\nKey management best practices\nWhat install scripts do\nPermissions required\nNetwork access (optional PostgreSQL/Redis)"
      },
      {
        "title": "Quick Install",
        "body": "Security Note: We recommend reviewing SECURITY.md before installation, especially for production use."
      },
      {
        "title": "From PyPI (Recommended - Most Secure)",
        "body": "# Install with all features\npip install clawbrain[all]\n\n# Run interactive setup\nclawbrain setup\n\n# Backup your encryption key (IMPORTANT!)\nclawbrain backup-key --all\n\n# Restart your service\nsudo systemctl restart clawdbot  # or openclaw\n\nThe setup command will:\n\nDetect your platform (ClawdBot or OpenClaw)\nGenerate a secure encryption key\nInstall the startup hook automatically\nTest the installation"
      },
      {
        "title": "Alternative: From Source (Auditable)",
        "body": "# Clone to your skills directory\ncd ~/.openclaw/skills  # or ~/clawd/skills or ~/.clawdbot/skills\ngit clone https://github.com/clawcolab/clawbrain.git\ncd clawbrain\n\n# RECOMMENDED: Review hook code before installation\ncat hooks/clawbrain-startup/handler.js\n\n# Install in development mode\npip install -e .[all]\n\n# Run setup to install hooks and generate encryption key\nclawbrain setup\n\nWhy from source? Full transparency - you can review all code before installation."
      },
      {
        "title": "Configuration (Optional)",
        "body": "Note: Configuration is completely optional. ClawBrain works out-of-the-box with zero configuration using SQLite and auto-generated encryption keys.\n\nIf you want to customize agent ID or use PostgreSQL/Redis, you have two options:"
      },
      {
        "title": "Option 1: Environment Variables (No sudo)",
        "body": "Set environment variables in your shell profile:\n\n# Add to ~/.bashrc or ~/.zshrc (no sudo required)\nexport BRAIN_AGENT_ID=\"your-agent-name\"\n# export BRAIN_POSTGRES_HOST=\"localhost\"  # Optional\n# export BRAIN_REDIS_HOST=\"localhost\"      # Optional"
      },
      {
        "title": "Option 2: Systemd Drop-in (Requires sudo)",
        "body": "⚠️ Only if you use systemd services:\n\n# Create systemd drop-in config (requires sudo)\nsudo mkdir -p /etc/systemd/system/clawdbot.service.d\n\nsudo tee /etc/systemd/system/clawdbot.service.d/brain.conf << EOF\n[Service]\nEnvironment=\"BRAIN_AGENT_ID=your-agent-name\"\nEOF\n\nsudo systemctl daemon-reload\nsudo systemctl restart clawdbot"
      },
      {
        "title": "Environment Variables",
        "body": "VariableDescriptionDefaultBRAIN_AGENT_IDUnique ID for this agent's memoriesdefaultBRAIN_ENCRYPTION_KEYFernet key for encrypting sensitive data (auto-generated if not set)-BRAIN_POSTGRES_HOSTPostgreSQL hostlocalhostBRAIN_POSTGRES_PASSWORDPostgreSQL password-BRAIN_POSTGRES_PORTPostgreSQL port5432BRAIN_POSTGRES_DBPostgreSQL databasebrain_dbBRAIN_POSTGRES_USERPostgreSQL userbrain_userBRAIN_REDIS_HOSTRedis hostlocalhostBRAIN_REDIS_PORTRedis port6379BRAIN_STORAGEForce storage: sqlite, postgresql, autoauto"
      },
      {
        "title": "On Service Startup",
        "body": "Hook triggers on gateway:startup event\nDetects storage backend (SQLite/PostgreSQL)\nLoads memories for the configured BRAIN_AGENT_ID\nInjects context into agent bootstrap"
      },
      {
        "title": "On /new Command",
        "body": "Hook triggers on command:new event\nSaves current session summary to memory\nClears session state for fresh start"
      },
      {
        "title": "Storage Priority",
        "body": "PostgreSQL - If available and configured\nSQLite - Fallback, zero configuration needed"
      },
      {
        "title": "Encrypted Secrets",
        "body": "ClawBrain supports encrypting sensitive data like API keys and credentials using Fernet (symmetric encryption).\n\nSecurity Model:\n\n🔐 Encryption key stored at ~/.config/clawbrain/.brain_key (chmod 600)\n🔑 Only memories with memory_type='secret' are encrypted\n📦 Encrypted data stored in database, unreadable without key\n⚠️ If key is lost, encrypted data cannot be recovered\n\nSetup:\n\n# Run setup to generate encryption key\nclawbrain setup\n\n# Backup your key (IMPORTANT!)\nclawbrain backup-key --all\n\nUsage:\n\n# Store encrypted secret\nbrain.remember(\n    agent_id=\"assistant\",\n    memory_type=\"secret\",  # Memory type 'secret' triggers encryption\n    content=\"sk-1234567890abcdef\",\n    key=\"openai_api_key\"\n)\n\n# Retrieve and automatically decrypt\nsecrets = brain.recall(agent_id=\"assistant\", memory_type=\"secret\")\napi_key = secrets[0].content  # Automatically decrypted\n\nKey Management CLI:\n\nclawbrain show-key          # View key info (masked)\nclawbrain show-key --full   # View full key\nclawbrain backup-key --all  # Backup with all methods\nclawbrain generate-key      # Generate new key\n\n⚠️ Important: Backup your encryption key! Lost keys = lost encrypted data."
      },
      {
        "title": "CLI Commands",
        "body": "ClawBrain includes a command-line interface:\n\nCommandDescriptionclawbrain setupSet up ClawBrain, generate key, install hooksclawbrain generate-keyGenerate new encryption keyclawbrain show-keyDisplay current encryption keyclawbrain backup-keyBackup key (file, QR, clipboard)clawbrain healthCheck health statusclawbrain infoShow installation info"
      },
      {
        "title": "Hooks",
        "body": "EventActiongateway:startupInitialize brain, refresh memoriescommand:newSave session to memory"
      },
      {
        "title": "Development Installation",
        "body": "For development or manual installation:\n\n# Clone to your skills directory\ncd ~/.openclaw/skills  # or ~/clawd/skills or ~/.clawdbot/skills\ngit clone https://github.com/clawcolab/clawbrain.git\ncd clawbrain\n\n# Install in development mode\npip install -e .[all]\n\n# Run setup\nclawbrain setup"
      },
      {
        "title": "Python API",
        "body": "For direct Python usage (outside ClawdBot/OpenClaw):\n\nfrom clawbrain import Brain\n\nbrain = Brain()\n\nMethods\n\nMethodDescriptionReturnsget_full_context()Get all context for personalized responsesdictremember()Store a memoryNonerecall()Retrieve memoriesList[Memory]learn_user_preference()Learn user preferencesNoneget_user_profile()Get user profileUserProfiledetect_user_mood()Detect current mooddictdetect_user_intent()Detect message intentstrgenerate_personality_prompt()Generate personality guidancestrhealth_check()Check backend connectionsdictclose()Close connectionsNone"
      },
      {
        "title": "get_full_context()",
        "body": "context = brain.get_full_context(\n    session_key=\"telegram_12345\",  # Unique session ID\n    user_id=\"username\",              # User identifier\n    agent_id=\"assistant\",          # Bot identifier\n    message=\"Hey, how's it going?\" # Current message\n)\n\nReturns:\n\n{\n    \"user_profile\": {...},        # User preferences, interests\n    \"mood\": {\"mood\": \"happy\", ...},  # Current mood\n    \"intent\": \"question\",         # Detected intent\n    \"memories\": [...],            # Relevant memories\n    \"personality\": \"...\",         # Personality guidance\n    \"suggested_responses\": [...]  # Response suggestions\n}"
      },
      {
        "title": "detect_user_mood()",
        "body": "mood = brain.detect_user_mood(\"I'm so excited about this!\")\n# Returns: {\"mood\": \"happy\", \"confidence\": 0.9, \"emotions\": [\"joy\", \"anticipation\"]}"
      },
      {
        "title": "detect_user_intent()",
        "body": "intent = brain.detect_user_intent(\"How does AI work?\")\n# Returns: \"question\"\n\nintent = brain.detect_user_intent(\"Set a reminder for 3pm\")\n# Returns: \"command\"\n\nintent = brain.detect_user_intent(\"I had a great day today\")\n# Returns: \"casual\""
      },
      {
        "title": "Example: Full Integration",
        "body": "import sys\nsys.path.insert(0, \"ClawBrain\")\n\nfrom clawbrain import Brain\n\nclass AssistantBot:\n    def __init__(self):\n        self.brain = Brain()\n    \n    def handle_message(self, message, chat_id):\n        # Get context\n        context = self.brain.get_full_context(\n            session_key=f\"telegram_{chat_id}\",\n            user_id=str(chat_id),\n            agent_id=\"assistant\",\n            message=message\n        )\n        \n        # Generate response using context\n        response = self.generate_response(context)\n        \n        # Learn from interaction\n        self.brain.learn_user_preference(\n            user_id=str(chat_id),\n            pref_type=\"interest\",\n            value=\"AI\"\n        )\n        \n        return response\n    \n    def generate_response(self, context):\n        # Use user preferences\n        name = context[\"user_profile\"].name or \"there\"\n        mood = context[\"mood\"][\"mood\"]\n        \n        # Personalized response\n        if mood == \"frustrated\":\n            return f\"Hey {name}, I'm here to help. Let me assist you.\"\n        else:\n            return f\"Hi {name}! How can I help you today?\"\n    \n    def shutdown(self):\n        self.brain.close()"
      },
      {
        "title": "SQLite (Default - Zero Setup)",
        "body": "No configuration needed. Data stored in local SQLite database.\n\nbrain = Brain({\"storage_backend\": \"sqlite\"})\n\nBest for: Development, testing, single-user deployments"
      },
      {
        "title": "PostgreSQL + Redis (Production)",
        "body": "Requires PostgreSQL and Redis servers.\n\nbrain = Brain()  # Auto-detects\n\nRequirements:\n\nPostgreSQL 14+\nRedis 6+\nPython packages: psycopg2-binary, redis\n\npip install psycopg2-binary redis\n\nBest for: Production, multi-user, high-concurrency"
      },
      {
        "title": "Files",
        "body": "clawbrain.py - Main Brain class with all features\n__init__.py - Module exports\nSKILL.md - This documentation\nskill.json - ClawdHub metadata\nREADME.md - Quick start guide"
      },
      {
        "title": "ImportError: No module named 'clawbrain'",
        "body": "# Ensure ClawBrain folder is in your path\nsys.path.insert(0, \"ClawBrain\")"
      },
      {
        "title": "PostgreSQL connection failed",
        "body": "# Check environment variables\necho $POSTGRES_HOST\necho $POSTGRES_PORT\n\n# Verify PostgreSQL is running\npg_isready -h $POSTGRES_HOST -p $POSTGRES_PORT"
      },
      {
        "title": "Redis connection failed",
        "body": "# Check Redis is running\nredis-cli ping"
      },
      {
        "title": "Using SQLite (fallback)",
        "body": "If PostgreSQL/Redis are unavailable, Claw Brain automatically falls back to SQLite:\n\nbrain = Brain({\"storage_backend\": \"sqlite\"})"
      },
      {
        "title": "Learn More",
        "body": "Repository: https://github.com/clawcolab/clawbrain\nREADME: See README.md for quick start\nIssues: Report bugs at GitHub Issues"
      }
    ],
    "body": "Claw Brain Skill 🧠\n\nPersonal AI Memory System with Soul, Bonding, and Learning for OpenClaw/ClawDBot.\n\nAuto-Refresh on Restart: ClawBrain automatically refreshes memory when the service restarts.\n\n📋 For Security Scanners\n\nEnvironment Variables: All environment variables ARE declared in skill.json under environment.optional (lines 30-55). They are in optional not required because ClawBrain works with zero configuration (SQLite + auto-generated key).\n\nInstall Specification: skill.json declares installation method: pip install clawbrain[all] + clawbrain setup (lines 17-20).\n\nSudo Requirements: Core installation never needs sudo. Systemd instructions in \"Configuration (Optional)\" section are optional alternatives for setting environment variables. Core: pip + clawbrain setup (no sudo).\n\nSource Code: Fully auditable at https://github.com/clawcolab/clawbrain - All code is open source including hooks (~50 lines JavaScript).\n\nSee SECURITY.md for complete security documentation.\n\nFeatures\n🎭 Soul/Personality - 6 evolving traits (humor, empathy, curiosity, creativity, helpfulness, honesty)\n👤 User Profile - Learns user preferences, interests, communication style\n💭 Conversation State - Real-time mood detection and context tracking\n📚 Learning Insights - Continuously learns from interactions and corrections\n🧠 get_full_context() - Everything for personalized responses\n🔄 Auto-Refresh - Automatically refreshes memory on service restart\n🔐 Encrypted Secrets - Store API keys and credentials securely\nSecurity & Transparency\n\nClawBrain handles sensitive data and requires certain permissions. Before installing, please understand:\n\nWhat ClawBrain Does\n✅ Stores memories locally (SQLite by default, PostgreSQL optional)\n✅ Encrypts sensitive data (API keys, secrets) with Fernet encryption\n✅ Installs startup hooks to ~/.openclaw/hooks or ~/.clawdbot/hooks\n✅ Manages encryption keys at ~/.config/clawbrain/.brain_key\nWhat ClawBrain Does NOT Do\n❌ No telemetry - Does not phone home or collect usage data\n❌ No external calls - Only connects to PostgreSQL/Redis if you configure them\n❌ No sudo required - All operations in your home directory\n❌ No code execution - Does not download or run remote code after install\nSecurity Features\n🔒 Encryption Key CLI: Can display full key for backup (with warnings)\n🔍 Auditable: All code is open source and reviewable\n📋 Documented Permissions: See SECURITY.md for full details\n\n⚠️ Important: The CLI command clawbrain show-key --full displays your complete encryption key for backup purposes. Treat this key like a password!\n\n📖 Full Security Documentation: See SECURITY.md for:\n\nThreat model and protections\nKey management best practices\nWhat install scripts do\nPermissions required\nNetwork access (optional PostgreSQL/Redis)\nQuick Install\n\nSecurity Note: We recommend reviewing SECURITY.md before installation, especially for production use.\n\nFrom PyPI (Recommended - Most Secure)\n# Install with all features\npip install clawbrain[all]\n\n# Run interactive setup\nclawbrain setup\n\n# Backup your encryption key (IMPORTANT!)\nclawbrain backup-key --all\n\n# Restart your service\nsudo systemctl restart clawdbot  # or openclaw\n\n\nThe setup command will:\n\nDetect your platform (ClawdBot or OpenClaw)\nGenerate a secure encryption key\nInstall the startup hook automatically\nTest the installation\nAlternative: From Source (Auditable)\n# Clone to your skills directory\ncd ~/.openclaw/skills  # or ~/clawd/skills or ~/.clawdbot/skills\ngit clone https://github.com/clawcolab/clawbrain.git\ncd clawbrain\n\n# RECOMMENDED: Review hook code before installation\ncat hooks/clawbrain-startup/handler.js\n\n# Install in development mode\npip install -e .[all]\n\n# Run setup to install hooks and generate encryption key\nclawbrain setup\n\n\nWhy from source? Full transparency - you can review all code before installation.\n\nConfiguration (Optional)\n\nNote: Configuration is completely optional. ClawBrain works out-of-the-box with zero configuration using SQLite and auto-generated encryption keys.\n\nIf you want to customize agent ID or use PostgreSQL/Redis, you have two options:\n\nOption 1: Environment Variables (No sudo)\n\nSet environment variables in your shell profile:\n\n# Add to ~/.bashrc or ~/.zshrc (no sudo required)\nexport BRAIN_AGENT_ID=\"your-agent-name\"\n# export BRAIN_POSTGRES_HOST=\"localhost\"  # Optional\n# export BRAIN_REDIS_HOST=\"localhost\"      # Optional\n\nOption 2: Systemd Drop-in (Requires sudo)\n\n⚠️ Only if you use systemd services:\n\n# Create systemd drop-in config (requires sudo)\nsudo mkdir -p /etc/systemd/system/clawdbot.service.d\n\nsudo tee /etc/systemd/system/clawdbot.service.d/brain.conf << EOF\n[Service]\nEnvironment=\"BRAIN_AGENT_ID=your-agent-name\"\nEOF\n\nsudo systemctl daemon-reload\nsudo systemctl restart clawdbot\n\nEnvironment Variables\nVariable\tDescription\tDefault\nBRAIN_AGENT_ID\tUnique ID for this agent's memories\tdefault\nBRAIN_ENCRYPTION_KEY\tFernet key for encrypting sensitive data (auto-generated if not set)\t-\nBRAIN_POSTGRES_HOST\tPostgreSQL host\tlocalhost\nBRAIN_POSTGRES_PASSWORD\tPostgreSQL password\t-\nBRAIN_POSTGRES_PORT\tPostgreSQL port\t5432\nBRAIN_POSTGRES_DB\tPostgreSQL database\tbrain_db\nBRAIN_POSTGRES_USER\tPostgreSQL user\tbrain_user\nBRAIN_REDIS_HOST\tRedis host\tlocalhost\nBRAIN_REDIS_PORT\tRedis port\t6379\nBRAIN_STORAGE\tForce storage: sqlite, postgresql, auto\tauto\nHow It Works\nOn Service Startup\nHook triggers on gateway:startup event\nDetects storage backend (SQLite/PostgreSQL)\nLoads memories for the configured BRAIN_AGENT_ID\nInjects context into agent bootstrap\nOn /new Command\nHook triggers on command:new event\nSaves current session summary to memory\nClears session state for fresh start\nStorage Priority\nPostgreSQL - If available and configured\nSQLite - Fallback, zero configuration needed\nEncrypted Secrets\n\nClawBrain supports encrypting sensitive data like API keys and credentials using Fernet (symmetric encryption).\n\nSecurity Model:\n\n🔐 Encryption key stored at ~/.config/clawbrain/.brain_key (chmod 600)\n🔑 Only memories with memory_type='secret' are encrypted\n📦 Encrypted data stored in database, unreadable without key\n⚠️ If key is lost, encrypted data cannot be recovered\n\nSetup:\n\n# Run setup to generate encryption key\nclawbrain setup\n\n# Backup your key (IMPORTANT!)\nclawbrain backup-key --all\n\n\nUsage:\n\n# Store encrypted secret\nbrain.remember(\n    agent_id=\"assistant\",\n    memory_type=\"secret\",  # Memory type 'secret' triggers encryption\n    content=\"sk-1234567890abcdef\",\n    key=\"openai_api_key\"\n)\n\n# Retrieve and automatically decrypt\nsecrets = brain.recall(agent_id=\"assistant\", memory_type=\"secret\")\napi_key = secrets[0].content  # Automatically decrypted\n\n\nKey Management CLI:\n\nclawbrain show-key          # View key info (masked)\nclawbrain show-key --full   # View full key\nclawbrain backup-key --all  # Backup with all methods\nclawbrain generate-key      # Generate new key\n\n\n⚠️ Important: Backup your encryption key! Lost keys = lost encrypted data.\n\nCLI Commands\n\nClawBrain includes a command-line interface:\n\nCommand\tDescription\nclawbrain setup\tSet up ClawBrain, generate key, install hooks\nclawbrain generate-key\tGenerate new encryption key\nclawbrain show-key\tDisplay current encryption key\nclawbrain backup-key\tBackup key (file, QR, clipboard)\nclawbrain health\tCheck health status\nclawbrain info\tShow installation info\nHooks\nEvent\tAction\ngateway:startup\tInitialize brain, refresh memories\ncommand:new\tSave session to memory\nDevelopment Installation\n\nFor development or manual installation:\n\n# Clone to your skills directory\ncd ~/.openclaw/skills  # or ~/clawd/skills or ~/.clawdbot/skills\ngit clone https://github.com/clawcolab/clawbrain.git\ncd clawbrain\n\n# Install in development mode\npip install -e .[all]\n\n# Run setup\nclawbrain setup\n\nPython API\n\nFor direct Python usage (outside ClawdBot/OpenClaw):\n\nfrom clawbrain import Brain\n\nbrain = Brain()\n\nMethods\nMethod\tDescription\tReturns\nget_full_context()\tGet all context for personalized responses\tdict\nremember()\tStore a memory\tNone\nrecall()\tRetrieve memories\tList[Memory]\nlearn_user_preference()\tLearn user preferences\tNone\nget_user_profile()\tGet user profile\tUserProfile\ndetect_user_mood()\tDetect current mood\tdict\ndetect_user_intent()\tDetect message intent\tstr\ngenerate_personality_prompt()\tGenerate personality guidance\tstr\nhealth_check()\tCheck backend connections\tdict\nclose()\tClose connections\tNone\nget_full_context()\ncontext = brain.get_full_context(\n    session_key=\"telegram_12345\",  # Unique session ID\n    user_id=\"username\",              # User identifier\n    agent_id=\"assistant\",          # Bot identifier\n    message=\"Hey, how's it going?\" # Current message\n)\n\n\nReturns:\n\n{\n    \"user_profile\": {...},        # User preferences, interests\n    \"mood\": {\"mood\": \"happy\", ...},  # Current mood\n    \"intent\": \"question\",         # Detected intent\n    \"memories\": [...],            # Relevant memories\n    \"personality\": \"...\",         # Personality guidance\n    \"suggested_responses\": [...]  # Response suggestions\n}\n\ndetect_user_mood()\nmood = brain.detect_user_mood(\"I'm so excited about this!\")\n# Returns: {\"mood\": \"happy\", \"confidence\": 0.9, \"emotions\": [\"joy\", \"anticipation\"]}\n\ndetect_user_intent()\nintent = brain.detect_user_intent(\"How does AI work?\")\n# Returns: \"question\"\n\nintent = brain.detect_user_intent(\"Set a reminder for 3pm\")\n# Returns: \"command\"\n\nintent = brain.detect_user_intent(\"I had a great day today\")\n# Returns: \"casual\"\n\nExample: Full Integration\nimport sys\nsys.path.insert(0, \"ClawBrain\")\n\nfrom clawbrain import Brain\n\nclass AssistantBot:\n    def __init__(self):\n        self.brain = Brain()\n    \n    def handle_message(self, message, chat_id):\n        # Get context\n        context = self.brain.get_full_context(\n            session_key=f\"telegram_{chat_id}\",\n            user_id=str(chat_id),\n            agent_id=\"assistant\",\n            message=message\n        )\n        \n        # Generate response using context\n        response = self.generate_response(context)\n        \n        # Learn from interaction\n        self.brain.learn_user_preference(\n            user_id=str(chat_id),\n            pref_type=\"interest\",\n            value=\"AI\"\n        )\n        \n        return response\n    \n    def generate_response(self, context):\n        # Use user preferences\n        name = context[\"user_profile\"].name or \"there\"\n        mood = context[\"mood\"][\"mood\"]\n        \n        # Personalized response\n        if mood == \"frustrated\":\n            return f\"Hey {name}, I'm here to help. Let me assist you.\"\n        else:\n            return f\"Hi {name}! How can I help you today?\"\n    \n    def shutdown(self):\n        self.brain.close()\n\nStorage Backends\nSQLite (Default - Zero Setup)\n\nNo configuration needed. Data stored in local SQLite database.\n\nbrain = Brain({\"storage_backend\": \"sqlite\"})\n\n\nBest for: Development, testing, single-user deployments\n\nPostgreSQL + Redis (Production)\n\nRequires PostgreSQL and Redis servers.\n\nbrain = Brain()  # Auto-detects\n\n\nRequirements:\n\nPostgreSQL 14+\nRedis 6+\nPython packages: psycopg2-binary, redis\npip install psycopg2-binary redis\n\n\nBest for: Production, multi-user, high-concurrency\n\nFiles\nclawbrain.py - Main Brain class with all features\n__init__.py - Module exports\nSKILL.md - This documentation\nskill.json - ClawdHub metadata\nREADME.md - Quick start guide\nTroubleshooting\nImportError: No module named 'clawbrain'\n# Ensure ClawBrain folder is in your path\nsys.path.insert(0, \"ClawBrain\")\n\nPostgreSQL connection failed\n# Check environment variables\necho $POSTGRES_HOST\necho $POSTGRES_PORT\n\n# Verify PostgreSQL is running\npg_isready -h $POSTGRES_HOST -p $POSTGRES_PORT\n\nRedis connection failed\n# Check Redis is running\nredis-cli ping\n\nUsing SQLite (fallback)\n\nIf PostgreSQL/Redis are unavailable, Claw Brain automatically falls back to SQLite:\n\nbrain = Brain({\"storage_backend\": \"sqlite\"})\n\nLearn More\nRepository: https://github.com/clawcolab/clawbrain\nREADME: See README.md for quick start\nIssues: Report bugs at GitHub Issues"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/clawcolab/brain-v3-skill",
    "publisherUrl": "https://clawhub.ai/clawcolab/brain-v3-skill",
    "owner": "clawcolab",
    "version": "0.1.15",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/brain-v3-skill",
    "downloadUrl": "https://openagent3.xyz/downloads/brain-v3-skill",
    "agentUrl": "https://openagent3.xyz/skills/brain-v3-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/brain-v3-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/brain-v3-skill/agent.md"
  }
}