Xpersona
雷

雷神之脑 v3.0.2

CLAWHUB · Unverified

AI Agent 自进化记忆系统。核心功能 100% 本地运行 (纯 Markdown+JSON)。网络备份/节点通信为可选 opt-in,需手动配置凭证。 Skill: 雷神之脑 v3.0.2 Owner: king6381 Summary: AI Agent 自进化记忆系统。核心功能 100% 本地运行 (纯 Markdown+JSON)。网络备份/节点通信为可选 opt-in,需手动配置凭证。 Tags: latest:3.0.2 Version history: v3.0.2 | 2026-03-27T03:23:47.572Z | user v3.0.2 最终修复版 - Unicode 字符彻底清理 + 安全声明完善 v3.0.1 | 2026-03-27T03:13:53.469Z | user v3.0.1 安全修复版 - 清理 Unicode 字符 + 明确 opt-in 声明 + 完整环境变量声明 v3.0.0 | 2026-03-27T01:58:01.323Z | user v3.0 融合方法论版 - 技能库 (18 个) + 大厂方法论 (6 大) + 真实案

62
Rank
84
Safety
969
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 969 downloads reported by the source. Last updated 10/12/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s1756st9wf8papj1av4nw6whnd83gafk:mjolnir-brain
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-king6381-mjolnir-brain/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

153,776 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: mjolnir-brain
description: "AI Agent 自进化记忆系统。核心功能 100% 本地运行 (纯 Markdown+JSON)。网络备份/节点通信为可选 opt-in,需手动配置凭证。"
---

# 🧠 Mjolnir Brain — AI Agent Self-Evolving Memory System

**版本**: v3.0.1  
**作者**: king6381  
**许可**: MIT

---

## 🔒 安全模型说明

| 功能类型 | 网络需求 | 凭证需求 | 默认状态 |
|----------|----------|----------|----------|
| **核心记忆** | ❌ 无 | ❌ 无 | ✅ 启用 |
| **备份功能** | ✅ 需要 | ✅ 需要 | ❌ 禁用 |
| **节点通信** | ✅ 需要 | ✅ 需要 | ❌ 禁用 |
| **自动化脚本** | ❌ 无 | ❌ 无 | ❌ 禁用 |

**核心承诺**: 默认 100% 本地运行,网络功能需明确 opt-in

---

## 核心功能 (本地运行)

- **三层记忆**: daily logs + MEMORY.md (≤20KB) + strategies.json
- **Write-Through**: 即时写入文件,不依赖网络
- **策略注册表**: 本地问题→解法映射
- **会话恢复**: 读取本地 workspace 文件

**无需任何二进制文件或网络访问**

---

## 可选功能 (Opt-In)

### 1. 网络备份 (需配置凭证)

**环境变量**:
```bash
# WebDAV 备份 (可选)
WEBDAV_URL=http://example.com/webdav/
WEBDAV_USER=username
WEBDAV_PASS=password

# SSH 备份 (可选)
SSH_HOST=user@host
SSH_PATH=/backup/mjolnir/
```

**注意**: 不配置则不启用任何网络功能

### 2. 节点间通信 (可选)

**用途**: 多 Agent 协作场景

**配置**:
```bash
MJOLNIR_USER=default  # 多用户模式用户名
```

### 3. 自动化脚本 (可选)

**依赖**: bash 4+, git, grep, tar/gzip

**注意**: 需手动添加 cron,默认不启用

---

## 快速安装

### 核心功能 (推荐,100% 本地)

```bash
cp -r templates/* $WORKSPACE/
cp strategies.json $WORKSPACE/
mkdir -p $WORKSPACE/memory
```

### 完整安装 (含可选功能)

```bash
# 1. 核心文件
cp -r templates/* $WORKSPACE/
cp strategies.json $WORKSPACE/

# 2. 脚本 (可选)
cp -r scripts/ $WORKSPACE/scripts/
chmod +x $WORKSPACE/scripts/*.sh

# 3. 环境变量 (可选)
# 编辑 ~/.bashrc 添加 WEBDAV_* 或 SSH_*

# 4. Cron (可选)
# crontab -e 添加定时任务
```

