Skip to main content

kbforge

CI Python 3.12+ License: MIT

Agent-first knowledge bases, forged from your systems of record.

The Open Knowledge Format (OKF) v0.1 standardizes the artifact at rest — markdown concept files, frontmatter, index.md, log.md. It says nothing about how those bundles get produced: how you pull from a wiki or a CMDB, how you tell a real change from an export timestamp jittering, how a claim stays traceable to its source, and how an update reaches main without a human losing an afternoon to review.

kbforge is the missing half — the production protocol.

Layer Standardized by
Artifact format OKF v0.1
Production protocol — connectors, canonicalization, diff, provenance, publish kbforge
Serving protocol MCP

"Agent-first" is a checkable claim, not a downstream hope. kbforge stays a producer — the agent connects over MCP, which kbforge doesn't own — but every publish is gated on four agent-facing artifact laws (facet well-formedness, link resolvability, anchor presence, freshness legibility), plus a projection↔files coherence check so nothing ships unvalidated. That gate is what puts the frontmatter, links, and provenance an agent's serving layer needs into the artifact. What each law enforces at full versus reduced strength (and the paths to full strength) is spelled out honestly in architecture.md §4.4 and the artifact-contract spec §5.1.

Status

Alpha — a working walking skeleton. The deterministic pipeline runs end to end with no credentials and no LLM: two built-in connectors (local_files, git_commits), canonicalization with a stability law, a replay-safe mirror and diff, a stub synthesizer, the §4.4 validator gate, and a dry-run publisher. Change detection, the no-op rule, and incremental sync via a real cursor are exercised by the test suite.

Not built yet: a real LLM synthesizer (the current one copies source text verbatim), a credentialed system-of-record connector, and a GitHub-PR publisher. See docs/architecture.md for the full map.

Quickstart

pip install kbforge
kbforge list                       # show available connectors

kbforge run \
  --connector local_files \
  --set path=./docs \
  --mirror .kbforge/mirror --out .kbforge/out --state .kbforge/state

Re-running with no source change is a no-op — no merge request is opened. Point --connector git_commits --set repo=. at a git repository to sync commit history incrementally instead. Config values are YAML-typed, so --set max_commits=50 is an integer and --set 'ignore_globs=[drafts]' is a list.

Design stance

The core ships zero credentialed connectors and zero CI logic. The two built-in connectors need no credentials and serve as references; real systems of record are plugins, discovered through the kbforge.connectors (and kbforge.publishers) entry-point group without editing kbforge — deployments are separate, private repositories. The interface is the product.

# in a third-party package's pyproject.toml — discovered automatically once installed
[project.entry-points."kbforge.connectors"]
myservice = "my_package:connector"

The pipeline order — fetch → normalize → mirror → diff → scope → synthesize → validate → publish — is deliberately not pluggable, and neither are the no-op rule or the never-auto-merge rule. Those are the trust guarantees; making them pluggable would make them optional. Plugins extend stages. They cannot reorder or remove them.

Documentation

Related projects

kbforge is one of three contracts for agents, split by seam:

  • ai-agent-contracts — the formal spine: resource, temporal, and lifecycle contracts (the seven-tuple kbforge maps onto).
  • agentic-data-contracts — the consumption half for structured data: domain-driven governance enforced at query time. kbforge is the production half for unstructured knowledge; both independently converged on making freshness legible to the agent.

Development

uv sync --all-extras --dev   # create the venv and install
prek install                 # ruff + ty on every commit
uv run pytest

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kbforge-0.1.0.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kbforge-0.1.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file kbforge-0.1.0.tar.gz.

File metadata

  • Download URL: kbforge-0.1.0.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for kbforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41d7a7f268ad9b28d355819a4e842196640f4bfada68921b3ef39a3b3692bfe2
MD5 8ec23997ccfa657ced31ce58763dbf10
BLAKE2b-256 ad31f75599cc57c16d36b928ab35fb8c27d19367f4a4a315226ea156b3821d9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for kbforge-0.1.0.tar.gz:

Publisher: ci.yml on flyersworder/kbforge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kbforge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kbforge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for kbforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ab4c1a1092f8fdb0fa0aa0b3df059290009d682a28e50c24ed8be1e9da696d
MD5 d51b9efd4041a969c69d01d2a730bd55
BLAKE2b-256 2dd2fc79974e43185171aa291046738a196632cfff2919a5504fdea34e6e80ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for kbforge-0.1.0-py3-none-any.whl:

Publisher: ci.yml on flyersworder/kbforge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page