← 返回 Skills 市场
seairteng

Mac Mini Knowledge Base + RAG Setup

作者 seairteng · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
35
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install macmini-knowledge-base
功能描述
在 Mac Mini (M4) 上快速搭建本地知识库 + RAG 自然语言搜索系统。 适用场景: - 新 Mac 配置知识库:从零开始安装配置 Ollama、embedding模型、定时任务、OCR文档分析 - 遇到 PDF 提取乱码、定时任务超时、skill 加载失败等问题 - 想要建立每日自动分析文档 + 0...
使用说明 (SKILL.md)

Knowledge Base Setup

在 Mac Mini 上快速搭建本地知识库 + RAG 搜索系统。

快速开始

方法一:一键安装(推荐)

cd ~/.openclaw/workspace/skills/knowledge-base-setup/scripts
bash setup.sh \x3C飞书用户ID>

setup.sh 会自动完成:

  1. 创建目录结构
  2. 安装 tesseract + Python 依赖
  3. 下载 nomic-embed-text 模型
  4. 部署分析脚本到 knowledge/.analysis/
  5. 更新 OpenClaw 配置(ollama provider + memorySearch)
  6. 重启网关

安装完成后手动注册定时任务(setup.sh 会打印具体命令)。

方法二:手动分步安装

按顺序执行以下步骤:

Step 1: 环境准备

brew install tesseract
pip3 install pytesseract pymupdf pdfplumber
# 安装 Ollama: https://ollama.com/download

Step 2: 下载 embedding 模型

ollama pull nomic-embed-text

Step 3: 创建目录结构

mkdir -p ~/.openclaw/workspace/knowledge/.analysis/summaries/archives
mkdir -p ~/.openclaw/workspace/knowledge/temp_docs
mkdir -p ~/.openclaw/workspace/knowledge/"Macro Financials"
touch ~/.openclaw/workspace/knowledge/文章目录.md

Step 4: 部署脚本(从 skill 目录复制)

cp ~/.openclaw/workspace/skills/knowledge-base-setup/scripts/run_analysis.py \
   ~/.openclaw/workspace/knowledge/.analysis/
cp ~/.openclaw/workspace/skills/knowledge-base-setup/scripts/generate_catalog.js \
   ~/.openclaw/workspace/knowledge/.analysis/
