Administrator
发布于 2026-04-29 / 12 阅读
0
0

个人知识库搭建计划

個人知識庫搭建計劃 / Personal Knowledge Base Setup Plan

本文件提供兩種獨立方案,按需選擇,不必都做。
Two independent options below. Pick one or both — they don't depend on each other.

方案

用途

適合誰

A. 本地知識庫(Agent 軟體 + Obsidian + GitHub)

本地寫作、整理筆記、版本備份

想長期沉澱個人筆記的人

B. Dify 知識庫

文件上傳、AI 問答、檢索

想用 AI 快速查詢資料的人

這裡的「Agent 軟體」指 AI 編程助手,例如 Claude CodeTraeCursor。它可以幫你直接用一句話完成「同步到 GitHub」「整理資料夾」這些操作,不用學 Git 命令。
"Agent software" here means an AI coding assistant like Claude Code, Trae, or Cursor — you tell it in plain language ("sync to GitHub") and it handles the Git commands for you.


方案 A:本地知識庫搭建 / Local Knowledge Base

最終效果:在電腦上用 Obsidian 寫筆記,按 Ctrl+S 後自動同步到 GitHub 雲端備份。
End result: Write notes in Obsidian on your computer, auto-sync to GitHub cloud backup.

第 1 步:註冊 GitHub 賬號 / Register a GitHub account

  1. 打開 https://github.com ,點右上角 Sign up

  2. 填郵箱、密碼、用戶名(用戶名建議用英文,例如 jacky-chen,後面會用到)。

  3. 驗證郵箱即可。

第 2 步:在 GitHub 建一個倉庫(用來存筆記)/ Create a repo for your notes

  1. 登入後點左上角 +New repository

  2. Repository namePersonal-Knowledge-Base

  3. Private(私人,避免別人看到你的筆記)。

  4. 勾選 Add a README file

  5. Create repository

第 3 步:安裝 Agent 軟體(Claude Code / Trae / Cursor 任選一個)/ Install an AI Agent

Agent 軟體會替你做兩件事:① 幫你把 GitHub 倉庫拉到本地;② 之後用自然語言就能備份筆記,不用學 Git 命令。
The agent does two things: ① clones your GitHub repo locally; ② lets you back up notes by typing plain language — no Git commands needed.

選一個你喜歡的安裝即可:

安裝後通用步驟:

  1. 打開 Agent,登入賬號。

  2. 直接用一句話讓它幫你 Clone 倉庫,例如:

    幫我把 GitHub 上 你的用戶名/Personal-Knowledge-Base 這個倉庫 clone 到 D:\KnowledgeBase
    如何找到倉庫地址,在新建好倉庫以後


  3. Agent 會自動執行命令並完成。如果是第一次用,它會提示你登入 GitHub(按提示授權即可)。

完成後,你電腦上會出現 Personal-Knowledge-Base 資料夾,這就是你以後寫筆記的地方。

第 4 步:安裝 Obsidian / Install Obsidian

  1. 打開 https://obsidian.md ,下載並安裝。

  2. 打開 Obsidian,第一次會看到歡迎頁,點 Open folder as vault

  3. 選擇剛剛 Clone 下來的 Personal-Knowledge-Base 資料夾。

  4. 進入後就能直接寫筆記了。

  5. 你也可以讓agent軟件直接幫你寫筆記

關鍵點:Obsidian 的 Vault 直接用 GitHub Clone 下來的資料夾,不要另外新建。
Key: Use the cloned folder AS the Obsidian vault. Don't create a separate one.

第 5 步:建立資料夾結構 / Create folder structure

在 Obsidian 左側側邊欄右鍵 → New folder,依次建立:

Personal-Knowledge-Base/
  00-Inbox/        # 臨時收集,想到什麼先丟這裡
  01-Projects/     # 進行中的專案
  02-Areas/        # 長期主題(例如:健康、理財)
  03-Resources/    # 教程、參考資料
  04-Archive/      # 已完成的舊內容
  99-Assets/       # 圖片、附件

第 6 步:用 Agent 同步筆記到 GitHub / Sync via Agent

每次寫完筆記想備份時,打開 Agent,直接告訴它:

幫我把今天的筆記提交並推送到 GitHub,commit 訊息寫「新增讀書筆記」

Agent 會自動執行 git add / git commit / git push 三個動作。完成後刷新 GitHub 倉庫頁面就能看到。
The agent runs git add / git commit / git push automatically. Refresh your GitHub repo page to confirm.

常用指令範例:

  • 幫我把所有改動推送到 GitHub

  • 看一下我今天改了哪些筆記

  • 把 00-Inbox 裡的草稿整理到 01-Projects(Agent 也能幫你重組筆記)

進階:在 Obsidian 另外安裝 Obsidian Git 插件,可以設定每隔 X 分鐘自動 Push,連 Agent 都不用打開。
Advanced: Install the Obsidian Git plugin to auto-push every X minutes — no agent needed.

第 7 步:日常使用建議 / Daily usage tips

  • 筆記命名YYYY-MM-DD 主題,例如 2026-04-29 個人知識庫搭建.md

  • 首頁:在根目錄建一個 Home.md,放今日筆記、進行中專案、常用連結

  • 圖片:直接拖進 Obsidian,會自動存到 99-Assets(需在設定 → Files & Links 中指定)

  • 敏感資料(密碼、身份證等):不要寫進這個 Vault,避免推到 GitHub

筆記模板 / Note template

# 標題

## 背景 / Background

## 核心內容 / Main Content

## 結論 / Conclusion

## 後續行動 / Next Actions

方案 B:Dify 知識庫搭建 / Dify Knowledge Base

最終效果:把文件丟進 Dify,AI 就能根據這些文件回答你的問題。
End result: Upload files to Dify, then AI answers questions based on them.

第 1 步:拿到 Dify 賬號 / Get a Dify account

向 IT 部門申請一個 Dify 賬號(公司內部部署)。如果是用官方雲端,到 https://dify.ai 註冊。
Ask IT for a Dify account (internal deployment), or register at https://dify.ai for the cloud version.

第 2 步:登入並進入工作台 / Sign in and enter workspace

登入後會看到工作台主頁,左側選單找到 知識庫 / Knowledge

第 3 步:建立知識庫 / Create a knowledge base

  1. 建立知識庫 / Create Knowledge Base

  2. 選來源:

    • 匯入已有文件(Markdown、PDF、Word、TXT)

    • 同步 Notion(如果你已有 Notion 內容,授權即可)

    • 建立空知識庫(之後再上傳)

第 4 步:上傳並測試 / Upload and test

  1. 第一次只上傳 同一主題 的少量文件(例如只傳「產品手冊」相關),避免資料混亂。

  2. 上傳後 Dify 會自動切分(chunking),等待索引完成。

  3. 用 5–10 個真實問題測試 AI 回答:

    • 答案準確嗎?

    • 引用的資料對嗎?

    • 有沒有漏答?

測試 OK 後再上傳更多文件。

命名建議 / Naming suggestions

按主題分開建多個知識庫,不要全部塞一個:

  • 個人知識庫-工作

  • 個人知識庫-學習

  • 個人知識庫-產品資料

上傳原則 / Upload rules

  • 先整理再上傳,不要把雜亂草稿全丟進去

  • 文件標題寫清楚(AI 會用到)

  • 同主題放同一個知識庫

  • 定期刪除過時內容


评论