Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knowledge Compiler SDK

Compile any structured dataset into a static, fully agent-discoverable knowledge site. Zero runtime inference — every node becomes a static HTML page readable by any LLM agent, crawler, or person with a plain HTTP GET and no JavaScript. Discoverability (llms.txt, sitemap.xml, robots.txt, schema.org JSON-LD) is baked in.

"Intelligence is not the model. Intelligence is the accumulated decisions that shaped the model." This SDK is the compile-time end of that idea: your knowledge, compiled into an artifact, not served by a runtime LLM.

Why

This SDK was extracted from three shipped production sitesk8s-docs-compiler, chatgpt-compile, and skce-explorer — after learning, the hard way, exactly what it takes to make a compiled corpus:

  1. Readable with JS disabled — server-render every route at build time; never ship a useEffect(fetch) shell.
  2. Discoverable by agentsllms.txt + sitemap.xml + robots.txt + WebSite/DataCatalog/TechArticle JSON-LD, all cross-linked.
  3. Deployable without foot-guns — archive deploys, canonical project targeting, and CDN cache purging are handled for you.

Every one of those lessons is encoded in the CLI and template.

Quickstart

npm i -g @kliewerdaniel/discoverable-knowledge-sdk

kc init my-kb && cd my-kb
npm install
# replace public/dataset.json with your graph; edit site.config.json
kc validate .      # deterministic sanity check — run FIRST
kc build .         # static export -> out/
kc verify out      # assert 0 "Loading" shells, discoverability files present
kc deploy .        # Vercel: archive deploy + cache purge + live verify

The data contract

Two files drive everything:

  • public/dataset.json — your { version, nodes, edges } graph. A node needs id + type; optionally title, summary, body, tags, provenance, derived_by, confidence. An edge is { from_id, to_id, type, label?, confidence? }.
  • site.config.json — maps node types → URL sections, plus site metadata (name, description, baseUrl, project, author, keywords, related).

Change those two files and you can compile any domain — Kubernetes docs, a ChatGPT export, a research corpus, a product catalog, your notes.

See AGENTS.md for the full playbook a coding agent can follow end-to-end.

CLI

Command What it does
kc init <dir> Scaffold a new site (generic Next.js template + example data).
kc validate [dir] Deterministic graph+config checks (dup ids, slug collisions, orphan types, dangling edges). Run first.
kc build [dir] Validates, then next build → static export in out/.
kc verify <url|dir> Asserts every route is JS-free readable (no Loading shells) + discoverability files exist.
kc deploy [dir] Deploys out/ to Vercel with --archive=tgz --project <name>, purges CDN cache, verifies the live alias.

How it works

The template is one generic, data-driven Next.js app (output: 'export'). At build time it reads dataset.json + site.config.json from disk (Node fs, inside server components) and uses generateStaticParams to emit:

  • one static page per node at /<section>/<slug>/,
  • one server-rendered index per section at /<section>/,
  • a home dashboard, an /about, and a /search (full server-rendered index + optional client-side live filter island),
  • sitemap.xml enumerating everything,
  • and (via a prebuild hook) llms.txt, robots.txt, index.json, and the root JSON-LD.

No per-site code generation. No runtime database. No runtime LLM.

Requirements

  • Node ≥ 18
  • For deploys: the Vercel CLI, authenticated (vercel login).

License

MIT © Daniel Kliewer

About

Compile any dataset into a static, agent-discoverable knowledge site (compile-time AI). Zero runtime inference; JS-free readable; llms.txt + sitemap + JSON-LD baked in.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages