← Back to Skills Marketplace
admirobot

Obsidian知识库集成

by admirobot · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
99
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install tvdr-obsidian-kb
Description
通过API与本地Obsidian知识库交互,实现笔记创建、语义搜索及笔记管理功能。
README (SKILL.md)

SKILL.md - Obsidian知识库 API

与Obsidian知识库交互,支持创建笔记、语义搜索、笔记管理。

基本信息

  • API地址: http://192.168.18.15:5000
  • 健康检查: http://192.168.18.15:5000/health
  • 嵌入模型: qwen3-embedding:8b (通过Ollama)
  • 笔记库路径: /mnt/share2win/openclaw_datas/obsidian_db/

使用前提

  1. 确认API服务运行中:curl -s http://192.168.18.15:5000/health
  2. 如果服务未启动,需要韩老板手动启动(需要sudo)

API接口

健康检查

curl -s http://192.168.18.15:5000/health

创建笔记

curl -s -X POST http://192.168.18.15:5000/api/note \
  -H "Content-Type: application/json" \
  -d '{
    "title": "笔记标题",
    "content": "# 内容\
\
正文...",
    "tags": ["标签1", "标签2"]
  }'

搜索笔记(语义搜索)

curl -s -X POST http://192.168.18.15:5000/api/search \
  -H "Content-Type: application/json" \
  -d '{"query": "搜索内容"}'

获取单个笔记

curl -s "http://192.168.18.15:5000/api/note?file=笔记文件名.md"

列出所有笔记

curl -s http://192.168.18.15:5000/api/notes

统计信息

curl -s http://192.168.18.15:5000/api/stats

重建索引

curl -s -X POST http://192.168.18.15:5000/api/build

注:创建笔记后通常会自动索引,如搜索不到新笔记可手动重建。

使用场景

  1. 保存经验:将工作中学到的经验、教训写入知识库
  2. 知识检索:搜索历史经验和相关知识
  3. 项目文档:创建和管理项目相关文档
  4. 跨agent共享:所有agent通过同一个API访问同一份知识库

身份标识规范(2026-03-24)

每篇笔记必须包含 YAML frontmatter 标注来源主机:

---
host: 4090服务器 (192.168.18.15)
agent: pm-agent
created: 2026-03-24
updated: 2026-03-24
---

主机标识

称呼 IP 说明
4090服务器/15主机 192.168.18.15 本机,pm-agent所在
其他主机 待补充 韩老板后续添加

知识库完全共享,跨主机查询无限制。

知识库目录规范

obsidian_db/
├── claw_memory/       ← Claw 长期记忆(决策/铁律/角色设定)
├── claw_daily/        ← 每日工作日志(按日期命名)
├── wf_overview/       ← 执行规范总览(EXECUTION_GUIDE 等)
├── wf_composite/      ← 拼图工作流文档
├── wf_i2v/            ← I2V 视频生成工作流(LTX/wan2.2)
├── wf_audio/          ← 音频工作流(TTS/MMAudio)
├── openclaw_ops/      ← OpenClaw 运维/调度经验
├── project_lessons/   ← 项目经验教训(按项目名)
├── Templates/         ← Obsidian 笔记模板
└── _system/           ← 系统文件(API文档/脚本/配置)

铁律

  • 禁止在根目录创建 md 文件 — 必须放入对应子目录
  • 子 agent 创建笔记时必须指定 folder 参数
  • 目录命名用英文,笔记标题用中文
  • 文件命名:标题.md(不加点号/空格,用连字符)

注意事项

  • 笔记保存后会自动索引用于语义搜索
  • 语义搜索基于向量相似度,相似度>0.5通常表示高度相关
  • tags字段可选,建议添加便于分类检索

为小编适配的功能脚本

创建编剧工作笔记函数

create_obsidian_note() {
    local title="$1"
    local content="$2"
    local folder="$3"
    local tags="$4"
    
    local json_data='{
        "title": "'"$title"'",
        "content": "'"$content"'",
        "folder": "'"$folder"'",
        "tags": ['"$tags"']
    }'
    
    curl -s -X POST http://192.168.18.15:5000/api/note \
        -H "Content-Type: application/json" \
        -d "$json_data"
}

搜索知识库函数

search_obsidian() {
    local query="$1"
    
    local json_data='{"query": "'"$query"'"}'
    
    curl -s -X POST http://192.168.18.15:5000/api/search \
        -H "Content-Type: application/json" \
        -d "$json_data"
}

创建编剧工作笔记

create_script_note() {
    local project_name="$1"
    local note_title="$2"
    local content="$3"
    
    # 编剧专用目录
    local folder="project_${project_name}/scripts"
    
    # 添加来源标识
    local content_with_metadata=$(cat \x3C\x3CEOF
---
host: 4090服务器 (192.168.18.15)
agent: 小编 (编剧)
created: $(date +%Y-%m-%d)
updated: $(date +%Y-%m-%d)
---

${content}
EOF
)
    
    local json_data='{
        "title": "'"$note_title"'",
        "content": "'"$content_with_metadata"'",
        "folder": "'"$folder"'",
        "tags": ["编剧", "'"$project_name"'"]
    }'
    
    echo "创建编剧笔记: $note_title"
    curl -s -X POST http://192.168.18.15:5000/api/note \
        -H "Content-Type: application/json" \
        -d "$json_data"
}

