当前位置: 首页 > Skill >

Obsidian Dual-Layer Knowledge Base

Obsidian Dual-Layer Knowledge Base

Obsidian Dual-Layer Knowledge Base

将Obsidian打造为双层知识库,实现每日增量摄入、结构化索引以及AI可访问的摘要,提供流畅的上下文支持。

0.2.0 2026.11.25 659
获取Skill文件查看使用说明
作 者:陈辰 许可证: 更新时间:2026.11.25
本文目录展开

SKILL.md — Obsidian Dual-Layer Knowledge Base System

Version: 0.2 | Updated: 2026-05-22 Skill Name: obsidian-knowledge-base Tags: knowledge-management, obsidian, rag, agent-memory, daily-pipeline Install: npx clawhub@latest install obsidian-knowledge-base

1. Skill Overview

Turn Obsidian into a Dual-Layer Knowledge Base for AI Agents, supporting the full pipeline: daily incremental writes → structured indexing → context injection.

  • INBOX Layer: Raw material entry (articles/conversations/logs), unstructured
  • WIKI Layer: Structured knowledge (concept cards + Q&A cards), directly callable by AI

Core Value: Solve the "knowledge base paralysis" problem — knowledge gets written in, but the AI starts from scratch every time because it doesn't know what's in the base.

2. Directory Structure

Obsidian Vault/
├── INBOX/                          # Input layer (raw materials)
│   ├── articles/                   # Articles (daily scheduled writes)
│   ├── conversations/            # Conversation records
│   └── 日志/                    # Work logs (date-indexed)
└── wiki/
    ├── qa/                        # Q&A knowledge cards
    │   ├── index.md              # Q&A index (by category)
    │   └── Q-分类-摘要.md
    └── concepts/                  # Concept cards (deep structure)
        ├── index.md              # Concept card index
        ├── 概念-主题名.md
        └── ...

3. Knowledge Base Scale & Context Strategy

Layer File Count Raw Size How It Enters Context
INBOX/articles Daily incremental Raw material Not injected; searched on demand
wiki/qa ~200-500 cards ~500KB-1MB Daily 6KB summary injected
wiki/concepts ~20-100 cards ~50-100KB Searched on demand

Context Strategy (Progressive Disclosure):

  • At startup: Run wiki_daily_brief.py → generate 6KB category summary → inject into context
  • During tasks: Specific question → tdai_memory_search / wiki_search → read raw snippet (~700 chars)
  • Forbidden: Do not pour full wiki content into context (session limit: 200KB)

4. Naming Conventions

4.1 INBOX/articles/

【Category】YYYY-MM-DD-Title.md
Example: 【Industry Research】2026-05-22-Some Industry Deep Dive Summary.md

Category Tags: 城市更新 / 物业管理 / 土地市场 / 楼市分析 / 城投转型 / 政策速递 / 行业研究 / 他山之石

4.2 wiki/qa/

Q-Category-ContentSummary.md
Example: Q-IndustryResearch-WhatAreKeyPointsOfCommercialPropertyLeaseManagement.md

4.3 wiki/concepts/

Concept-TopicName.md
Example: Concept-CityRenewal.md

5. Card Templates

5.1 Q&A Card Template (frontmatter)

---
type: qa
date: 2026-05-22
title: Q-Category-ContentSummary
tags: [Category]
scenarios: [Report Writing/Article Writing/Policy Research]
keywords: [keyword1, keyword2]
operation: knowledge-query
---

## Question
(Specific question)

## Answer
(Complete answer, cite the source text, do not generalize)

5.2 Concept Card Template (frontmatter)

---
type: concept
date: 2026-05-22
title: Topic Name
tags: [Category, Subcategory]
source: Source
summary: One-sentence core conclusion
---

# Concept: Topic Name

## When to Use
When encountering the following keywords/scenarios, prioritize this card:
- Keyword 1
- Keyword 2

## Core Conclusion (One Sentence)

## Detailed Content

## Source/Evidence

6. Filter Rules (Mandatory)

Content PROHIBITED from writing to wiki/qa/ and wiki/concepts/:

Category Examples Correct Destination
Work logs / daily matters "Today's completed work", "Core completion items" INBOX/日志/
OpenClaw operations config "How to batch process documents", "cron config" skills/SKILL.md
Memory/session mechanisms "OpenClaw memory scheme", "session structure" memory/ (non-wiki)
Scheduled tasks/Cron "How to write cron tasks" skills/SKILL.md
Technical troubleshooting "API Key invalid troubleshooting" skills/SKILL.md

Content ALLOWED in wiki:

Any structured knowledge refined through analysis and processing, including but not limited to:

  • Industry/domain knowledge (concepts, models, cases, data)
  • Policy interpretation and applicable scenarios
  • Core conclusions and methods from research reports
  • Standards and operational guidelines
  • Cross-domain comparative analysis

Rule of Thumb: If a user can directly use it to write a report or make a decision, it's knowledge.

7. Daily Pipeline

