OKF:把研究资料写成 Agent 也能读的知识包
解读 Google Knowledge Catalog 中的 Open Knowledge Format,以及它如何服务个人研究
GoogleCloudPlatform/knowledge-catalog ↗ 是 Google Cloud 放出的一组工具、样例与格式规范。仓库里真正值得单独拎出来的,是 okf/:Open Knowledge Format——一种用 Markdown + YAML frontmatter 表示知识的开放格式。
Knowledge Catalog(能力方向承接自 Dataplex 一类数据目录产品)要做的是:把结构化与非结构化数据收成可查询的知识图,给 AI Agent 提供语义和业务上下文。OKF 是这条产品线里被抽出来、写成规范的那一层交换格式:不绑定某家 Agent 框架,也不要求中央 schema 注册表。
这篇文章按这条线展开:OKF 解决什么问题、v0.1 规范具体约定了什么、仓库里的 reference agent 怎么生产与消费、个人研究怎么用。文末附一份可直接给 Agent 用的生成 Skill(嵌在正文里)。
OKF 的判断很直接:知识最好写成能
cat、能git、能塞进上下文窗口的文件。目录服务可以继续存在,但交换层应落在开放文件格式上。
它在解决什么问题#
Agent 越来越常被要求「先读懂领域,再动手」。领域知识通常散落在三类地方,各自卡在不同点上:
| 形态 | 强项 | 卡点 |
|---|---|---|
| 服务型目录(Dataplex、Unity Catalog、Collibra、内部数据字典) | 查询、权限、治理 | 要 SDK 与网络;难做代码式 review / diff |
| 个人笔记库(Obsidian、Notion、各类 wiki) | 对人友好、好写 | 结构随意;Agent 难稳定解析类型、资源、引用 |
| 源码旁 README / 注释 | 可版本管理 | 缺少统一的概念粒度与交叉链接约定 |
OKF 选中间路线:
知识包 = 目录树 + Markdown 文件 + 少量 frontmatter 约定text它故意不做三件事(SPEC 的 Non-goals):
- 不规定固定的概念类型表(taxonomy)
- 不规定存储、服务、查询基础设施
- 不取代 Avro / Protobuf / OpenAPI 等域内 schema——OKF 引用它们,不吞并它们
仓库 README 把两侧写死:
- Anyone can produce:人手写、任意框架上的 Agent、从现有目录导出的管道、扫库脚本
- Anyone can consume:静态文件服务、Obsidian / MkDocs、把文件直接塞进 LLM 上下文、搜索索引、图可视化
因此:okf/ 里的 reference agent 只是生产端样例,visualize 生成的 viz.html 只是消费端样例。格式本身才是贡献。
规范里有什么(OKF v0.1)#
SPEC 路径:仓库内 okf/SPEC.md,版本 0.1 Draft。下面按「必须先懂的术语 → 文件长什么样 → 合规底线」写。
术语#
| 术语 | 含义 |
|---|---|
| Knowledge Bundle | 一整包知识,通常是一个目录,可放进 git;分发单位 |
| Concept | 一个概念文档 = 一个 .md 文件;可以是表/API,也可以是指标/流程等抽象物 |
| Concept ID | 相对 bundle 根的路径,去掉 .md。tables/users.md → tables/users |
| Frontmatter | 文件顶部 --- 包裹的 YAML |
| Body | frontmatter 之后的 Markdown 正文 |
| Link | 概念之间的 Markdown 链接(比目录父子关系更自由的边) |
| Citation | 指向外部来源、支撑正文论断的链接 |
Bundle 目录#
目录怎么分组由生产者决定,规范只保留两个文件名:
| 保留名 | 作用 |
|---|---|
index.md | 目录清单,支持逐级展开(progressive disclosure:先看列表,再打开单个文件) |
log.md | 变更日志,按日期倒序 |
其余 .md 都是 concept,不能用这两个名字当普通概念文档。
最小形态:
my_bundle/
├── index.md
├── datasets/
│ ├── index.md
│ └── sales.md
└── tables/
├── index.md
├── orders.md
└── customers.mdtext分发方式:git 仓库(推荐)、tar/zip、或大仓里的子目录。
Concept 文件长什么样#
每个 concept 两段:
- YAML frontmatter(必需有可解析的块)
- Markdown body(自由正文)
Frontmatter#
SPEC 强制要求的只有 type(非空字符串)。推荐字段按优先级:
---
type: BigQuery Table # 必需:概念种类,用于过滤/展示
title: Customer Orders # 推荐:展示名;缺了可从文件名推
description: One row per completed order. # 推荐:一句话;index 会直接引用
resource: https://... # 推荐:底层资产 URI;纯抽象概念可没有
tags: [sales, orders] # 推荐:横切分类
timestamp: 2026-05-28T14:30:00Z # 推荐:ISO 8601
# 其余键自由扩展;消费者应保留未知键
---yaml注意一个实现与规范的差:
| 层级 | type | title / description / timestamp |
|---|---|---|
| SPEC v0.1 合规 | 必需 | 推荐 |
仓库 reference agent 写出时(OKFDocument.validate) | 必需 | 也当必需(工具层更严) |
type 没有中央注册表。生产者写描述性名字即可,例如 BigQuery Table、Metric、Playbook、Reference。消费者遇到未知 type,按通用 concept 处理,不要拒收。
Body#
标准 Markdown。无强制章节;高频约定标题:
| 标题 | 用途 |
|---|---|
# Schema | 字段/列的结构化说明 |
# Examples 或常见 query 段 | 用法示例,常是代码块 |
# Citations | 支撑论断的外部来源,建议放文末、编号列出 |
正文应偏「结构」(标题、列表、表、代码块),方便人扫,也方便 Agent 截取。
交叉链接#
用普通 Markdown 链接。SPEC 支持两种:
- Bundle 根相对(以
/开头):[customers](/tables/customers.md)——文档在子目录间移动时更稳 - 文件相对:
[customers](../tables/customers.md)——在 GitHub 上直接预览更友好
仓库里的 reference agent 明确要求文件相对路径,并写明:以 / 开头的链接在 GitHub 渲染会坏。读 SPEC 与读 agent prompt 时,以「你的消费场景」为准:只给人本地 cat 可跟 SPEC;要挂 GitHub 浏览,跟 agent 的相对路径约定。
链接语义由周围文字表达(joins-with、depends-on 等),链接本身是无类型边。断链合法——可能只表示还没写完。
index.md 与 log.md#
index.md(任意目录可有):
- 通常无 frontmatter;根 index 例外:可带 frontmatter 声明
okf_version: "0.1" - 正文用标题分组 + 列表:
* [标题](path) - 一句话描述 - 描述优先取自各 concept 的
description - 可自动生成;没有 index 时,消费者也可临时合成
log.md(可选):
- 按
YYYY-MM-DD倒序 - 条目是散文;前导
**Update**/**Creation**等是习惯,不是强制语法
合规底线(v0.1)#
一份 bundle 满足三条即合规:
- 非保留名的
.md有可解析 YAML frontmatter - frontmatter 有非空
type - 若存在
index.md/log.md,结构符合 §6 / §7
下列情况 不得 成为拒收理由:缺可选字段、未知 type、未知扩展键、断链、没有 index。宽松消费是故意的——Agent 会半生成、会重构、会增量补写。
仓库里的参考实现在做什么#
路径:okf/。Python 包,入口是 reference_agent 子命令。两条主能力:
| 命令意图 | 干什么 |
|---|---|
enrich | 从数据源(样例是 BigQuery)+ 可选网页,写出一整个 OKF bundle |
visualize | 把已有 bundle 打成单文件交互 HTML(viz.html),无需后端 |
生产路径:两趟 pass#
第一趟:BQ pass(元数据落盘)#
对 source 宣称的每个 concept,用 BigQuery 元数据写一份 OKF 文档:schema、分区、resource URI 等来自真实接口,不靠模型编造字段。
Agent 单 concept 的 enrichment 工作流(reference_instruction.md)是固定五步,最后只允许调用一次写出:
read_existing_doc:有旧文档则 refine,不整页推翻read_concept_raw:读结构化元数据- 可选
sample_rows:元数据稀疏时看几行样例 list_concepts:知道 bundle 里还有谁,好写交叉链接write_concept_doc:恰好一次,然后停
Body 约定顺序:短散文(表要写清 grain:一行代表什么)→ # Schema → # Common query patterns(1–3 段 SQL)→ # Citations(resource 优先进引用)。
第二趟:Web pass(有预算的爬取增强)#
把 LLM 当成爬虫决策器,而不是无界浏览器:
- 从 seed URL 列表出发抓取(
fetch_url) - 从外链里挑「像权威文档」的继续跟
- 对每个页面三选一:
- 增强已有 concept
- 新建
references/<slug>参考文档 - 跳过
- 硬约束:
--web-max-pages页数上限、默认同域 / 允许 host 过滤——防止爬飞
增强(augmentation)规则比「再写一遍」严:
- frontmatter 必须整表带回:漏键等于删键;
type/title/resource通常原样保留 - 网页 URL 进
# Citations,不要盖掉资产的resource - body 里已有一级标题必须保留且同序;只能在标题下扩展、追加新一级标题在后、或合并 tags
- BigQuery 表的
# Schema不得被网页摘要整页替换——schema 来自元数据真相 - 网页上的 metric / join 等高信号内容,应落到独立 reference 文档,并尽量带上具体 SQL,而不是「详见文档」一句
新建 references/ 也有四道门(主题可被主文档按名字引用、不是 overview/quickstart 类元页面、能写出 “See the X reference for…”、至少两个概念用得上或一个概念强依赖)。拿不准就 skip——空的 references/ 好过一堆噪声 overview。
可用 --no-web 只跑 BQ pass;可用 --concept 只打磨单个 concept。
消费路径:visualize#
visualize 把 bundle 嵌成 JSON,生成自包含 HTML:力图(节点按 type、边来自 Markdown 链接)、详情面板、反向引用、搜索与类型过滤。依赖浏览器里的图库与 Markdown 渲染,不需要服务端。
样例 bundle#
仓库内置三份(bundles/):
| 目录 | 内容 |
|---|---|
ga4/ | GA4 电商导出样本 |
stackoverflow/ | Stack Overflow 公共数据集 |
crypto_bitcoin/ | 比特币区块 / 交易 |
GA4 的分层直观:
ga4/
├── index.md
├── datasets/ga4_obfuscated_sample_ecommerce.md
├── tables/events_.md
└── references/
├── metrics/user_count.md # 一句话 + SQL + Citations
└── joins/events___ads_clickstats.mdtextuser_count 这类 metric reference 极短:定义 + SQL 表达式 + 来源。价值是被多个主 concept 引用,而不是再写一篇长文。
和个人研究的关系#
官方场景是数据目录与 Agent 上下文。格式本身不绑定 BigQuery。个人做持续调研时,它补的是「资料堆」和「可复用知识」之间的缺口。
常见失败形态 → OKF 对应手段#
| 失败形态 | 症状 | OKF 怎么对 |
|---|---|---|
| 收藏夹型 | 链接多,概念无稳定 ID | 一 concept 一文件;Concept ID = 路径 |
| 长文笔记型 | 万字 md 什么都有,Agent 无法按需加载 | index.md 先列清单;按需打开叶子 |
| 聊天记录型 | 判断散落对话,无法 diff / review | 判断进 claims/;整包进 git |
| 向量库型 | 好检索,缺权威正文与版本史 | Markdown 真源 + frontmatter 可过滤字段 |
个人研究可用的 type(非官方注册,一次调研内保持稳定即可):
| type | 写什么 |
|---|---|
Topic | 边界、非目标、核心问题 |
Question | 可回答的问题 + 当前状态(open / partial / answered) |
Claim | 有条件的判断 + 证据 / 反证 |
Source | 论文、仓库、官方文档等 |
Concept | 术语、机制、对照 |
Route | 技术路线 / 流派在坐标系中的位置 |
Experiment | 实际试用、复现、对比 |
OpenGap | 已知缺口,避免假装已搞清 |
Playbook | 可复用步骤 |
Reference | 被多处引用的附录材料 |
description 始终保持一句,因为 index 会直接引用它。
个人研究 bundle 骨架示例#
research/<topic>/
├── index.md
├── log.md
├── topic.md
├── questions/
├── claims/
├── sources/
├── concepts/
├── routes/
├── experiments/
└── gaps/textAgent 默认工作方式可以变成:
- 读根
index.md建立地图 - 只打开当前任务相关的 concept
- 新判断写到
claims/,回链sources/ - 未知写到
gaps/,不在长文里含糊带过
这比「把全部 PDF 摘要塞进一次 prompt」更省上下文,也更接近真实研究推进:地图 → 深挖 → 有条件判断 → 标缺口。
生产与消费时的两条纪律#
生产(人或 Agent 写 bundle)
- 无来源的事实:要么不写,要么进
OpenGap - 增强已有文档:augment,不整页 rewrite(与 reference agent 规则一致)
- 链接只指向真实存在(或本轮会写出)的 concept
消费(Agent 读 bundle)
- 从根
index.md开始 - 只下钻与当前问题相关的目录
- 最后才读叶子 concept
- 回答里引用 Concept ID,方便人打开同一文件
- 有 index 时不要整包灌进上下文
和相近做法的差别#
| 做法 | 接近点 | 差别 |
|---|---|---|
| Obsidian vault | md + 双链 | OKF 规定最小 frontmatter 与保留文件名,便于跨工具交换 |
| LLM wiki / agent memory 仓库 | Agent 可读知识库 | OKF 把 bundle 合规与渐进披露写成规范 |
| Metadata as code | 元数据进 git | OKF 同时容纳长正文,不只是 schema YAML |
| 企业数据目录 | 语义与血缘 | OKF 是可搬运文件格式,不替代服务端查询与治理 |
一句话:OKF 把「知识写成可协作的代码对象」收敛成一份很薄的规范。
什么时候值得用,什么时候不必#
值得用
- 主题会持续几周以上,资料要反复回看
- 希望 Agent 参与阅读、补全、交叉验证
- 判断需要证据链,而不是一次性聊天结论
- 已经在用 Markdown / git
不必硬上
- 一次性问答,答案用完即弃
- 内容几乎全是无法文本化的私有二进制
- 团队已有强制统一的目录平台,且没有导出 / 同步需求
成本主要在「拆概念」和「写一句话 description」。换来的是:后人(包括未来的你和 Agent)不用从一坨笔记里重新考古。
附:OKF 生成 Skill#
下面这份 Skill 可直接复制为 ~/.claude/skills/okf-generator/SKILL.md(或项目内 .claude/skills/okf-generator/SKILL.md)。面向个人研究与通用知识包生成,兼容 OKF v0.1,不依赖 BigQuery。
使用时对 Agent 说「按 OKF 生成知识包」并给出主题 / 输出路径 / 材料来源即可;Skill 会要求先盘点 concept,再写文件、补链接、生成 index,并做合规检查。
---
name: okf-generator
description: Use when the user wants to create, expand, or normalize an Open Knowledge Format (OKF) bundle for research notes, domain knowledge, data catalogs, or agent-readable context. Generates conformant markdown+YAML knowledge packages with concepts, indexes, links, and citations.
---
# OKF Generator
## Overview
Produce or refine an **Open Knowledge Format (OKF) v0.1** knowledge bundle: a directory of markdown files with YAML frontmatter, cross-links, progressive `index.md` files, and optional `log.md`.
OKF is vendor-neutral. Anyone can author it; anyone can consume it (`cat`, git, Obsidian, LLM context, static hosting). This skill is a **producer**. Prefer small, concrete concept docs over monolithic notes.
**Spec anchors (keep behavior aligned):**
- Required frontmatter key: `type`
- Recommended: `title`, `description`, `resource`, `tags`, `timestamp`
- Reserved filenames: `index.md`, `log.md` (never use as concepts)
- Concept ID = path relative to bundle root without `.md`
- Broken links are allowed; invented facts are not
## When to use
- User asks to turn research / notes / a repo / a dataset into an OKF bundle
- User wants agent-readable domain knowledge for later sessions
- User wants to restructure messy markdown into linked concepts
- User mentions OKF, knowledge bundle, knowledge catalog format, or “open knowledge format”
## Inputs to collect (ask only if missing)
1. **Topic / domain** — one sentence
2. **Output path** — default `./okf-bundle/<slug>/` if unspecified
3. **Source material** — files, URLs, repos, chat notes, or “from scratch”
4. **Audience** — personal research | team wiki | agent context | data catalog
5. **Scope non-goals** — what not to include this round
If the user only gives a topic, proceed with a minimal skeleton + a short `gaps/` list of what still needs sources.
## Core workflow
### Phase 0 — Decide bundle shape
Create a root directory. Choose a layout by audience:
**A. Personal research (default)**
```text
<bundle>/
├── index.md
├── log.md
├── topic.md
├── questions/
├── claims/
├── sources/
├── concepts/
├── routes/ # optional: schools of thought / approaches
├── experiments/ # optional: trials you actually ran
├── playbooks/ # optional: procedures
├── gaps/
└── references/ # optional: multi-cited appendices
```
**B. Software / system domain**
```text
<bundle>/
├── index.md
├── log.md
├── overview.md
├── components/
├── apis/
├── decisions/ # ADRs as concepts
├── runbooks/
├── sources/
└── gaps/
```
**C. Data catalog style**
```text
<bundle>/
├── index.md
├── datasets/
├── tables/
├── metrics/
├── joins/
└── references/
```
Do not invent a deep taxonomy on day one. Prefer 3–7 top-level groups.
### Phase 1 — Inventory concepts
From sources, list candidate concepts before writing files.
For each candidate capture:
| Field | Rule |
|-------|------|
| working title | human-readable |
| proposed `type` | short descriptive string |
| one-line description | max ~25 words; will feed `index.md` |
| source pointers | URLs / paths that justify it |
| links to | other concept IDs it should reference |
**Split rules**
- One primary idea per file
- If a section needs its own citations and inbound links from ≥2 docs, promote it to a concept
- Overviews, FAQs, changelogs, marketing pages: usually **do not** become standalone reference concepts; fold useful facts into existing docs or skip
**Skip / gap rules**
- No source → either omit or create `gaps/<slug>.md` stating what is unknown
- Never fabricate schema fields, metrics SQL, paper results, or URLs
### Phase 2 — Write concept documents
Every concept file:
```markdown
---
type: <Type>
title: <Display name>
description: <One sentence summary>
resource: <Optional canonical URI>
tags: [tag1, tag2]
timestamp: <ISO 8601 Z>
---
<prose>
# Optional conventional sections
```
#### Frontmatter rules
| Key | Required | Guidance |
|-----|----------|----------|
| `type` | yes | Stable within the bundle. Examples below |
| `title` | strongly recommended | Display name; if omitted consumers may use filename |
| `description` | strongly recommended | **Exactly one sentence.** Used verbatim in indexes |
| `resource` | when bound to an asset | Dataset URI, paper DOI/URL, repo URL, API path. Abstract ideas may omit |
| `tags` | recommended | Short, searchable; merge on updates, don’t silently drop |
| `timestamp` | recommended | ISO 8601; update on meaningful change |
| extensions | allowed | Preserve unknown keys on round-trip |
**Suggested `type` values**
Personal research: `Topic`, `Question`, `Claim`, `Source`, `Concept`, `Route`, `Experiment`, `OpenGap`, `Playbook`, `Reference`
Systems: `Component`, `API`, `Decision`, `Runbook`, `Service`, `Reference`
Data: `BigQuery Dataset`, `BigQuery Table`, `Metric`, `Join`, `Reference`
Consumers must tolerate unknown types — pick descriptive names over empty generics when possible.
#### Body rules
Order for most docs:
1. Short prose (1–3 paragraphs): what it is, grain/scope, caveats
2. Structured sections as needed (`# Schema`, `# Evidence`, `# Counterevidence`, `# Examples`, `# Steps`, …)
3. `# Citations` last when claims need backing
Style:
- Concrete names > vague praise
- Prefer headings, lists, tables, fenced code
- No preamble, apologies, or chain-of-thought in the body
- Body must be directly consumable by a human or downstream agent
#### Type-specific body patterns
**Topic**
- Boundary, non-goals, core questions, success criteria for the research
**Question**
- Why it matters, current answer status (`open` / `partial` / `answered`), links to claims & sources
**Claim**
- Statement in one sentence (prefer conditional judgments: “under X, Y”)
- Evidence bullets with links to `sources/` or external citations
- Counterevidence / limits
- Confidence note only if grounded (e.g. “single secondary source”)
**Source**
- What it is, author/org, date, why it matters for this bundle
- Key takeaways (bullets)
- Limitations (bias, age, scope)
- `resource` = canonical URL
**Concept**
- Definition, mechanism, comparison to neighbors
- Optional glossary table
**Route**
- Problem framing, key mechanism, trade-offs, representative examples
**Experiment**
- Setup, steps, observed result, artifacts paths, what it does/doesn’t prove
**OpenGap**
- What is unknown, why it blocks, how one might close it
**Playbook**
- Trigger, steps, verification, rollback/failure notes
**Reference** (multi-cited appendix)
- Only mint if **all** hold:
1. Referenceable by name from primary docs
2. Not bundle-level meta (overview / quickstart / FAQ / changelog)
3. You can write: “See the [X reference](…) for …” with X a concrete noun
4. ≥2 concepts benefit, OR one concept needs load-bearing background that doesn’t fit inline
- When in doubt, **skip** or fold into an existing doc
**Table / schema-like**
- `# Schema` must reflect real metadata only
- Optional `# Common query patterns` with real examples
- Do not invent columns
### Phase 3 — Cross-linking
- Link when prose naturally names another concept
- Prefer **file-relative** links so GitHub and local browsing work:
- sibling: `[orders](orders.md)`
- parent: `[sales dataset](../datasets/sales.md)`
- reference: `[user count](../references/metrics/user_count.md)`
- Absolute bundle-root links (`/tables/orders.md`) are OKF-legal; use only if the target environment resolves them
- One link per concept mention per section is enough
- Do not link from headings, code blocks, or raw schema field lists
- Do not self-link
- Only link to concepts that exist (or will exist in this same write pass)
- Broken links to future work are acceptable if intentional; prefer a `gaps/` doc for known holes
### Phase 4 — Indexes and log
#### `index.md` (any directory)
- **No frontmatter** at non-root levels
- Root `index.md` MAY include frontmatter only for `okf_version: "0.1"`
- Structure:
```markdown
# Section name
* [Title](path.md) - description from frontmatter
* [Subdir](subdir/) - one-sentence summary of the group
```
- Descriptions SHOULD come from each concept’s `description`
- Generate indexes bottom-up after concepts exist
- If a directory has a single child, still add index for stable navigation
#### `log.md` (optional but recommended for multi-session research)
```markdown
# Update Log
## YYYY-MM-DD
* **Creation**: …
* **Update**: …
* **Deprecation**: …
```
Newest date first. Bold lead word is convention, not required.
### Phase 5 — Conformance check
Before finishing, verify:
- [ ] Every non-reserved `.md` has parseable YAML frontmatter
- [ ] Every frontmatter has non-empty `type`
- [ ] Every concept has a tight one-sentence `description` when practical
- [ ] No concept uses filename `index.md` or `log.md`
- [ ] Relative links resolve for files written in this pass
- [ ] No invented URLs, fields, metrics, or paper results
- [ ] `index.md` files list real children with useful descriptions
- [ ] Claims that assert facts have `# Citations` or links to `sources/`
- [ ] Gaps are explicit documents or clearly marked — not silent omission presented as certainty
### Phase 6 — Handoff
Return to the user:
1. Bundle root path
2. Concept count by `type`
3. How to browse: open root `index.md`, or drag into Obsidian, or feed selective files to an agent
4. Suggested next enrichment steps (which `gaps/` to close first)
5. Optional: command ideas for visualization / packaging (zip, git init) — do not require Google tooling
## Update / enrich existing bundles
When a bundle already exists:
1. Read target concept with full frontmatter + body
2. Treat existing structure as source of truth
3. **Augment, don’t rewrite**:
- Preserve all existing frontmatter keys/values unless improving `description` or merging `tags`
- Keep every existing top-level `#` heading and order; you may extend under them or append new headings after
- For schema-like sections populated from real metadata: never drop fields
- Put new external URLs in `# Citations`, not overwriting `resource` unless the asset identity truly changed
4. Refresh `timestamp` on meaningful edits
5. Append `log.md` entry
6. Regenerate affected `index.md` descriptions if titles/descriptions changed
## Progressive disclosure for agents consuming the bundle
When **using** a bundle (not only writing one):
1. Start at root `index.md`
2. Open only directories relevant to the current question
3. Read leaf concepts last
4. Prefer citing concept IDs in answers so humans can open the same files
5. Do not dump the entire bundle into context if indexes exist
## Quality bar (what “good OKF” means)
| Good | Bad |
|------|-----|
| Small concepts with stable IDs | One 8k-line `notes.md` |
| Conditional claims + citations | Orphan opinions with no source |
| Indexes that enable skimming | Directory full of files, no map |
| Explicit `gaps/` | Confident prose hiding unknowns |
| Relative links that browse on GitHub | Links that only work in one proprietary app |
| Types stable within the bundle | Random type strings each file |
## Common mistakes
| Mistake | Fix |
|---------|-----|
| Putting overview/tutorial pages into `references/` | Skip or extract only named metrics/enums/defs |
| Rewriting entire docs on each enrichment | Augment in place; preserve headings & schema |
| Multi-sentence `description` | Compress to one sentence for indexes |
| Using `index.md` as a concept | Move content to `overview.md` or `topic.md` |
| Inventing SQL/metrics from memory | Quote only from provided sources; else `gaps/` |
| Absolute `/...` links on GitHub-first bundles | Prefer file-relative links |
| Tags replaced wholesale | Union old ∪ new |
| No citations on strong claims | Add `# Citations` or demote to `OpenGap` |
## Minimal examples
### Claim
```markdown
---
type: Claim
title: File-based knowledge beats chat memory for multi-week research
description: Multi-week research stays reviewable when claims live as versioned files with citations.
tags: [research-method, okf]
timestamp: 2026-07-20T00:00:00Z
---
Under multi-week personal research, storing claims as individual markdown concepts with citations is more recoverable than leaving judgments in chat transcripts.
# Evidence
- Chat transcripts lack stable IDs and line-level review.
- Git diffs make claim edits explicit over time.
- See [Open Knowledge Format](../sources/okf-spec.md).
# Limits
- High authoring cost for throwaway questions.
- Requires discipline to split concepts.
# Citations
[1] [OKF SPEC inspiration](https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md)
```
### Source
```markdown
---
type: Source
title: GoogleCloudPlatform/knowledge-catalog OKF
description: Upstream OKF v0.1 draft and reference agent for markdown knowledge bundles.
resource: https://github.com/GoogleCloudPlatform/knowledge-catalog/tree/main/okf
tags: [okf, primary-source]
timestamp: 2026-07-20T00:00:00Z
---
Upstream repository defining Open Knowledge Format and shipping a BigQuery + web enrichment reference agent.
# Key takeaways
- Bundle = directory of md + YAML frontmatter
- Only `type` is strictly required
- Designed for both humans and agents without SDKs
# Limitations
- Official samples focus on BigQuery-shaped catalogs
- Format is still v0.1 draft
```
### Root index
```markdown
---
okf_version: "0.1"
---
# Overview
* [Topic](topic.md) - Research boundary and core questions for OKF personal use.
# Groups
* [claims](claims/) - Conditional judgments with evidence.
* [sources](sources/) - Primary and secondary materials.
* [gaps](gaps/) - Known unknowns still blocking confidence.
```
## Execution checklist
Copy and track:
```text
OKF generation
- [ ] Scope + non-goals confirmed
- [ ] Bundle root created
- [ ] Concept inventory listed (title/type/description/sources)
- [ ] Concept files written (frontmatter + body)
- [ ] Cross-links added
- [ ] index.md generated per directory
- [ ] log.md started/updated
- [ ] Conformance check passed
- [ ] Handoff summary returned
```
## Non-goals
- Replacing enterprise catalog services (governance, ACL, lineage queries)
- Mandating a global taxonomy of types
- Requiring Gemini / BigQuery / GCP credentials
- Building a visualizer (optional; out of scope unless user asks)markdown收尾#
Knowledge Catalog 仓库里真正有迁移价值的,不只是某个 GCP 产品的样例代码,而是 OKF 对知识形态的判断:用最小约定,让知识同时对人可读、对 Agent 可解析、对 git 可协作。
规范层几乎只钉死 type 与两个保留文件名;实现层(reference agent)在写出与增强时更严——那是「生产好 bundle」的工程选择,不是合规的全部。个人研究借用同一套形状:把「查过什么、信什么、还缺什么」外化成目录。结构一旦成立,Agent 就可以在同一份知识包上持续读写,而不只是在聊天窗口里临时聪明一次。