kno

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0

README

Kno

Kno measures the marginal value of every data asset you're considering feeding an LLM agent — then tells you which ones earn their place, what they cost, and where each belongs: context, knowledge base, or fine-tuning set.

Most teams curate agent data by intuition and dump the rest into JSONL. Kno replaces the guess with a measurement. It runs your agent against your evals, injects each candidate asset, re-runs the affected slice against untouched controls, and reports the delta with a confidence interval — ranked by improvement per dollar, validated as a portfolio against a holdout you never touched. Assets that do nothing get rejected with a reason. Failure modes nothing in your pool can fix get flagged as data you should start collecting.

Single Go binary. No infra. Works with any OpenAI-compatible endpoint, Anthropic, or your own agent behind a shell command.

Status: early. Of the five stages, only baseline runs today. The default agent is a local fake that costs nothing, so you can see the whole loop work before pointing it at something that bills you. See Status for what exists.

Install

curl -sSfL https://raw.githubusercontent.com/knograph/kno/main/install.sh | sh

The script picks the right build for your platform, verifies the SHA-256 checksum, verifies the cosign signature if you have cosign installed, and drops the binary on your PATH. It is short and worth reading before you pipe it anywhere.

Or take the archive yourself from Releases — macOS, Linux and Windows, amd64 and arm64. Or build from source:

go install github.com/knograph/kno/cmd/kno@latest

A go install binary reports the module version with no commit or date — kno version v0.0.1. A released binary reports both — kno version v0.0.1 (a1b2c3d, 2026-08-26T…). The parenthetical is how you tell them apart in a bug report, and it is the only functional difference.

Verifying a download

Every release ships a checksums.txt, a keyless cosign signature over it, an SPDX SBOM per archive, and SLSA build provenance. There is no private signing key — so there is none to steal.

cosign verify-blob checksums.txt \
  --certificate checksums.txt.pem --signature checksums.txt.sig \
  --certificate-identity-regexp '^https://github\.com/knograph/kno/\.github/workflows/release\.yml@refs/tags/.+$' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

grep " kno_0.0.1_darwin_arm64.tar.gz$" checksums.txt | shasum -a 256 -c -

gh attestation verify kno_0.0.1_darwin_arm64.tar.gz --repo knograph/kno \
  --signer-workflow knograph/kno/.github/workflows/release.yml

Both identity flags are the part that matters. Without --certificate-identity-regexp, verify-blob accepts a valid signature from anyone; without --signer-workflow, attestation verify accepts an attestation from any workflow in the repository. The checksum line is written with grep+shasum rather than sha256sum --ignore-missing because macOS ships neither.

