mirror of
https://github.com/wahyd4/kb.git
synced 2026-08-09 05:16:11 +10:00
- 3-layer architecture: raw (monthly buckets) → wiki (domain subdirs) → SCHEMA - Privacy: repo set to private (public-safe content only) - Sync: daily Links App sync via raw/links/YYYY-MM/ - Design: converged via Grok 4.5 2-round review
134 lines
3.4 KiB
Markdown
134 lines
3.4 KiB
Markdown
# KB Schema
|
||
|
||
> LLM 驱动的个人知识库。大哥的第二大脑外存。
|
||
> 原则:默认全存,人类筛选,Agent 编译。
|
||
|
||
## Domain
|
||
|
||
大哥的知识域:技术(DevOps/K3s/Cloudflare/Agent)、投资(AI/半导体/云/澳洲税)、生活(墨尔本/钢琴/家庭)
|
||
|
||
## Conventions
|
||
|
||
- 文件名:英文小写连字符,无空格无中文(如 `nvidia-thesis.md`)
|
||
- wiki 页面用 `[[wikilinks]]` 互连,每页最少 2 个出链
|
||
- `updated` 只在实际内容变更时更新,不是 agent 碰过就改
|
||
- 新 raw 文件自动进入 `raw/YYYY-MM/`
|
||
|
||
## Directory Structure
|
||
|
||
```
|
||
kb/
|
||
├── SCHEMA.md # 本文件
|
||
├── log.md # 操作日志
|
||
├── raw/ # 源材料(按月分桶,不可变)
|
||
│ ├── links/ # 从 Links App 自动同步的新闻
|
||
│ └── YYYY-MM/ # 手动分享的文章、网页
|
||
├── wiki/ # 编译后的知识页
|
||
│ ├── investing/ # 投资相关
|
||
│ ├── tech/ # 技术相关
|
||
│ ├── life/ # 生活相关
|
||
│ └── decisions/ # 决策日志(最高价值)
|
||
└── _archive/ # 已废弃页面
|
||
```
|
||
|
||
## Frontmatter
|
||
|
||
### raw 文件
|
||
|
||
```yaml
|
||
---
|
||
source_url: https://...
|
||
ingested: YYYY-MM-DD
|
||
status: inbox | absorbed | skipped | failed_fetch
|
||
---
|
||
```
|
||
|
||
### wiki 页面
|
||
|
||
```yaml
|
||
---
|
||
title: "页面标题"
|
||
created: YYYY-MM-DD
|
||
updated: YYYY-MM-DD
|
||
tags: [domain/subtag]
|
||
sources: [raw/YYYY-MM/file.md]
|
||
---
|
||
```
|
||
|
||
## Tag System (open prefix)
|
||
|
||
| Prefix | 初始 tags |
|
||
|--------|----------|
|
||
| `tech/` | `infra`, `k3s`, `cf-workers`, `llm`, `agent`, `homelab`, `devops`, `networking`, `security`, `database` |
|
||
| `inv/` | `semi`, `cloud`, `ai`, `thesis`, `earnings`, `tax`, `valuation`, `macro`, `risk`, `strategy` |
|
||
| `life/` | `music`, `piano`, `health`, `family`, `melbourne`, `australia` |
|
||
|
||
新 tag 直接用,lint 只建议不拦截。
|
||
|
||
## Operations
|
||
|
||
### Ingest (采集 — 即时)
|
||
大哥分享 URL/粘贴 → Agent 抓取内容 → 保存 `raw/YYYY-MM/YYYY-MM-DD-slug.md`
|
||
→ status: inbox
|
||
|
||
### Absorb (消化 — 人类触发)
|
||
1. 读 raw
|
||
2. rg 搜 wiki/ 找相关页面
|
||
3. 优先更新已有页面
|
||
4. 必要时建新页(清晰有价值才建)
|
||
5. 更新 status → absorbed
|
||
|
||
### Query (查询)
|
||
rg 搜 wiki/ + raw/ → 结果标 [wiki] 或 [raw] → 合成回答
|
||
|
||
### Lint (健康检查)
|
||
- P0: 断链 → 必须修
|
||
- P1: 投资页 >60天未更新 → 建议修
|
||
- P2: 孤儿页 → 提示
|
||
|
||
## Page Templates
|
||
|
||
### Stock Thesis
|
||
```markdown
|
||
# [Company] Thesis
|
||
- Conviction: [high/medium/low]
|
||
- Entry: [date] @ [price]
|
||
- Thesis: [3-5 bullet reasons]
|
||
- Risks: [what would break the thesis]
|
||
- Catalysts: [upcoming events]
|
||
- Last review: [date]
|
||
```
|
||
|
||
### Decision Log
|
||
```markdown
|
||
# [Decision Title]
|
||
- Date: YYYY-MM-DD
|
||
- Context: [what was the situation]
|
||
- Options considered: [list]
|
||
- Decision: [what was chosen]
|
||
- Rationale: [why]
|
||
- Outcome (if known): [what happened]
|
||
```
|
||
|
||
### Tech Runbook
|
||
```markdown
|
||
# [Component] Runbook
|
||
- Purpose: [what it does]
|
||
- Location: [repo/namespace/URL]
|
||
- Key configs: [critical settings]
|
||
- Common issues: [problems + fixes]
|
||
- Links: [[related-page]]
|
||
```
|
||
|
||
## Kill / Merge Policy
|
||
|
||
- 被取代的页面前端加 `superseded_by: [[new-page]]`
|
||
- 移到 `_archive/`
|
||
- 保留 wikilinks 可点击
|
||
|
||
## Language Policy
|
||
|
||
- 正文:中文(技术术语保留英文)
|
||
- 文件名:英文 slug
|
||
- [[wikilinks]]:英文 slug
|