Skip to main content

kb-artifacts

CI PyPI Python: >=3.10 License: MIT

kb-artifacts is a small Python library and CLI for inspecting, filtering, selecting, and reproducibly exporting records from JSONL evidence collections.

What it does

  • Reads newline-delimited JSON without modifying the source files.
  • Accepts common fields including title, text, content, summary, tags, timestamps, and nested meta values.
  • Filters records by tags, fields, dates, text, family, and maturity.
  • Supports explicit, nested JSON query expressions and deterministic corpus describe/facet/count/sample operations.
  • Resolves optional local corpus profiles without exposing their filesystem globs in normal agent-facing output.
  • Writes the same selection as JSONL, CSV, readable Markdown, and a provenance manifest.

Install

python -m pip install kb-artifacts
kb-artifact --help

Python 3.10 or newer is required.

60-second example

Create a two-record JSONL collection:

cat > evidence.jsonl <<'EOF'
{"title":"Deploy app","text":"Build and deploy the service","tags":["runbook","ops"]}
{"title":"Buy groceries","text":"Milk and bread","tags":["personal"]}
EOF

Select the runbook record:

kb-artifact select \
  --chunk-glob evidence.jsonl \
  --tag runbook \
  --output selected

The command reports selected=1 and creates:

selected/
├── selected.jsonl
├── selected.csv
├── artifact.md
└── manifest.json

selected.jsonl is the machine-readable selection, selected.csv is convenient for spreadsheets, artifact.md is readable output, and manifest.json records the request, input checksum, counts, and generated files.

Python API

from kb_artifacts import SelectionRequest, select

request = SelectionRequest(
    chunk_globs=("evidence.jsonl",),
    tags=("runbook",),
)

result = select(request, output="selected-python")
print(result["counts"]["selected"])  # 1

The supported public API for 0.2 preserves the original contracts and adds the typed query, corpus-exploration, and profile-loading boundary documented on the Python API documentation page. See the runnable offline agent example for the progressive discovery-to-selection workflow.

CLI

Inspect bounded source metadata without including record bodies:

kb-artifact inspect source \
  --chunk-glob evidence.jsonl \
  --output source-report.json

Use kb-artifact --help, kb-artifact select --help, or kb-artifact corpus --help for all options. Repeated tags use OR semantics; different filter types must all match.

Documentation / development

The documentation covers selection, provenance, operational guarantees, and interoperability. Runnable examples live in examples/.

For a development checkout:

python -m pip install -e '.[dev,docs]'
make test
make smoke
make distribution-test

make distribution-test builds both distribution formats, installs the wheel into an isolated temporary environment, verifies the public imports, runs the installed CLI help, and selects the minimal example outside the source checkout.

Source code and issues are hosted on GitHub. See CONTRIBUTING.md before proposing a change, CHANGELOG.md for user-visible changes, and SECURITY.md for private vulnerability reporting.

Metadata

Release files for kb-artifacts 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kb-artifacts 0.2.0
File Size Uploaded
kb_artifacts-0.2.0.tar.gz 38.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kb-artifacts 0.2.0
File Interpreter ABI Platform
kb_artifacts-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.8 kB

Release files / kb_artifacts-0.2.0.tar.gz

Download URL kb_artifacts-0.2.0.tar.gz
Size 38.0 kB
Tags Source
SHA-256 checksum
How to use checksums
66009ddb0abbe9f7558427688defc65a087ec8d48e9e5790b700c91e4284f183
BLAKE2b-256 checksum
How to use checksums
857955ff56686d94107467853605fb7cf90c4f012e1e6f51df9f7f8114dff83f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release files / kb_artifacts-0.2.0-py3-none-any.whl

Download URL kb_artifacts-0.2.0-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da39f60a40003aea1d27f225fe8c31c5aa301b92ee6b95100dea2e6b6ec67a1f
BLAKE2b-256 checksum
How to use checksums
7c31b4293ff877f4daea7e6e5687cd2bd70dd46cb5c1c599acf0c11851bce161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page