chmod +x ~/.openclaw/workspace/knowledge/.analysis/*.py
chmod +x ~/.openclaw/workspace/knowledge/.analysis/*.js

Step 5: 配置 OpenClaw

编辑 ~/.openclaw/openclaw.json,加入:

{
  "models": {
    "providers": {
      "ollama": {
        "baseUrl": "http://127.0.0.1:11434",
        "api": "ollama",
        "models": [
          {"id": "nomic-embed-text", "name": "Nomic Embed Text"}
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "memorySearch": {
        "provider": "ollama",
        "model": "nomic-embed-text"
      }
    }
  }
}

确保 tools 区块有:

"tools": {
    "alsoAllow": ["exec", "process"]
}

然后重启:openclaw gateway restart

Step 6: 注册定时任务

# 22:00 分析任务
openclaw cron add \
  --name "22:00分析新文档" \
  --cron "0 22 * * *" \
  --tz "Asia/Shanghai" \
  --session isolated \
  --timeout-seconds 300 \
  --message "运行 run_analysis.py 和 generate_catalog.js" \
  --announce --channel feishu --to "user:\x3C飞书用户ID>"

# 08:00 发送任务
openclaw cron add \
  --name "08:00发送文档摘要" \
  --cron "0 8 * * *" \
  --tz "Asia/Shanghai" \
  --session isolated \
  --timeout-seconds 120 \
  --message "读取 summaries/ 目录发送摘要到飞书,完成后移动到 archives/" \
  --announce --channel feishu --to "user:\x3C飞书用户ID>"

迁移到新电脑

  1. 复制整个目录:
    scp -r ~/.openclaw/workspace/knowledge user@new-mac:~/.openclaw/workspace/
    
  2. 在新电脑运行 setup.sh 或手动分步安装
  3. 重新注册定时任务(Job ID会变)

避坑指南

问题 原因 解决
PDF提取乱码 自定义字体无ToUnicode pymupdf+tesseract OCR
定时任务超时 默认120秒太短 --timeout-seconds 300
飞书无exec工具 tools策略限制 添加 alsoAllow: [exec, process]
skill加载失败 导出名称错误 CodeChunkerFileChunker
BGE-M3卡顿 16GB内存不足 继续用 nomic-embed-text
brew install ollama慢 网络问题 直接下载 dmg 安装

关键路径

  • Skill目录:~/.openclaw/workspace/skills/knowledge-base-setup/
  • 知识库:~/.openclaw/workspace/knowledge/
  • 分析脚本:~/.openclaw/workspace/knowledge/.analysis/
  • 摘要输出:~/.openclaw/workspace/knowledge/.analysis/summaries/
安全使用建议
Install only if you are comfortable with OpenClaw agents having broad local command/process capability and with recurring jobs reading your knowledge documents. Before use, scope or avoid global `exec`/`process`, replace the hardcoded cross-skill `pdf-parse` dependency with a pinned local dependency, review the cron commands and Feishu recipient, and keep sensitive documents out of the knowledge folder unless you intend them to be summarized.
功能分析
Type: OpenClaw Skill Name: macmini-knowledge-base Version: 1.0.0 The skill bundle automates a local RAG system setup but performs high-risk configuration changes that weaken the agent's security sandbox. Specifically, the `setup.sh` script modifies the global `openclaw.json` configuration to enable `exec` and `process` tools, which allows for arbitrary command execution. Additionally, `generate_catalog.js` contains hardcoded absolute paths (`/Users/home/`) that may cause failures on other systems. While these actions are documented as necessary for the skill's functionality, they significantly increase the attack surface of the OpenClaw environment.
能力评估
Purpose & Capability
The stated purpose is coherent with OCR, local document analysis, catalog generation, Ollama embeddings, and Feishu summary notifications, but those capabilities inherently read and persist content from documents placed in the knowledge directory.
Instruction Scope
The instructions add broad OpenClaw `exec` and `process` tool access rather than a narrowly scoped command for the included analysis scripts, increasing the impact of future agent or cron actions.
Install Mechanism
The setup path uses package managers and local scripts, which is expected for this purpose, but one included script imports a hardcoded dependency from another skill's node_modules directory that is not part of this artifact set or install contract.
Credentials
The behavior is Mac/OpenClaw/Ollama-specific, but metadata declares no OS restriction, binaries, environment requirements, or capability tags; the document scan itself is bounded to `~/.openclaw/workspace/knowledge`.
Persistence & Privilege
The documented cron jobs create recurring autonomous analysis and Feishu notification workflows; this is disclosed, but combined with global `exec`/`process` access it grants persistent high-impact authority.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install macmini-knowledge-base
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /macmini-knowledge-base 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release for setting up a local knowledge base and RAG search system on Mac Mini (M4). - Includes both one-click and step-by-step installation guides for environment setup, dependencies, embedding model, and script deployment. - Provides detailed instructions for OpenClaw configuration and scheduled task registration, including integration with Feishu. - Features troubleshooting tips for common issues such as PDF extraction errors, task timeouts, and tool permissions. - Supports easy migration to a new machine by copying the knowledge directory and re-running install steps.
元数据
Slug macmini-knowledge-base
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Mac Mini Knowledge Base + RAG Setup 是什么?

在 Mac Mini (M4) 上快速搭建本地知识库 + RAG 自然语言搜索系统。 适用场景: - 新 Mac 配置知识库:从零开始安装配置 Ollama、embedding模型、定时任务、OCR文档分析 - 遇到 PDF 提取乱码、定时任务超时、skill 加载失败等问题 - 想要建立每日自动分析文档 + 0... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 35 次。

如何安装 Mac Mini Knowledge Base + RAG Setup?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install macmini-knowledge-base」即可一键安装,无需额外配置。

Mac Mini Knowledge Base + RAG Setup 是免费的吗?

是的,Mac Mini Knowledge Base + RAG Setup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Mac Mini Knowledge Base + RAG Setup 支持哪些平台?

Mac Mini Knowledge Base + RAG Setup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Mac Mini Knowledge Base + RAG Setup?

由 seairteng(@seairteng)开发并维护,当前版本 v1.0.0。

💬 留言讨论