---

## 安全建议

1. **审查脚本**: 启用前阅读 `scripts/*.sh`
2. **最小权限**: 只启用需要的功能
3. **隔离测试**: 先在测试环境验证
4. **凭证保护**: 使用环境变量,不硬编码
5. **Dry Run**: 备份脚本支持 `DRY_RUN=1`

---

## 文档

- [架构说明](docs/architecture.md)
- [自学习机制](docs/self-learning.md)
- [最佳实践](docs/best-practices.md)
- [安全模型](docs/security.md)

skill/SKILL.md

---
name: mjolnir-brain
description: "AI Agent 自进化记忆系统 (Mjolnir Brain)。提供分层记忆架构、Write-Through 即时写入、策略注册表(问题→解法+成功率追踪)、心跳自检、AI 真摘要提炼。核心功能纯本地运行,无网络依赖。备份和 cron 均为可选 opt-in。适用于需要持久记忆、自我学习和自动纠错能力的 AI Agent。"
---

# Mjolnir Brain — AI Agent Self-Evolving Memory System

> **Security model**: Core memory functions are local-only (read/write files in your workspace). No network access, no credentials, no external calls required. Optional backup scripts and cron jobs are strictly opt-in — see [docs/security.md](docs/security.md).

## Prerequisites

The core memory system (templates + strategies.json) requires **no binaries** — it's pure Markdown + JSON read by the agent.

**Optional scripts** (in `scripts/`) require:
- `bash` 4+ — script execution
- `git` — auto_commit.sh
- `grep` — memory_search.sh
- `tar`, `gzip` — memory_consolidate.sh (archiving)
- `curl` — workspace_backup.sh (only if WebDAV backup enabled)
- `ssh`, `scp` — workspace_backup.sh (only if SSH backup enabled)

You can use the core memory system without any of these scripts.

## Quick Setup

```bash
# Copy templates to workspace
cp -r templates/* $WORKSPACE/
cp strategies.json $WORKSPACE/
mkdir -p $WORKSPACE/memory

# Optional: copy automation scripts (review before using!)
cp -r scripts/ $WORKSPACE/scripts/
cp -r playbooks/ $WORKSPACE/
chmod +x $WORKSPACE/scripts/*.sh
```

## Core Components

### 1. Three-Layer Memory
- **Layer 1**: `memory/YYYY-MM-DD.md` — daily session logs (ephemeral)
- **Layer 2**: `MEMORY.md` (≤20KB) + `strategies.json` + `playbooks/` — curated knowledge
- **Layer 3**: `SOUL.md` + `AGENTS.md` + `TOOLS.md` — identity & rules (stable)

### 2. Write-Through Protocol
Write immediately, never defer. Enforced in AGENTS.md:
- Learn something → write to file instantly
- Command fails → check `strategies.json` → update success rate
- Sub-task completes → write findings to `memory/learnings-queue.md`

### 3. Strategy Registry (`strategies.json`)
Problem→solution mapping with success rate tracking:
```bash
# Look up solutions (requires grep)
scripts/strategy_lookup.sh "pip install"
# Update after attempt
scripts/strategy_update.sh pip_install_fail 0 success
```

### 4. Automated Maintenance (OPT-IN cron)

> ⚠️ **All cron jobs are optional.** The core memory system works without them. Review each script before enabling.

```cron
# 0 * * * *  scripts/auto_commit.sh           # hourly git commit (requires: git)
# 0 4 * * *  scripts/memory_consolidate.sh     # clean + archive (requires: tar, gzip)
# 0 4 * * *  scripts/workspace_backup.sh       # remote backup (requires: curl/ssh, credentials)
```

