[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114226":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":8,"rankLanguage":8,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":8,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":29,"discoverSource":30},114226,"open-knowledge-format","GoogleCloudPlatform\u002Fopen-knowledge-format","GoogleCloudPlatform",null,"HTML",1578,101,26,42,0,2,66,77,15,82.73,"Apache License 2.0",false,"main",true,[],"2026-11-18 16:58:33","2026-11-23 18:23:50","# Open Knowledge Format (OKF)\n\n### 📖 [Read the Open Knowledge Format v0.2 specification → SPEC.md](SPEC.md)\n\n> **This repository is primarily about the [Open Knowledge Format\n> (OKF)](SPEC.md).**\n>\n> OKF is a **universal, vendor-neutral format** for representing knowledge\n> as plain markdown files with YAML frontmatter. It is **not tied to any\n> particular agent, framework, model provider, or serving system**. The\n> goal is simple:\n>\n> - **Anyone can produce** OKF — humans authoring by hand, agents built on\n>   any framework (Google ADK, LangChain, custom), export pipelines from\n>   existing catalogs (Dataplex, Unity Catalog, Collibra, …), or scripts\n>   walking a database.\n> - **Anyone can serve and consume** OKF — a static file server, a\n>   knowledge-management UI (Obsidian, Notion, MkDocs), an LLM loading\n>   files into context, a search index, or a graph viewer like the one\n>   bundled in this repo.\n>\n> The agent below is a **proof of concept** demonstrating *one* way to\n> produce OKF bundles automatically. The format itself is the\n> contribution; this agent and the visualizer exist to make the format\n> tangible at both ends — production and consumption.\n>\n> **See OKF in practice** — three ready-to-browse bundles produced by this\n> agent, checked into [`bundles\u002F`](bundles\u002F):\n>\n> - [`bundles\u002Fga4\u002F`](bundles\u002Fga4\u002F) — GA4 e-commerce dataset\n>   ([viz.html](bundles\u002Fga4\u002Fviz.html))\n> - [`bundles\u002Fstackoverflow\u002F`](bundles\u002Fstackoverflow\u002F) — Stack Overflow\n>   public dataset ([viz.html](bundles\u002Fstackoverflow\u002Fviz.html))\n> - [`bundles\u002Fcrypto_bitcoin\u002F`](bundles\u002Fcrypto_bitcoin\u002F) — Bitcoin\n>   blocks\u002Ftransactions ([viz.html](bundles\u002Fcrypto_bitcoin\u002Fviz.html))\n> - [`bundles\u002Facme_retail\u002F`](bundles\u002Facme_retail\u002F) — Acme Retail\n>   ([viz.html](bundles\u002Facme_retail\u002Fviz.html))\n\n## Why OKF?\n\nOKF represents catalog knowledge as plain markdown files with YAML\nfrontmatter, organized in a directory hierarchy. That choice unlocks a few\nproperties that are hard to get from a service-owned metadata store:\n\n- **Human- and agent-readable.** No SDK or query language stands between a\n  reader and the content. An engineer can `cat` a concept; an LLM can ingest\n  it verbatim into context.\n- **Version-controllable out of the box.** Bundles live in git. Pull\n  requests, line-by-line diffs, blame, and review workflows just work —\n  knowledge curation becomes a normal software-engineering activity.\n- **Portable and lock-in free.** A bundle is a directory. Ship it as a\n  tarball, host it in any repo, mount it from any filesystem, or sync it to\n  any system that speaks files. No proprietary API stands between you and\n  your metadata.\n- **Mixes structured and unstructured data deliberately.** Use frontmatter\n  for the few fields you want to query, filter, or index on (`type`,\n  `resource`, `tags`, `generated`, `status`); use the markdown body for the\n  prose, schemas, and example queries that LLMs and humans actually read.\n- **Trust, provenance, and freshness are first-class.** v0.2 puts queryable\n  signals in frontmatter — where a concept came from (`sources` with per-source\n  credibility signals), who produced and confirmed it (`generated`, `verified`,\n  from which consumers derive a trust tier), and whether it is still current\n  (`status`, `stale_after`) — so an agent-maintained corpus stays trustable\n  without any bespoke runtime.\n- **Minimally opinionated, freely extensible.** A small set of required\n  keys ensures interoperability, but bundles can carry arbitrary extra\n  frontmatter keys and arbitrary body sections without breaking\n  consumers.\n- **Composes with existing tooling.** Many knowledge tools — Notion,\n  Obsidian, MkDocs, Hugo, Jekyll — already speak markdown plus YAML\n  frontmatter, so bundles can be browsed, edited, or rendered without\n  custom UI.\n- **Progressive disclosure built in.** Auto-generated `index.md` files\n  let an agent or human navigate the hierarchy one level at a time\n  instead of loading the entire bundle into context.\n- **Graph-shaped, not just tree-shaped.** Concepts link to each other via\n  normal markdown links, expressing relationships richer than the\n  parent\u002Fchild implied by the directory layout.\n\nThe net effect is that reference agents, consumption agents, and humans\ncollaborate on the same artifacts in the same way they already collaborate\non source code.\n\n## Install\n\n```\npython3.13 -m venv .venv\n.venv\u002Fbin\u002Fpip install --index-url https:\u002F\u002Fpypi.org\u002Fsimple\u002F -e .[dev]\n```\n\n## Credentials\n\n- BigQuery: `gcloud auth application-default login` plus a project for billing\n  (`gcloud config set project \u003Cid>`). Public datasets are readable, but the\n  caller's project is billed for query bytes.\n- Gemini: set `GEMINI_API_KEY` (AI Studio) **or** use Vertex AI by setting\n  `GOOGLE_GENAI_USE_VERTEXAI=true`, `GOOGLE_CLOUD_PROJECT=\u003Cid>`, and\n  `GOOGLE_CLOUD_LOCATION=\u003Cregion>`.\n\n## How the reference agent works\n\nThe reference agent runs in two passes. The **BQ pass** writes one OKF\ndoc per concept the source advertises, using BigQuery metadata alone.\nThe **web pass** then runs the LLM as its own crawler: it receives a\nlist of seed URLs (provided via `--web-seed` or `--web-seed-file`),\nfetches the seeds via the `fetch_url` tool, and decides which outbound\nlinks are worth following based on whether they look like authoritative\ndocumentation for the existing concepts. For each page it fetches, the\nagent chooses to (a) enrich one or more existing concept docs, (b) mint\na standalone `references\u002F\u003Cslug>` doc, or (c) skip. A hard\n`--web-max-pages` cap and a same-domain allowed-hosts filter\n(configurable via `--web-allowed-host`) are enforced inside the tool,\nso the agent cannot overrun. Use `--no-web` to skip the web pass.\n\n## Run\n\nMinimum invocation — point at a BigQuery dataset and a bundle output\ndirectory. Seeds for the web pass are explicit; omit them (or pass\n`--no-web`) to run BQ-only:\n\n```\n.venv\u002Fbin\u002Fpython -m reference_agent enrich \\\n    --source bq \\\n    --dataset \u003Cproject>.\u003Cdataset> \\\n    --web-seed-file \u003Cpath\u002Fto\u002Fseeds.txt> \\\n    --out .\u002Fbundles\u002F\u003Cname>\n```\n\nIterate on a single concept by adding `--concept \u003Ctype>\u002F\u003Cname>` (e.g.\n`--concept tables\u002Fevents_`); repeatable.\n\n## Samples\n\nEach sample pairs a **recipe** (`samples\u002F\u003Cname>\u002F`, with the seed URLs and\nexact `enrich` command) with the **produced bundle** (`bundles\u002F\u003Cname>\u002F`)\nthat the recipe generated. Open the recipe to reproduce; open the bundle\nto browse the result directly.\n\n- **GA4 Google Merchandise Store** — public e-commerce dataset, seeded\n  with canonical GA4 BigQuery Export documentation URLs.\n  · [recipe](samples\u002Fga4_merch_store\u002FREADME.md)\n  · [bundle](bundles\u002Fga4\u002F)\n  · [viz.html](bundles\u002Fga4\u002Fviz.html)\n- **Stack Overflow** — public dataset (mirror of the Stack Exchange Data\n  Dump), seeded with the community's canonical schema references.\n  Exercises multi-concept enrichment from cross-cutting docs pages.\n  · [recipe](samples\u002Fstackoverflow\u002FREADME.md)\n  · [bundle](bundles\u002Fstackoverflow\u002F)\n  · [viz.html](bundles\u002Fstackoverflow\u002Fviz.html)\n- **Bitcoin (crypto)** — public dataset (blocks, transactions, inputs,\n  outputs) from the `bitcoin-etl` pipeline. Exercises cross-table\n  foreign-key relationships in prose.\n  · [recipe](samples\u002Fcrypto_bitcoin\u002FREADME.md)\n  · [bundle](bundles\u002Fcrypto_bitcoin\u002F)\n  · [viz.html](bundles\u002Fcrypto_bitcoin\u002Fviz.html)\n\n## Visualize\n\nThe `visualize` subcommand renders any OKF bundle as a **self-contained\ninteractive HTML file** — one file, no backend, no install on the\nviewing side. Open it in any modern browser, share it as an artifact,\nhost it on a static file server, or commit it next to the bundle (as\nthis repo does).\n\nThe viewer is itself a proof-of-concept *consumer* of OKF, mirroring\nthe way the reference agent is a proof-of-concept *producer*. OKF\nbundles can be consumed by anything that reads markdown; this is just\none shape.\n\n### What it shows\n\n- A **force-directed graph** of every concept in the bundle, with\n  colored nodes by type (datasets, tables, references, …) and directed\n  edges drawn from each cross-link in the markdown bodies.\n- A **detail panel** for the selected concept showing its frontmatter\n  (description, resource link, tags) and its rendered markdown body —\n  with internal `[…](\u002Fpath\u002Fto\u002Fconcept.md)` links rewired to navigate\n  within the viewer instead of following the path.\n- A **\"Cited by\" backlinks** list under each concept (computed from the\n  reverse of the link graph).\n- A **search box** (matches title, concept id, and tags), a **type\n  filter**, and switchable graph layouts (cose \u002F concentric \u002F\n  breadth-first \u002F circle \u002F grid).\n\n### Generate\n\n```\n.venv\u002Fbin\u002Fpython -m reference_agent visualize --bundle .\u002Fbundles\u002F\u003Cname>\n```\n\nThat writes `bundles\u002F\u003Cname>\u002Fviz.html`. Flags:\n\n| Flag           | Default                | Description                                 |\n|----------------|------------------------|---------------------------------------------|\n| `--bundle`     | *(required)*           | Bundle root directory.                      |\n| `--out`        | `\u003Cbundle>\u002Fviz.html`    | Output HTML path.                           |\n| `--name`       | bundle directory name  | Display name shown in the viewer header.    |\n\nExample, writing the output somewhere else and overriding the header:\n\n```\n.venv\u002Fbin\u002Fpython -m reference_agent visualize \\\n    --bundle .\u002Fbundles\u002Fcrypto_bitcoin \\\n    --out \u002Ftmp\u002Fbtc.html \\\n    --name \"Bitcoin OKF\"\n```\n\n### How it's built\n\nThe HTML embeds the bundle as a JSON blob and uses\n[Cytoscape.js](https:\u002F\u002Fjs.cytoscape.org\u002F) for the graph and\n[marked](https:\u002F\u002Fmarked.js.org\u002F) for in-browser markdown rendering,\nboth loaded from a CDN. No data leaves the page; the bundle is parsed\nonce at generation time and serialized into the file.\n\n## Tests\n\n```\n.venv\u002Fbin\u002Fpytest\n```\n","Open Knowledge Format（OKF）是一种通用、厂商中立的知识表示格式，采用纯文本 Markdown 文件配合 YAML 前置元数据，以目录结构组织知识资产。其核心特点是人类可读、机器可解析、天然支持 Git 版本控制、无需专用 SDK 或服务依赖，同时兼顾结构化字段（如 type、tags、status）与非结构化内容（如文档说明、示例查询）。适用于数据治理、AI 代理知识库构建、元数据标准化导出、LLM 上下文注入及跨平台知识共享等场景，尤其适合需规避厂商锁定、强调协作审查与长期可维护性的工程化知识管理实践。","2026-11-24 04:47:57","high_star"]