Metadata-Version: 2.4
Name: akf
Version: 1.4.0
Summary: AKF — Agent Knowledge Format. Lightweight file format for AI-generated knowledge with built-in trust, provenance, and security.
Author: AKF Contributors
License: MIT
Project-URL: Homepage, https://akf.dev
Project-URL: Repository, https://github.com/HMAKT99/AKF
Project-URL: Documentation, https://akf.dev
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.0
Requires-Dist: click>=8.0
Provides-Extra: docx
Requires-Dist: python-docx>=0.8; extra == "docx"
Provides-Extra: xlsx
Requires-Dist: openpyxl>=3.1; extra == "xlsx"
Provides-Extra: pptx
Requires-Dist: python-pptx>=0.6; extra == "pptx"
Provides-Extra: pdf
Requires-Dist: pypdf>=3.0; extra == "pdf"
Provides-Extra: image
Requires-Dist: Pillow>=10.0; extra == "image"
Provides-Extra: office
Requires-Dist: python-docx>=0.8; extra == "office"
Requires-Dist: openpyxl>=3.1; extra == "office"
Requires-Dist: python-pptx>=0.6; extra == "office"
Provides-Extra: report
Requires-Dist: fpdf2>=2.7; extra == "report"
Provides-Extra: crypto
Requires-Dist: cryptography>=42.0; extra == "crypto"
Provides-Extra: all
Requires-Dist: python-docx>=0.8; extra == "all"
Requires-Dist: openpyxl>=3.1; extra == "all"
Requires-Dist: python-pptx>=0.6; extra == "all"
Requires-Dist: pypdf>=3.0; extra == "all"
Requires-Dist: Pillow>=10.0; extra == "all"
Requires-Dist: cryptography>=42.0; extra == "all"
Requires-Dist: fpdf2>=2.7; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pyyaml; extra == "dev"

# AKF — Agent Knowledge Format (Python SDK)

[![PyPI](https://img.shields.io/pypi/v/akf)](https://pypi.org/project/akf/)
[![Python](https://img.shields.io/pypi/pyversions/akf)](https://pypi.org/project/akf/)

Lightweight file format for AI-generated knowledge with built-in trust, provenance, and security.

## Install

```bash
pip install akf
```

> **`akf` command not found?** Use `python3 -m akf` (always works), or:
> - Install with pipx: `pipx install akf` (recommended — auto-handles PATH)
> - macOS: add `export PATH="$HOME/Library/Python/3.9/bin:$PATH"` to `~/.zshrc`
> - Linux: add `export PATH="$HOME/.local/bin:$PATH"` to `~/.bashrc`

## Usage

```python
import akf

# Create a single-claim unit
unit = akf.create("Revenue $4.2B", t=0.98, src="SEC 10-Q", tier=1)
unit.save("report.akf")

# Load and validate
unit = akf.load("report.akf")
result = akf.validate(unit)

# Builder API
unit = (akf.AKFBuilder()
    .by("sarah@woodgrove.com")
    .label("confidential")
    .claim("Revenue $4.2B", 0.98, src="SEC 10-Q", tier=1, ver=True)
    .claim("Cloud growth 15%", 0.85, src="Gartner", tier=2)
    .build())

# Trust computation
for claim in unit.claims:
    result = akf.effective_trust(claim)
    print(f"{result.decision}: {result.score:.2f}")

# Agent consumption
brief = (akf.AKFTransformer(unit)
    .filter(trust_min=0.5)
    .penalty(-0.03)
    .by("research-agent")
    .build())
```

## CLI

```bash
akf create report.akf --claim "Revenue $4.2B" --trust 0.98
akf validate report.akf
akf inspect report.akf
akf trust report.akf
akf consume report.akf --output brief.akf --threshold 0.6
akf provenance report.akf
```