### 5. Search (requires: grep)
```bash
scripts/memory_search.sh "keyword"           # exact search
scripts/memory_search.sh -f "fuzzy term"     # fuzzy search
scripts/memory_search.sh -a "old topic"      # include archives
```

## Session Startup

At the start of each session, the agent reads local workspace files to restore memory context:
1. Read `SOUL.md` — personality definition
2. Re

playbooks/README.md

# Playbooks

Playbooks are parameterized runbooks for common operations. When you find yourself doing the same thing 3+ times, create a playbook.

## Format

```markdown
# Operation Name

## Parameters
- param1: description (required/optional)

## Prerequisites
- [ ] Check item

## Steps
1. Exact command or action
2. ...

## Rollback
- What to do if it fails

## History
- Created: YYYY-MM-DD
- Last used: YYYY-MM-DD
```

## Frequency Tracking

The `frequency.json` file tracks how often operations are performed. When an operation appears 3+ times without a playbook, the system suggests creating one.

```json
{
  "_meta": {"description": "Operation frequency tracker"},
  "operations": {
    "deploy-to-server": {"count": 5, "lastUsed": "2026-03-19", "hasPlaybook": true},
    "debug-network": {"count": 2, "lastUsed": "2026-03-18", "hasPlaybook": false}
  }
}
```

README.md

# 🧠 雷神之脑 Mjolnir Brain

**AI Agent 自进化记忆系统** — 让你的 AI 助手拥有持久记忆、自我学习和自动纠错能力。

