OKF in plain words
The Open Knowledge Format v0.3, explained with examples. It is a reading aid, not a replacement. When this explanation and the spec disagree, the spec is right, and we would like to hear about it.
The bundle
A bundle is a folder. Every Markdown file in it that has a type in its frontmatter is a concept. Subfolders group concepts however you like: the spec does not prescribe a layout, and it does not depend on your domain (§3).
index.md lists what is there and holds the bundle metadata. log.md is the history of changes. Both are optional. Every other file is one concept, and folders group concepts any way you like. The path of a file, without .md, is the concept's ID: tables/orders.A bundle can be its own git repository, a zip file, or a subfolder of a larger repository. The spec recommends git, because it gives you history and diffs for free. Files and folders whose names start with a dot are not part of the bundle. Non-Markdown files (images, SQL files, scripts) are assets: concepts can link to them, but they are not concepts.
A concept: frontmatter and body
A concept file has two parts. The frontmatter is a YAML block between two --- lines at the very top. The body is everything after it, written in standard Markdown (CommonMark), plus tables and footnotes (§4).
type is the only key that is always required. It is a short label of your choice, such as Table, Metric, Policy or Runbook. There is no official list, and readers must accept types they have never seen. The common optional keys are title, description (one sentence), tags, and resource, a URI for the real thing the concept describes, when there is one.
---
type: Warehouse Table
title: Orders
description: One row per completed customer order, all channels.
resource: postgres://analytics/public/orders
tags: [sales, orders]
---
# Schema
| Column | Type | Description |
|---------------|-----------|-------------------------------------|
| `order_id` | text | Unique order identifier. |
| `customer_id` | text | Joins to [customers](customers.md). |
| `total_eur` | numeric | Order total in euros, VAT included. |
| `placed_at` | timestamp | When the customer paid. |
A body has no required sections. The spec gives a conventional meaning to three headings: # Schema, # Examples and # Computation. Use any other headings you need.
Links and path fields
Concepts point at each other with normal Markdown links, like [customers](customers.md) above. A link says that two concepts are related. The sentence around the link says how. Links that point at a file nobody has written yet are allowed: readers must accept broken links (§6).
Some frontmatter keys hold a path instead of prose. The spec calls them path fields: resource, sources[].resource, superseded_by, and the computation keys. Links and path fields follow the same rule, and both forms below are valid:
| Written as | Resolves from | Example |
|---|---|---|
Starts with / | The bundle root | /tables/customers.md |
| Anything else | The folder of the file that contains it | customers.md, ../tables/customers.md |
| Has a scheme | Nowhere, it is an external URL | https://wiki.example.com/refunds |
The spec does not prefer one in-bundle form over the other. We use the / form for path fields in our own bundles, and say why on Spec and our conventions.
index.md and log.md
Two filenames are reserved at every level of the bundle and are never concepts (§8, §9).
index.md lists what a folder contains, so a person or an agent can see what is there before opening every file. Only the index at the bundle root may have frontmatter, and it describes the bundle as a whole:
---
okf_version: "0.3"
title: Finance knowledge
description: Tables, metrics and policies for the finance team. Use it for revenue and refund questions.
license: CC-BY-4.0
---
# Tables
* [Orders](tables/orders.md) - One row per completed customer order, all channels.
# Policies
* [Expense approval](policies/expense-approval.md) - Who approves what, and when.
log.md is a history of changes, grouped under date headings, newest first. It has no frontmatter, and the date headings must be YYYY-MM-DD.
# Update log
## 2026-11-20
* **Deprecation**: retired the old [refund policy](policies/refunds-2024.md).
## 2026-10-02
* **Creation**: added the [orders table](tables/orders.md).
Optional metadata: source, trust, freshness
When agents write and rewrite most of a bundle, a reader needs a few more answers: where did this come from, who checked it, is it still current. The spec groups the keys that answer these into families (§5). All of them are optional. A concept without them is still valid. It simply tells the reader less.
Provenance: sources
sources lists what a concept was made from. Each entry needs a resource. It can also carry facts about the source, such as its author, when it last changed, and how often it is used. OKF records these facts and leaves the judgment to the reader. To attribute one claim, use a footnote whose label is the source's id.
---
type: Metric
title: Monthly customer churn
description: Share of paying customers at the start of a month who cancel during it.
tags: [subscriptions, retention]
generated: { by: "human:lena", at: "2026-09-01T10:00:00Z" }
verified: { by: "team:finance-fpa", at: "2026-09-03T15:00:00Z" }
sources:
- id: board-pack
resource: https://wiki.example.com/finance/board-pack-definitions
title: Board pack metric definitions
author: "team:finance-fpa"
last_modified: "2026-08-14"
---
# Definition
Customers who cancel during the month, divided by paying customers
on the first day of that month.[^board-pack] Trial accounts do not count.
[^board-pack]: Board pack metric definitions
Trust: generated and verified
generated says who or what wrote the current content, and when. verified lists who confirmed it afterwards. They are kept apart on purpose: the one who writes a concept is often not the one who checks it. Actors are written as human:lena, team:finance-fpa, process:nightly-checks, or agent-name/version for software (§7).
From these two keys a reader works out a trust tier: unverified, machine-confirmed, or human-reviewed. Only a human: actor gives human-reviewed. A team name does not, because it does not say which person looked. In the metric above, the check by team:finance-fpa makes the concept machine-confirmed.
A verification counts only if it happened at or after generated.at (§5.3). If an agent rewrites a concept after a person reviewed it, the person has not read the new text, so the concept drops back to a lower tier until someone checks it again. Old verified entries stay in the file as history.
Lifecycle: status, superseded_by, stale_after
status is draft, stable (the default) or deprecated. When a concept is replaced, keep the old file, mark it deprecated and point superseded_by at the replacement. Old links keep working, and a reader looking for current knowledge can follow the pointer (§5.4).
---
type: Policy
title: Refund policy (2024)
status: deprecated
superseded_by: /policies/refunds.md
---
Replaced in November 2026. See the [current refund policy](refunds.md).
stale_after is a date after which someone should check the content again. Stale does not mean wrong. It means "look at this again". Leave it out when you do not know a sensible review date (§5.5).
---
type: Runbook
title: Payment provider outage
description: What on-call does when card payments start failing.
tags: [oncall, payments]
stale_after: "2027-03-01"
---
# Trigger
The card failure rate stays above 5% for ten minutes.
# Steps
1. Check the provider's status page.
2. If the provider confirms an outage, switch checkout to the
backup provider with the `payments.fallback` flag.
3. Post in the incident channel every 30 minutes until resolved.
Attested computations
Some numbers must be computed one approved way. An Attested Computation is a concept that holds that approved query or script, the parameters an agent may fill in, and a pointer to a checker. After each run, the checker confirms that the approved query is the one that ran (§10). The agent supplies values, never the query. OKF only describes the contract: running it is up to your tools.
---
type: Attested Computation
title: Refund rate for a month
runtime: postgres
parameters:
- { name: month, type: date, required: true }
executor:
resource: /references/run-on-postgres.md
receipt: [query_id, executed_sql, result]
attester:
resource: /references/attesters/sql-equality.py
---
# Computation
```sql
SELECT count(*) FILTER (WHERE refunded) / count(*)::numeric
FROM orders
WHERE date_trunc('month', placed_at) = :month
```
A reader must not show a value as attested unless the concept has both a runtime and an attester. Appendix A of the spec has a full worked example with revenue and profit.
Extensions: x- keys
You can add your own keys anywhere in the frontmatter. Readers must not reject keys they do not know, and tools that edit a file must keep them. Future versions of OKF will never define a key that starts with x-, so the spec suggests x-<producer>-<name> for your own, for example x-acme-owner: payments-team (§4.1). okf-skills uses x-okf-skills-upkeep and x-okf-skills-recursive this way.
What conformance means
The spec's definition is short (§11.1). A bundle is conformant when:
- every frontmatter block in a
.mdfile parses as a YAML mapping, and index.mdandlog.mdfollow their rules when they are present.
That is all. A Markdown file without frontmatter, such as a README.md, is not a concept and does not make a bundle non-conformant. Most of the rest of the spec is guidance for producers ("SHOULD") and rules for readers ("MUST accept broken links", "MUST NOT reject keys that they do not know"). Readers must not reject a bundle for missing optional fields, unknown types, unknown keys, broken links or missing index files.
Our validator follows this split. Only §11.1 problems are errors. Spec guidance shows up as warnings, and our own style advice is off unless you ask for it with --lint. A README.md inside the bundle and a link to a file that does not exist yet are both warnings, so --strict fails on them. Use --max-warnings if you want to keep them. Passing our validator with extra flags is a choice you make for your bundle, and conformance asks for less. See The toolkit.