Obsidian 知识库技能:AI 驱动的库管理 - Openclaw Skills

作者:互联网

2026-04-17

AI教程

什么是 Obsidian 知识库?

Obsidian 知识库技能使 AI 智能体能够直接与基于 Markdown 的库进行交互。它提供了一套强大的工具,将本地文件文件夹视为结构化的知识库,支持语音搜索、Frontmatter 管理和维基链接分析等高级操作。通过 Openclaw Skills 集成此功能,用户可以自动化其个人或专业文档的生命周期。

该技能专为需要弥合静态笔记与动态 AI 工作流之间差距的开发人员和高级用户而设计。它利用 ripgrep 等高性能工具,确保即使是大型库也能以最小延迟进行查询和更新,使其成为任何本地智能设置的重要组成部分。

下载入口:https://github.com/openclaw/skills/tree/main/skills/ruslanlanket/obisdian-direct

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install obisdian-direct

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 obisdian-direct。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Obsidian 知识库 应用场景

  • 使用模糊和语音查询在广泛的个人知识库中进行搜索。
  • 根据内容分析自动将新笔记整理到正确的文件夹中。
  • 更新现有笔记的特定部分或通过 AI 提示追加研究数据。
  • 使用入站和出站维基链接跟踪映射文档之间的连接。
Obsidian 知识库 工作原理
  1. 该技能连接到由 OBSIDIAN_VAULT 环境变量定义的本地目录。
  2. 搜索查询使用 ripgrep 处理以提高速度,并结合标题和标签权重以确保相关性。
  3. 笔记创建包含一个可选的自动文件夹检测步骤,以维护库的组织结构。
  4. 文件修改通过特定的编辑模式处理,如追加、置顶或特定章节替换。
  5. 元数据通过 YAML frontmatter 同步,确保与原生 Obsidian 应用程序兼容。

Obsidian 知识库 配置指南

要在 Openclaw Skills 生态系统中使用此技能,请配置您的库路径并导航到脚本目录:

export OBSIDIAN_VAULT="/path/to/your/vault"
cd ~/.openclaw/workspace/skills/obsidian/scripts
# 通过列出文件夹测试安装
python3 obsidian_cli.py --json folders

Obsidian 知识库 数据架构与分类体系

该技能使用带有 YAML frontmatter 的标准 Markdown 文件管理数据。组织遵循以下结构:

属性 描述
created 笔记首次生成的 ISO 8601 时间戳
modified 最后一次编辑操作的 ISO 8601 时间戳
tags 用于分类和搜索过滤的字符串列表
aliases 用于解析维基链接的别名

内容以标准 Markdown 存储,支持行内标签 (#tag) 和维基链接语法 ([[Link]])。

name: obsidian
description: >
  Work with Obsidian vaults as a knowledge base. Features: fuzzy/phonetic search across all notes,
  auto-folder detection for new notes, create/read/edit notes with frontmatter, manage tags and wikilinks.
  Use when: querying knowledge base, saving notes/documents, editing existing notes by user instructions.

Obsidian Knowledge Base

Obsidian vault = folder with Markdown files + .obsidian/ config.

Configuration

  • Vault Path: /home/ruslan/webdav/data/ruslain
  • Env: OBSIDIAN_VAULT=/home/ruslan/webdav/data/ruslain

CLI Usage

Scripts location: /home/ruslan/.openclaw/workspace/skills/obsidian/scripts

Note: Global flags (--vault, --json) must come BEFORE the command.

export OBSIDIAN_VAULT=/home/ruslan/webdav/data/ruslain
cd /home/ruslan/.openclaw/workspace/skills/obsidian/scripts

# Search (fuzzy/phonetic) - uses ripgrep for speed
python3 obsidian_search.py "$OBSIDIAN_VAULT" "query" --limit 10 --json

# List notes
python3 obsidian_cli.py --json list                    # all notes
python3 obsidian_cli.py --json list "Projects"         # in folder

# List folders
python3 obsidian_cli.py --json folders

# Read note
python3 obsidian_cli.py --json read "Note Name"

# Create note
python3 obsidian_cli.py --json create "Title" -c "Content" -f "Folder" -t tag1 tag2
python3 obsidian_cli.py --json create "Title" -c "Content" --auto-folder  # auto-detect folder

# Edit note
python3 obsidian_cli.py --json edit "Note" append -c "Text to append"
python3 obsidian_cli.py --json edit "Note" prepend -c "Text at start"
python3 obsidian_cli.py --json edit "Note" replace -c "New full content"
python3 obsidian_cli.py --json edit "Note" replace-section -s "Summary" -c "New section text"

# Tags
python3 obsidian_cli.py --json tags

# Links (incoming/outgoing)
python3 obsidian_cli.py --json links "Note Name"

# Suggest folder for content
python3 obsidian_cli.py --json suggest-folder "content text" --title "Note Title"

Workflow: Query Knowledge Base

  1. Run obsidian_search.py with user query
  2. Read top results if needed for context
  3. Formulate answer based on found content
  4. Cite sources: [[Note Name]]

Workflow: Save Note

  1. If no folder specified → run suggest-folder or use --auto-folder
  2. Create note with create command
  3. Add appropriate tags based on content
  4. Report created path to user

Workflow: Edit Note by Prompt

User prompts like:

  • "Добавь резюме в конец заметки X" → edit X append -c "..."
  • "Перепиши заметку Y более кратко" → read note, rewrite, edit Y replace -c "..."
  • "Добавь секцию 'Выводы' в заметку Z" → edit Z replace-section -s "Выводы" -c "..."

Note Format

---
created: 2024-01-15T10:30:00
modified: 2024-01-15T12:00:00
tags:
  - project
  - work
---

# Title

Content with [[wikilinks]] and #inline-tags.
  • [[Note Name]] — link to note
  • [[Note Name|Display Text]] — link with alias
  • [[Note Name#Section]] — link to section

Frontmatter Fields

Standard fields:

  • created — creation timestamp
  • modified — last edit timestamp
  • tags — list of tags
  • aliases — alternative names for linking

Search Behavior

obsidian_search.py uses:

  • ripgrep for fast initial filtering
  • Title matching (highest weight)
  • Tag matching
  • Fuzzy content search with phonetic transliteration (RU?EN)
  • Returns: path, title, score, matched context

相关推荐