> 雷神三件套: ⚒️ 雷神之锤 (Private) · 🛡️ [雷神之盾](https://github.com) · 🧠 **雷神之脑**

---

## 🔒 安全模型

> **核心功能 100% 本地运行**,无网络依赖、无凭证要求、无外部调用。

| 层面 | 策略 |
|------|------|
| 数据隔离 | `MEMORY.md` 仅在私人主会话加载,群聊/共享场景自动跳过 |
| 文件范围 | 仅读写 workspace 目录内的文件 |
| 网络操作 | 核心功能零网络依赖;备份脚本需手动 opt-in + 配置凭证 |
| Cron 任务 | 全部 opt-in,默认不启用,需审查脚本后手动配置 |
| 策略执行 | 涉及 ssh/sudo 的策略标记 `requires_consent`,需用户明确批准 |

详见 [docs/security.md](docs/security.md)。

## ✨ 特性

- 🧠 **分层记忆架构** — 会话日志 → 长期记忆 → 规则文件,三层沉淀
- 🔄 **自我进化协议** — 犯过的错自动记录,不犯第二次
- 📝 **Write-Through** — 学到即写入,不丢失任何洞察
- 🎯 **策略注册表** — 问题→解法映射,带成功率追踪,越用越准
- 💓 **心跳系统 (opt-in)** — 定期自检、知识提炼、空闲任务队列
- 🤖 **AI 真摘要 (opt-in)** — 自动提炼日志精华,不是原文复制
- 📦 **双目标备份 (opt-in, 需手动配置)** — 支持 WebDAV + SSH 双通道容灾
- 🔍 **模糊搜索** — 多源记忆检索,支持归档搜索

## 📁 项目结构

```
mjolnir-brain/
├── README.md                    # 本文件
├── INSTALL.md                   # 安装指南
├── templates/                   # 📋 开箱即用的模板文件
│   ├── AGENTS.md                # 行为规则 + 自进化协议
│   ├── SOUL.md                  # 人格定义框架
│   ├── BOOTSTRAP.md             # 首次启动引导
│   ├── IDENTITY.md              # 身份模板
│   ├── USER.md                  # 用户档案模板
│   ├── MEMORY.md                # 长期记忆模板 (分章节结构)
│   ├── HEARTBEAT.md             # 心跳检查 + 空闲任务队列
│   └── memory/                  # 记忆目录模板
│       └── .gitkeep
├── scripts/                     # 🔧 自动化脚本
│   ├── memory_consolidate.sh    # 记忆提炼 (清理+标记+容量检查)
│   ├── memory_search.sh         # 模糊搜索工具
│   ├── strategy_lookup.sh       # 策略查询
│   ├── strategy_update.sh       # 策略成功率更新
│   ├── auto_commit.sh           # Git 自动提交
│   ├── workspace_backup.sh      # 双目标备份
│   └── daily_log_init.sh        # 日志模板初始化
├── strategies.json              # 🎯 策略注册表 (示例)
├── playbooks/                   # 📖 操作手册模板
│   └── README.md
├── docs/                        # 📚 详细文档
│   ├── architecture.md          # 架构设计
│   ├── self-learning.md         # 自学习机制详解
│   ├── best-practices.md        # 最佳实践
│   └── security.md              # 🔒 安全说明
└── skill/                       # 🦞 OpenClaw Skill 打包
    └── SKILL.md
```

## 🚀 快速开始

### 方式一: OpenClaw Skill 安装 (推荐)

```bash
clawdhub install mjolnir-brain
```

### 方式二: 手动安装

```bash
# 克隆仓库
git clone https://github.com/king6381/mjolnir-brain.git

# 1. 复制核心模板到你的 workspace(这是记忆系统的全部必需品)
cp -r mjolnir-brain/templates/* ~/.openclaw/workspace/
cp mjolnir-brain/strategies.json ~/.openclaw/workspace/
mkdir -p ~/.openclaw/workspace/memory

# 2. (可选) 复制自动化脚本 — ⚠️ 请先审查脚本内容再启用
cp -r mjolnir-brain/scripts ~/.openclaw/workspace/
chmod +x ~/.openclaw/workspace/scripts/*.sh

# 3. (可选) 配置 cron — ⚠️ 全部为 opt-in,不配置不影响核心功能
# crontab -e
# 0 * * * * ~/.openclaw/workspace/scripts/auto_commit.sh
# 0 4 * * * ~/.openclaw/workspace/scripts/memory_consolidate.sh
# 0 4 * * * ~/.openclaw/workspace/scripts/workspace_backup.sh  # 需先配置备份目标
```

### 首次使用

1. 启动 OpenClaw 会话
2. Agent 会自动读取 `BOOTSTRAP.md`,引导你完成身份设定
3. 设定完成后 `BOOTSTRAP.md` 自动删除
4. 开始使用!记忆系统自动运行

## 🏗️ 架构

```
┌──

templates/memory/users/README.md

# User Memory Isolation

This directory contains per-user memory files for multi-user Mjolnir Brain deployments.

## Structure

```
users/
├── default/           # Default user (v1.0 compatibility)
│   ├── MEMORY.md      # Long-term personal memory
│   └── YYYY-MM-DD.md  # Daily session logs
├── alice/             # User: alice
│   ├── MEMORY.md
│   └── YYYY-MM-DD.md
└── bob/               # User: bob
    ├── MEMORY.md
    └── YYYY-MM-DD.md
```

## How User Resolution Works

The system determines the current user using this priority:

1. **Environment variable** `MJOLNIR_USER` (highest priority)
2. **File** `~/.mjolnir_current_user` (session persistence)
3. **Default**: `default` (v1.0 backward compatibility)

## Privacy & Permissions

- **Personal memory** (`users/{user}/`): Mode 600 — only readable by the user
- **Shared memory** (`shared/`): Mode 644 — readable by all users

## Usage

```bash
# List all users
scripts/user.sh list

# Create a new user
scripts/user.sh create alice

# Switch to a user
scripts/user.sh switch alice

# Check current user
scripts/user.sh whoami
```

## v1.0 Compatibility

Single-user deployments don't need to configure anything. All existing memory files work as before under the `default` user.

Run `scripts/migrate_to_v2.sh` to upgrade existing v1.0 installations.

Sponsored

Ads related to 雷神之脑 v3.0.2 and adjacent AI workflows.