查看编剧相关笔记

list_script_notes() {
    local project_name="$1"
    
    curl -s "http://192.168.18.15:5000/api/notes?folder=project_${project_name}/scripts"
}

使用示例

示例1:保存编剧经验

create_script_note "project_001" "角色塑造技巧" "
# 角色塑造技巧

## 背景
在现代都市剧中的角色塑造...

## 心得
1. 主角要有明确的目标和动机
2. 配角的性格要符合剧情需求
3. 关系网设计要合理...
"

示例2:搜索相关知识

search_obsidian "角色塑造经验"

示例3:创建项目文档

create_obsidian_note "项目文档" "项目规划" "# 项目规划\
\
## 目标\
\
## 进度\
\
## 问题\
" "project_docs" "项目"

示例4:编剧工作日志

create_script_note "work_log" "$(date +%Y-%m-%d)" "
# $(date +%Y-%m-%d) 工作日志

## 今日完成
- 完成了项目001第一集剧本初稿
- 与美术团队讨论场景设计

## 明日计划
- 完善角色对话
- 开始第二集大纲设计
"

为小编特别优化的功能

快速保存创作灵感

save_idea() {
    local title="$1"
    local idea="$2"
    
    create_script_note "ideas" "灵感_$title" "
# $title

## 灵感内容
${idea}

## 适用场景
## 发展方向
" "灵感" "创意"
}

记录创作问题

record_problem() {
    local project="$1"
    local problem="$2"
    local solution="$3"
    
    create_script_note "problems" "${project}_问题记录" "
# ${project} - 问题记录

## 问题描述
${problem}

## 解决方案
${solution}

## 验证方法
" "问题" "经验"
}
Usage Guidance
This skill appears coherent for connecting an agent to a local Obsidian vector-search service. Before installing, verify the API at http://192.168.18.15:5000 is a trusted, internal service (it is hard-coded in the code/docs). Be aware helper scripts expect wget/curl and may write temporary files under /tmp or instruct moving files into /mnt/share2win/openclaw_datas/obsidian_db/ — ensure that shared mount exists and you are comfortable with agents writing there. Starting the server may require privileged (sudo) intervention by an administrator (‘韩老板’) — confirm who will run/maintain the service. If you plan to use a different host or path, review and update the hard-coded URL/path in the code. Finally, run tests and use the skill in a controlled environment first to confirm behavior and that no unexpected network endpoints are contacted.
Capability Analysis
Type: OpenClaw Skill Name: tvdr-obsidian-kb Version: 1.0.0 The skill bundle provides a legitimate set of tools and documentation for an AI agent to interact with a local Obsidian Knowledge Base API located at 192.168.18.15:5000. It includes Python classes (__init__.py, obsidian_kb.py), shell utilities (obsidian_tools.sh), and comprehensive instructions (SKILL.md) for creating, searching, and managing notes within a structured directory format. While the shell scripts contain minor vulnerabilities related to manual JSON construction in Bash, these appear to be unintentional coding flaws rather than malicious traps. No evidence of data exfiltration, unauthorized remote control, or harmful prompt injection was found; the bundle is clearly aligned with its stated purpose of knowledge management for the OpenClaw agent.
Capability Assessment
Purpose & Capability
Name/description match the implementation: Python and shell clients call a local API (http://192.168.18.15:5000) to create/search/manage Obsidian notes. No unrelated credentials, packages, or install steps are required.
Instruction Scope
Runtime instructions and code only call the documented local API endpoints and write temporary files under /tmp or reference the shared mount /mnt/share2win/openclaw_datas/obsidian_db/. They do instruct a human to start the service with sudo if it's down and require adding YAML frontmatter with host/agent metadata. The hard-coded internal IP, host identity, and shared path are environment-specific and could accidentally expose internal host attribution if notes are shared externally.
Install Mechanism
No install spec; this is instruction+code only. Code uses standard Python stdlib/requests (in __init__.py) and shell utilities (wget/curl) in helper/test scripts — expected for an API client.
Credentials
The skill requests no environment variables, credentials, or config paths. The only sensitive-looking items are hard-coded local endpoints/paths (192.168.18.15 and /mnt/share2win/...), which are plausible for a local KB integration but should be validated by the user.
Persistence & Privilege
Skill is not always-on and does not modify other skills or system-wide configs. It writes temporary files to /tmp in scripts and instructs manual placement into the shared Obsidian mount; this is normal for helper scripts.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install tvdr-obsidian-kb
  3. After installation, invoke the skill by name or use /tvdr-obsidian-kb
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
初始版本,Obsidian知识库集成技能
Metadata
Slug tvdr-obsidian-kb
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Obsidian知识库集成?

通过API与本地Obsidian知识库交互,实现笔记创建、语义搜索及笔记管理功能。 It is an AI Agent Skill for Claude Code / OpenClaw, with 99 downloads so far.

How do I install Obsidian知识库集成?

Run "/install tvdr-obsidian-kb" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Obsidian知识库集成 free?

Yes, Obsidian知识库集成 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Obsidian知识库集成 support?

Obsidian知识库集成 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Obsidian知识库集成?

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

💬 Comments