A directory tree of markdown files — the unit of distribution.
| type | Library |
| title | OKF4net |
| description | Zero-dependency .NET implementation of OKF v0.2 |
OKF4net is its .NET toolchain — a zero-dependency C# library and a Native AOT okf CLI to parse, validate, index and graph bundles of concepts.
If you cancata file, you can read OKF; if you cangit clonea repo, you can ship it.
The Open Knowledge Format represents knowledge as a directory of UTF-8 markdown files with YAML frontmatter. No database, no binary format, no runtime — files that humans, git, and agents already understand.
A directory tree of markdown files — the unit of distribution.
One document: YAML frontmatter delimited by ---, then a markdown body.
The file's path with .md removed: tables/users.md → tables/users.
Ordinary markdown links between concepts — absolute or relative; backlinks derived.
The only hard conformance requirement (§11): a non-empty type on every concept. Everything else — unknown types, unknown keys, broken links — must be tolerated by consumers.
→ what-okf-is.md — reserved files, conformance, and the section-by-section spec mapping
Load a bundle, check conformance, walk the cross-link graph. Bundle.Load never aborts on a bad file — parse failures land in ParseErrors, broken links stay in the graph as edges to missing concepts.
using OKF4net; var bundle = Bundle.Load("./my_bundle"); Console.WriteLine($"{bundle.Count} concepts"); // Conformance check (§11). var report = BundleValidator.Validate(bundle); // Traverse the cross-link graph. var id = ConceptId.Parse("tables/orders"); foreach (var b in bundle.Backlinks(id)) Console.WriteLine($"cited by {b}");
Frontmatter keeps the full ordered mapping with typed getters on top — producer-defined keys survive round-trips byte for byte. Two validation levels: ValidateConformance() enforces only what §11 requires; Validate() matches the stricter producer-side check.
→ library.md — install, examples, design choices · docs/library.md — every member, signature by signature
Published as a self-contained Native AOT single-file binary — no .NET runtime on the target machine. okf validate exits non-zero on a non-conformant bundle, so it drops straight into CI.
| Command | Does |
|---|---|
| okf validate <bundle> | Conformance check (§11), non-zero exit on failure |
| okf info <bundle> | Concepts, types, links, version |
| okf index <bundle> | (Re)generate every index.md (§8) |
| okf graph <bundle> | Cross-link graph, --dot for Graphviz |
| okf parse <file> | One document's structure |
| okf fmt <file> | Normalize by parse + re-serialize (-w writes) |
$ okf validate ./bundles/ga4
42 concept(s); 0 error(s), 0 warning(s), 0 info.
✓ conformant with OKF v0.2
$ okf graph ./bundles/ga4 --dot | dot -Tsvg > graph.svg→ cli.md — building the binary, session transcripts, CI recipes · docs/cli.md — every flag and exit code
OKF4net.Agents turns a bundle into ten AIFunction tools (read, search, write, validate, log, §10 attested computation, …) — an eleventh, okf_run_computation, when an attestation orchestrator is wired in — plus OkfContextProvider, which injects budget-bounded reference data automatically — never as instructions — and, opt-in, captures exchanges as deterministic memory, single-bundle or scoped across tenants, users, and sessions.
→ docs/agents.md — the tools, the context provider, and scoped memory capture
OKF4net.Catalog names one or more local bundles as sources in a hot-reloadable catalog.json manifest and searches every enabled one, ranked by a selectable resolver strategy — grouped by source, merged by score, or priority-weighted, with an optional fairness quota — and with trust and staleness carried on every result. Per-caller source visibility restricts which sources a given caller may search, by a host-precomputed set or a per-source policy function. A role: "memory" source, backed by FileMemoryStore, gives an agent deployment host-scoped, layered memory — session, user, and tenant — without cross-scope leakage.
→ docs/catalog.md — the manifest, the resolver, and scoped memory
Run okf-mcp, point it at a bundle, and its ten operations become tools inside Claude Desktop, Claude Code, and Cursor — read, search, and write concepts from a conversation, over the Model Context Protocol. Same engine as the library and the CLI, exposed to any MCP client.
On Claude Code, skip the manual config: the OKF plugin installs okf-mcp, an okf skill, and guided /okf-init / /okf-validate slash commands in one step — /plugin marketplace add jchable/okf4net-claude-plugin, then /plugin install okf@okf4net.
→ docs/mcp.md — install okf-mcp and connect each client, step by step
One prerequisite: the .NET SDK. Zero third-party runtime dependencies is a design rule — contributions keep it that way. Behavioural changes cite their spec section (§) in the PR; the test suite is the contract.
→ contributing.md — setup, golden fixtures, code style, and how to submit
Star the repo, open an issue, or pick a good first one. The spec is short, the codebase is dependency-free, and the test suite tells you immediately whether you're right.