A trustworthy context DataFrame for AI applications, powered by Rust.
Project description
Cognoxium
日本語 · Documentation · Security · PyPI
Cognoxium is a local-first, Rust-powered DataFrame for building trustworthy AI context.
LLM applications usually concatenate messages, retrieved documents, and tool results just before a model call. That makes provenance, retention requirements, token-budget decisions, and exclusions difficult to inspect. Cognoxium turns those inputs into typed ContextItem records, applies immutable transformations, and produces a provider-neutral ContextPack with a machine-readable manifest.
Status: alpha (0.1.1). The public Python API is usable today. Rust powers canonical hashing and native tokenization in binary wheels; frame planning currently runs in Python. Serialized compatibility is not guaranteed before 1.0. See the current limitations.
Install
The recommended project workflow uses uv 0.12.1. The documented uv workflow requires that version; use the pip path below if uv is not available:
uv add cognoxium
pip remains supported:
python -m pip install cognoxium
Optional integrations are installed separately, for example uv add "cognoxium[arrow]" or python -m pip install "cognoxium[arrow]". See the installation guide for every extra and source-build requirements.
Quickstart
import cognoxium as cx
frame = cx.CognitionFrame.from_records([
{"id": "policy", "payload": "Never disclose credentials.", "role": "system",
"sources": ["app://policy"], "trust": "trusted", "retention": "required",
"created_at": "2026-01-01T00:00:00Z"},
{"id": "result", "payload": "The build passed.", "role": "tool",
"sources": ["tool://ci"], "retention": "preferred",
"created_at": "2026-01-01T00:01:00Z"},
])
pack = frame.dedupe().rank("build status").pack(
budget=512,
token_profile=cx.profiles.approximate(),
boundary=cx.Boundary.external("openai"),
)
print(pack.to_text())
print([item["id"] for item in pack.manifest.selected])
Output:
[system] Never disclose credentials.
[tool] The build passed.
['policy', 'result']
The selected items can be rendered with pack.to_openai(), pack.to_anthropic(), or pack.to_text(). Inspect pack.manifest to learn exactly what was selected, excluded, merged, or truncated.
Why Cognoxium?
- DataFrame ergonomics: immutable filtering, projection, joins, grouping, ranking, and exact deduplication.
- Budget contracts:
required,preferred, andoptionalretention with explicit overflow recovery. - Trust boundaries: provenance, quarantine, sensitivity, expiry, and conservative secret-pattern checks before external packing.
- Auditable lineage: selections, exclusions, dedupe decisions, metadata conflicts, token costs, and truncations are recorded.
- Provider-neutral output: make selection and policy decisions before choosing an SDK renderer.
- Local by default: no network client, model call, API-key handling, account, or telemetry in the core library.
Cognoxium complements rather than replaces a retriever, vector database, agent framework, authorization layer, or model SDK. If you already use pandas, start with Cognoxium for pandas users.
Security scope
Cognoxium enforces deterministic information-flow rules; it does not prove content is truthful, authorize tool calls, or guarantee prompt-injection prevention. In particular, untrusted content is labeled but is not automatically blocked when it has provenance. Use quarantine() or a custom Policy when your application must reject it. Read the security model before packing sensitive data.
Development
uv sync --extra dev
uv run maturin develop
uv run pytest
cargo test --workspace --locked
Development commands are validated with uv 0.12.1. See CONTRIBUTING.md and the contributor documentation.
License
Licensed under the Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognoxium-0.1.1.tar.gz.
File metadata
- Download URL: cognoxium-0.1.1.tar.gz
- Upload date:
- Size: 63.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b4ea9d67c4df992beceb4e027460a8ef4456fa5226392600b87066c0ad2ccad
|
|
| MD5 |
d5d5b831eb54806fb187e3ec944c040e
|
|
| BLAKE2b-256 |
abbbe3cbce5490175604209f89cb899593330f28cd0a996a6c5f37948397a2bb
|
Provenance
The following attestation bundles were made for cognoxium-0.1.1.tar.gz:
Publisher:
release.yml on Nue-Japan/cognoxium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognoxium-0.1.1.tar.gz -
Subject digest:
5b4ea9d67c4df992beceb4e027460a8ef4456fa5226392600b87066c0ad2ccad - Sigstore transparency entry: 2333486823
- Sigstore integration time:
-
Permalink:
Nue-Japan/cognoxium@b164769adb1a1209077d0089a43a1511e5e5854a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Nue-Japan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b164769adb1a1209077d0089a43a1511e5e5854a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cognoxium-0.1.1-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: cognoxium-0.1.1-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c99f320ca35bf621c9ae0be4d08deb40e56dd1de2b2143633fbd79999e9dd9d4
|
|
| MD5 |
8b7f2616daefc21fcb90dad42102e611
|
|
| BLAKE2b-256 |
e02b1a13542b413d487e81b7a999f569468377d2bec35f1c4c12c1c90becfc91
|
Provenance
The following attestation bundles were made for cognoxium-0.1.1-cp310-abi3-win_amd64.whl:
Publisher:
release.yml on Nue-Japan/cognoxium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognoxium-0.1.1-cp310-abi3-win_amd64.whl -
Subject digest:
c99f320ca35bf621c9ae0be4d08deb40e56dd1de2b2143633fbd79999e9dd9d4 - Sigstore transparency entry: 2333486859
- Sigstore integration time:
-
Permalink:
Nue-Japan/cognoxium@b164769adb1a1209077d0089a43a1511e5e5854a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Nue-Japan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b164769adb1a1209077d0089a43a1511e5e5854a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b33a65480267f68aa873f45f3e3dd86f05283ce2804d4148fd0c028204224e59
|
|
| MD5 |
6ba6472771f1c1397e01fc5351b0491d
|
|
| BLAKE2b-256 |
4e05f1fb87dc93d5ce0b9ebbfa2a35728a7a4629eff9613d9cfa1bbe616b63db
|
Provenance
The following attestation bundles were made for cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on Nue-Japan/cognoxium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
b33a65480267f68aa873f45f3e3dd86f05283ce2804d4148fd0c028204224e59 - Sigstore transparency entry: 2333486829
- Sigstore integration time:
-
Permalink:
Nue-Japan/cognoxium@b164769adb1a1209077d0089a43a1511e5e5854a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Nue-Japan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b164769adb1a1209077d0089a43a1511e5e5854a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c02aa6ba23604f50465495efd3cb1d87cd99eef9bb548f6db84fcc1f90594c8
|
|
| MD5 |
1b7716ee13f686dc2cdc6cff6f62e386
|
|
| BLAKE2b-256 |
a81927e42473d0ad935d9142d4e6f65c0a73986d16fcecff53faa018d461371e
|
Provenance
The following attestation bundles were made for cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on Nue-Japan/cognoxium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
4c02aa6ba23604f50465495efd3cb1d87cd99eef9bb548f6db84fcc1f90594c8 - Sigstore transparency entry: 2333486841
- Sigstore integration time:
-
Permalink:
Nue-Japan/cognoxium@b164769adb1a1209077d0089a43a1511e5e5854a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Nue-Japan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b164769adb1a1209077d0089a43a1511e5e5854a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82240693a43630327fe12a503848ade9f46a07d01270f57135dfbb2da811464c
|
|
| MD5 |
96011ac534c830cfbe52dfecc68c78a2
|
|
| BLAKE2b-256 |
7c1faccf617d8641276d2368055c0631e144d5930804490b42096c99ee6e062c
|
Provenance
The following attestation bundles were made for cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on Nue-Japan/cognoxium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl -
Subject digest:
82240693a43630327fe12a503848ade9f46a07d01270f57135dfbb2da811464c - Sigstore transparency entry: 2333486868
- Sigstore integration time:
-
Permalink:
Nue-Japan/cognoxium@b164769adb1a1209077d0089a43a1511e5e5854a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Nue-Japan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b164769adb1a1209077d0089a43a1511e5e5854a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcf53239f9d49ab8b19cb77ce2a891d24d85d3a8f7ccb1ee567f9c67bcbcf96c
|
|
| MD5 |
080845ad5310dc9c6a4ec6208969037a
|
|
| BLAKE2b-256 |
968196f81a5e9ea6af828910fbabdabff37634209646c835beccfea5ae7c3ee2
|
Provenance
The following attestation bundles were made for cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on Nue-Japan/cognoxium
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl -
Subject digest:
fcf53239f9d49ab8b19cb77ce2a891d24d85d3a8f7ccb1ee567f9c67bcbcf96c - Sigstore transparency entry: 2333486851
- Sigstore integration time:
-
Permalink:
Nue-Japan/cognoxium@b164769adb1a1209077d0089a43a1511e5e5854a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Nue-Japan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b164769adb1a1209077d0089a43a1511e5e5854a -
Trigger Event:
push
-
Statement type: