Skip to main content

Shared knowledge atlas built on PTEX nonce-addressed textures with GF(17) content-hash dedup

Project description

Amni-Prism

PyPI Python License: MIT

Shared knowledge atlas built on PTEX nonce-addressed textures. Every fact gets a unique GF(17) nonce — contribute knowledge, it deduplicates automatically by content hash, and the atlas grows. NDJSON manifests are append-only and git-merge-friendly, so multiple contributors never collide.

Status: alpha (0.1.x). API may shift before 1.0.

Install

pip install amni-prism

For local development:

git clone https://github.com/Amnibro/Amni-Prism
cd Amni-Prism
pip install -e .

Quick Start

import prism

prism.contribute_text('./codex', 'The speed of light is 299792458 m/s', domain='physics')

result = prism.query_text('./codex', 'The speed of light is 299792458 m/s')

hits = prism.search_keyword('./codex', 'speed of light')

CLI

prism contribute "The speed of light is 299792458 m/s" -d physics

prism search "speed of light"

prism propose "Water boils at 100C at sea level" -d physics --confidence 0.8

prism pending
prism verify

prism scrape --file article.txt --source "https://en.wikipedia.org/wiki/Light"

prism stats

How It Works

  1. GF(17) Nonces — Every word/line/block gets a unique nonce in GF(17) finite-field space. Same content → same nonce → automatic dedup. See prism/gf17.py.
  2. PTEX Storage — Knowledge stored as nonce-addressed texture maps. Vocab in NLX format, hierarchical tiers in HNA format. See prism/ptex.py.
  3. Content-Hash Dedup — SHA-256 over normalized content ensures no duplicates across contributors merging different codexes.
  4. Two-Tier Verification — Small models propose (~50 tokens), large models verify (~20 tokens). ~70 tokens per verified fact. See prism/verify.py.
  5. NDJSON Manifests — Append-only JSON-lines manifests are git-merge-friendly. No merge conflicts when two contributors add facts to the same domain.

Domains

25 built-in domains: code, math, science, history, language, music, art, philosophy, psychology, economics, politics, law, medicine, engineering, technology, education, sports, entertainment, food, travel, nature, religion, mythology, literature, general.

Why use this

  • Knowledge that survives model swaps. The atlas is a pile of facts addressed by content, not a fine-tune of a specific model. Swap your LLM tomorrow, keep your atlas.
  • Federation without coordination. Two contributors building independent codexes can prism merge their work and get a deduplicated union, with no central server.
  • Built for the Adam runtime. Amni-Prism is the federated layer of Amni-Ai (Adam). The [federated] extra in Adam pulls this in directly.

Source Allowlist

Scraping is gated to license-compatible sources (Wikipedia, arXiv, RFC, Python docs, MDN, HuggingFace). See prism.scrape.ALLOWED_SOURCES.

Contributing

Fork, clone, pip install -e ., add facts via the CLI or Python API, and open a PR with your codex export. NDJSON manifests merge cleanly under git.

License

MIT — see LICENSE.

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

amni_prism-0.1.1.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

amni_prism-0.1.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file amni_prism-0.1.1.tar.gz.

File metadata

  • Download URL: amni_prism-0.1.1.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for amni_prism-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3aa4a3be12a1a504846c17c4cc3570d5ec725af06b98c2704a0d87b3f3b4a0a2
MD5 95574f6bc98f63c90c690f7df23fc2dc
BLAKE2b-256 568f413a90c3355854798cead3aaec1caaaa416cc630568286d494e71a42f063

See more details on using hashes here.

File details

Details for the file amni_prism-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: amni_prism-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for amni_prism-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 003b515c0d8bc249cb0da592077445cd0395dfe78a712cef85a4ecfcd6bb90f2
MD5 d897c2d4f11bdca7b0a96637f18f2de4
BLAKE2b-256 50ab1946af630305fa63f50d1844625d50209a5c6dea09729baf4ce752416d42

See more details on using hashes here.

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