Skip to main content

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, and optional retention 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


Download files

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

Source Distribution

cognoxium-0.1.1.tar.gz (63.7 kB view details)

Uploaded Source

Built Distributions

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

cognoxium-0.1.1-cp310-abi3-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

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

Hashes for cognoxium-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5b4ea9d67c4df992beceb4e027460a8ef4456fa5226392600b87066c0ad2ccad
MD5 d5d5b831eb54806fb187e3ec944c040e
BLAKE2b-256 abbbe3cbce5490175604209f89cb899593330f28cd0a996a6c5f37948397a2bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognoxium-0.1.1.tar.gz:

Publisher: release.yml on Nue-Japan/cognoxium

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

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

Hashes for cognoxium-0.1.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c99f320ca35bf621c9ae0be4d08deb40e56dd1de2b2143633fbd79999e9dd9d4
MD5 8b7f2616daefc21fcb90dad42102e611
BLAKE2b-256 e02b1a13542b413d487e81b7a999f569468377d2bec35f1c4c12c1c90becfc91

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognoxium-0.1.1-cp310-abi3-win_amd64.whl:

Publisher: release.yml on Nue-Japan/cognoxium

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

File details

Details for the file cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cognoxium-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b33a65480267f68aa873f45f3e3dd86f05283ce2804d4148fd0c028204224e59
MD5 6ba6472771f1c1397e01fc5351b0491d
BLAKE2b-256 4e05f1fb87dc93d5ce0b9ebbfa2a35728a7a4629eff9613d9cfa1bbe616b63db

See more details on using hashes here.

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

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

File details

Details for the file cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cognoxium-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4c02aa6ba23604f50465495efd3cb1d87cd99eef9bb548f6db84fcc1f90594c8
MD5 1b7716ee13f686dc2cdc6cff6f62e386
BLAKE2b-256 a81927e42473d0ad935d9142d4e6f65c0a73986d16fcecff53faa018d461371e

See more details on using hashes here.

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

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

File details

Details for the file cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cognoxium-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82240693a43630327fe12a503848ade9f46a07d01270f57135dfbb2da811464c
MD5 96011ac534c830cfbe52dfecc68c78a2
BLAKE2b-256 7c1faccf617d8641276d2368055c0631e144d5930804490b42096c99ee6e062c

See more details on using hashes here.

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

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

File details

Details for the file cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for cognoxium-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fcf53239f9d49ab8b19cb77ce2a891d24d85d3a8f7ccb1ee567f9c67bcbcf96c
MD5 080845ad5310dc9c6a4ec6208969037a
BLAKE2b-256 968196f81a5e9ea6af828910fbabdabff37634209646c835beccfea5ae7c3ee2

See more details on using hashes here.

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

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 Pingdom Monitoring Sentry Error logging StatusPage Status page