Homebrew is coming: the formula is written and the tap repository is not created yet (docs/debt.md#73).

Quickstart

Write some Cases — one scoreable interaction per line, each with a stable id:

{"id":"refund-01","input":"How do I get a refund?","expected":"Refunds are processed within 5 business days."}
{"id":"ship-01","input":"When does my order ship?","expected":"Orders ship within 1 business day."}

Run it:

kno baseline --evals cases.jsonl
Baseline 20260821T091515-ffc3097d49da
  cases      44 scored, 0 errored (of 44 dev; 6 held back)
  score      1.000
  spent      $0.00 over 44 call(s)
  status     completed

  warning: the holdout has only 6 cases, too few for a meaningful confidence interval at validate

Scores and traces are recorded. `kno purge` removes trace content when you no longer need it.

6 held back is the holdout. Nothing reads it — not this run, not valuation, not selection — until validate. That constraint is the reason any number Kno reports later means anything. Why.

The score reads 1.000 because fake: answers every Case with what the Case expects. That is the point of it: the quickstart proves the loop runs, is scored against a declared Goal, costs nothing, and seals a holdout — not that any agent is perfect. Point it at a real provider and the number starts meaning something.

That run used fake:, the local agent that costs nothing. Pointing it at a real provider is one flag:

export OPENAI_API_KEY=sk-...
kno baseline --evals cases.jsonl --agent openai:gpt-4.1 --max-cost-usd 2.00

Keys come from the environment, never from a flag. Kno prices each Case from its own table, so the cap binds before the call rather than at settlement. kno doctor prints which providers, models, and goals this build supports — it contacts nothing.

Full walkthrough: Score your agent for the first time, then Point Kno at your own provider.

Three properties worth knowing up front

Every reported delta carries a confidence interval, or it isn't reported. A number without its uncertainty is a number that flatters you. What the numbers mean.

Nothing spends your money silently. Every path that can call a provider goes through a budget guard: estimate, confirm, checkpoint. Caps are enforced before the call, not discovered at settlement.

Interrupting is boring. Work is checkpointed as each Case completes, in one transaction with its result. --resume skips what's finished and reconstructs prior spend from disk, so an interrupted run cannot pay twice.

Your traces stay yours, and nothing expires on its own. Runs are stored locally in SQLite, including the agent's output — which is conversation content if your evals come from production logs. Kno itself sends nothing anywhere — there is no telemetry of content, ever. Your Cases go to whatever provider you point Kno at, and that provider's retention is theirs. kno purge deletes it when you decide to, keeping the scores and costs so the run stays resumable. Retention, in full.

Exit codes

A CI gate branches on these, so they're a contract rather than an afterthought.

Code Meaning What CI should do
0 Completed Continue
1 Failed Fail the build — something is broken
2 Stopped at a budget cap Not a failure. The run did what you configured
3 Validation failed Fail the build — the deploy gate (reserved for kno validate)
4 Interrupted by a signal or deadline Not a failure. Resume it

2 and 4 both leave a resumable run. Reporting either as 1 would train people to ignore 1, which is the code that actually means something is wrong. Recipe: Gate a deploy on Kno in CI.

Status

Stage What it does State
Baseline Run the agent over the dev Cases, score against the Goal, persist every result Shipped
Value Route each Asset to the slices it could affect, inject, re-run against controls, record Δ with an interval Shipped
Select Build a Portfolio under budget, with a rejection log Planned
Validate Measure the Portfolio as a set against the untouched holdout Planned
Export Training set, report, and the gaps nothing in your pool could fix Planned

Provider adapters are shipped: openai: (and any OpenAI-compatible endpoint via --base-url), anthropic:, and fake:. exec: and tuned: arrive with the stages that need them.

Documentation

License

Apache-2.0.

Directories

Path Synopsis
Package adapters holds Ring-1 connectors: curated, in-tree, compiled into the binary, and carrying the quality bar of tests, recorded fixtures, and docs.
Package adapters holds Ring-1 connectors: curated, in-tree, compiled into the binary, and carrying the quality bar of tests, recorded fixtures, and docs.
agent
Package agent adapts anything invokable on a Case: openai-compatible (one base_url-configurable adapter covering OpenAI, Together, Fireworks, Groq, vLLM, and Ollama), anthropic, http, and shell.
Package agent adapts anything invokable on a Case: openai-compatible (one base_url-configurable adapter covering OpenAI, Together, Fireworks, Groq, vLLM, and Ollama), anthropic, http, and shell.
agent/agentref
Package agentref parses the string that names an agent.
Package agentref parses the string that names an agent.
agent/anthropic
Package anthropic is the Agent adapter for Anthropic's Messages API.
Package anthropic is the Agent adapter for Anthropic's Messages API.
agent/fake
Package fake is a deterministic Agent that costs nothing.
Package fake is a deterministic Agent that costs nothing.
agent/internal/agenterr
Package agenterr carries adapter-side facts that core reads without importing an adapter.
Package agenterr carries adapter-side facts that core reads without importing an adapter.
agent/internal/transport
Package transport is the shared HTTP layer every provider adapter sits on.
Package transport is the shared HTTP layer every provider adapter sits on.
agent/openaicompat
Package openaicompat is the adapter for the OpenAI Chat Completions shape.
Package openaicompat is the adapter for the OpenAI Chat Completions shape.
agent/pricing
Package pricing holds what each model costs, and turns that into the pessimistic estimate the budget guard reserves against.
Package pricing holds what each model costs, and turns that into the pessimistic estimate the budget guard reserves against.
evals
Package evals supplies scoreable Cases — the exam.
Package evals supplies scoreable Cases — the exam.
evals/jsonl
Package jsonl reads eval Cases from a JSON Lines file.
Package jsonl reads eval Cases from a JSON Lines file.
pool
Package pool supplies candidate Assets — the study material.
Package pool supplies candidate Assets — the study material.
pool/jsonl
Package jsonl reads candidate Assets from a JSON Lines file.
Package jsonl reads candidate Assets from a JSON Lines file.
tuner
Package tuner submits and tracks fine-tuning jobs on hosted APIs: openai, together, fireworks.
Package tuner submits and tracks fine-tuning jobs on hosted APIs: openai, together, fireworks.
Package api serves the connect-rpc API — gRPC and REST from one proto definition on one port, with SSE for the event stream.
Package api serves the connect-rpc API — gRPC and REST from one proto definition on one port, with SSE for the event stream.
Package bridge connects in-context measurements to fine-tuning outcomes.
Package bridge connects in-context measurements to fine-tuning outcomes.
Package cli is the kno binary, built on fang over cobra.
Package cli is the kno binary, built on fang over cobra.
cmd
kno command
Command kno measures which data assets earn their place in an LLM agent.
Command kno measures which data assets earn their place in an LLM agent.
Package core is the Kno engine: the five pipeline stages (Baseline, Value, Select, Validate, Export) and the Ring-0 contracts every adapter implements.
Package core is the Kno engine: the five pipeline stages (Baseline, Value, Select, Validate, Export) and the Ring-0 contracts every adapter implements.
errs
Package errs defines Kno's error grammar.
Package errs defines Kno's error grammar.
value
Package value decides which Cases measure which Assets, and what that will cost, before any money is spent.
Package value decides which Cases measure which Assets, and what that will cost, before any money is spent.
Package coretest provides the conformance harness every adapter must pass.
Package coretest provides the conformance harness every adapter must pass.
Package executor runs pipeline stages: a bounded goroutine pool with SQLite checkpointing.
Package executor runs pipeline stages: a bounded goroutine pool with SQLite checkpointing.
gen
goal
exactmatch
Package exactmatch scores a Response by exact string equality.
Package exactmatch scores a Response by exact string equality.
internal
cmd/covercheck command
Command covercheck enforces the coverage floors and the no-decrease ratchet that CLAUDE.md requires.
Command covercheck enforces the coverage floors and the no-decrease ratchet that CLAUDE.md requires.
cmd/godoccheck command
Command godoccheck enforces that every exported symbol has a doc comment.
Command godoccheck enforces that every exported symbol has a doc comment.
schema
Package schema holds invariant tests over the generated kno.v1 contract.
Package schema holds invariant tests over the generated kno.v1 contract.
Package judge scores outcomes and routes assets by mechanism, using typed LLM functions defined in judge/baml_src.
Package judge scores outcomes and routes assets by mechanism, using typed LLM functions defined in judge/baml_src.
Package observe carries Kno's tracing vocabulary.
Package observe carries Kno's tracing vocabulary.
Package plugin implements Ring 2: the exec plugin protocol.
Package plugin implements Ring 2: the exec plugin protocol.
Package stats owns everything Kno reports as a number: repeated trials, confidence intervals, the dev/holdout split, and redundancy detection.
Package stats owns everything Kno reports as a number: repeated trials, confidence intervals, the dev/holdout split, and redundancy detection.
budget
Package budget is the spend guard.
Package budget is the spend guard.
interval
Package interval computes confidence intervals on paired differences.
Package interval computes confidence intervals on paired differences.
Package store persists runs, traces, and valuations in SQLite — zero-config for CLI and CI use.
Package store persists runs, traces, and valuations in SQLite — zero-config for CLI and CI use.
Package tui renders the live run dashboard with bubbletea and lipgloss: per-stage progress, spend against budget, cases per second, ETA, and the asset currently under valuation.
Package tui renders the live run dashboard with bubbletea and lipgloss: per-stage progress, spend against budget, cases per second, ETA, and the asset currently under valuation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL