← Back to Skills Marketplace
seairteng

Mac Mini Knowledge Base + RAG Setup

by seairteng · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
35
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install macmini-knowledge-base
Description
在 Mac Mini (M4) 上快速搭建本地知识库 + RAG 自然语言搜索系统。 适用场景: - 新 Mac 配置知识库:从零开始安装配置 Ollama、embedding模型、定时任务、OCR文档分析 - 遇到 PDF 提取乱码、定时任务超时、skill 加载失败等问题 - 想要建立每日自动分析文档 + 0...
README (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/
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install macmini-knowledge-base
  3. After installation, invoke the skill by name or use /macmini-knowledge-base
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug macmini-knowledge-base
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Mac Mini Knowledge Base + RAG Setup?

在 Mac Mini (M4) 上快速搭建本地知识库 + RAG 自然语言搜索系统。 适用场景: - 新 Mac 配置知识库:从零开始安装配置 Ollama、embedding模型、定时任务、OCR文档分析 - 遇到 PDF 提取乱码、定时任务超时、skill 加载失败等问题 - 想要建立每日自动分析文档 + 0... It is an AI Agent Skill for Claude Code / OpenClaw, with 35 downloads so far.

How do I install Mac Mini Knowledge Base + RAG Setup?

Run "/install macmini-knowledge-base" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Mac Mini Knowledge Base + RAG Setup free?

Yes, Mac Mini Knowledge Base + RAG Setup is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Mac Mini Knowledge Base + RAG Setup support?

Mac Mini Knowledge Base + RAG Setup is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Mac Mini Knowledge Base + RAG Setup?

It is built and maintained by seairteng (@seairteng); the current version is v1.0.0.

💬 Comments