05:00 ── INPUT END ──────────────────────────────
│
│  cron: Daily news scraping
│  → Scrape news → write to INBOX/articles/
│  → Push Word summary to relevant people
│
│  Note: Do NOT write to wiki/ directly; 8:30 handles it
│
08:30 ── OUTPUT END (Knowledge Base Injection) ──
│
│  cron: Daily knowledge base injection
│  → Scan INBOX/articles/ for today's new files
│  → Write to wiki/qa/ (extract Q&A pairs)
│  → Write to wiki/concepts/ (extract concept cards)
│  → Filter out operational content (see Section 6)
│  → Run wiki_daily_brief.py to update daily summary
│  → Push summary to owner (X new cards today, Z total in base)
│
│  At Session Startup (automatic):
│  → Run wiki_daily_brief.py
│  → Inject 6KB category summary into context
│  → AI knows what's available in the knowledge base today

8. Retrieval Flow (Per Task)

Receiving an analysis/writing task
  → wiki_daily_brief already injected at startup (6KB summary)
  → wiki_search(topic keywords) → match Q&A cards
  → High match → use the answer directly
  → Low match → wiki_search(subtopic) → read concept card
  → Still insufficient → search INBOX/articles/ raw materials
  → Last resort → web_search

9. wiki_daily_brief.py Script

#!/usr/bin/env python3
"""
wiki_daily_brief.py
Run at first session startup each day. Generates a wiki knowledge base
daily summary so the model knows what's available in the knowledge base.

Output: ~/.openclaw/workspace/memory/wiki_daily_brief.md
"""
WIKI_QA_DIR = "/path/to/Obsidian/wiki/qa"
OUT = "~/.openclaw/workspace/memory/wiki_daily_brief.md"

# Script logic:
# 1. Scan all .md files in wiki/qa/ (excluding index.md)
# 2. Extract frontmatter tags, count by category
# 3. Take top 3 per category as examples, generate ~6KB summary
# 4. Write to OUT, ready for session startup injection

10. Daily Summary Format

# Wiki Knowledge Base Daily Summary
> Generated: 2026-05-22 | Total: 230 Q&A Cards

---

## Available Knowledge Cards (By Category)

### Industry Research (83 cards)
- **What is the core content of「Some Report」?** (Source: `Q-IndustryResearch-SomeReport.md`)
- ...
  - ...and 80 more

### City Renewal (66 cards)
- ...

## Usage Guide
To query specific card content, call `tdai_memory_search` or `wiki_search`.

11. Installation

# Method 1: ClawHub
npx clawhub@latest install obsidian-knowledge-base

# Method 2: Manual
cp -r obsidian-knowledge-base ~/.openclaw/skills/

12. Use Cases

  • Knowledge workers who need AI to write reports, analysis, or official documents
  • Teams that want AI to have "memory" instead of starting from scratch every time
  • Scenarios with daily incremental material inputs (news, reports, data)
  • Teams that want knowledge base and AI context to work together, not in silos

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,016
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,004
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,002
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,001
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,001
PHP集成RabbitMQ实现消息队列的完整步骤

使用 php-amqplib 库,通过建立连接、声明交换机与队列并绑定,即可在 PHP 中实现消息的发送与消费。

2026.05.24 1,001
Skill 文件
  • SKILL.md
    • SKILL.md — Obsidian Dual-Layer Knowledge Base System
    • 1. Skill Overview
    • 2. Directory Structure
    • 3. Knowledge Base Scale & Context Strategy
    • 4. Naming Conventions
      • 4.1 INBOX/articles/
      • 4.2 wiki/qa/
      • 4.3 wiki/concepts/
    • 5. Card Templates
      • 5.1 Q&A Card Template (frontmatter)
      • 5.2 Concept Card Template (frontmatter)
    • 6. Filter Rules (Mandatory)
    • 7. Daily Pipeline
    • 8. Retrieval Flow (Per Task)
    • 9. wiki_daily_brief.py Script
    • 10. Daily Summary Format
    • 11. Installation
    • 12. Use Cases
  • 项目或源文件

相关 Skill

更多
Obsidian Search Obsidian Search 使用 AI 向量嵌入在 Obsidian 笔记中进行语义搜索,按含义查找笔记、发现关联、按标签/日期/文件夹筛选,并获取完整内容
Article Fetcher(文章抓取+Notion/Obsidian知识库存档) Article Fetcher(文章抓取+Notion/Obsidian知识库存档) 抓取微信公众号、小红书、豆瓣、知乎文章,自动上传OSS图片,LLM智能提取关键词,一键存档至Obsidian本地库(可选Notion)
Obsidian Bases Obsidian Bases 创建和编辑 Obsidian Bases(.base 文件),包含视图、过滤器、公式和摘要。用于处理 .base 文件并创建类似数据库的视图。
Obsidian工具箱(专业版) Obsidian工具箱(专业版) AI Agent的企业级Obsidian综合管理工具箱。批量操作、高级模板、插件深度集成、Canvas管理,复杂知识库一网打尽。
Obsidian Folder Sync Obsidian Folder Sync 将任意文件夹(支持任何 AI agent workspace)同步到 Obsidian Vault。 **触发场景**: - 用户说「同步到Obsidian」「备份到Obsidian」「Obsidian同步」「folder sync」 - 需要将任意文件夹(skills、memory、项目文档等)备份到 Obsi...