Quantum-entropy oracle SDK for divination systems
Project description
OpenDivination
OpenDivination is a lightweight oracle SDK and CLI for:
- tarot draws
- I Ching casts
- auditable entropy provenance
- one stable text-only tarot resonance mode
- coherence scoring (semantic similarity between question and drawn symbol)
The product surface is intentionally small. Selection mode is the default. Resonance mode is a single opinionated text-first path built from the latest local QCicada experiments.
For Agents
If you are an agent or you are pointing an agent at this repo, the intended bootstrap flow is:
- install the CLI
- install the
divinationskill bundle - run
opendivination setup - ask the user which source path they want:
- regular computer RNG
- remote QRNG
- local hardware QRNG
Recommended agent flow:
pipx install opendivination
opendivination setup
opendivination sources --json
If the user wants remote QRNG:
- ask whether they want
anuoroutshift - if required, ask for the API key
- save it through
opendivination setup
If the user wants local hardware:
- prefer
qcicada - if
qcicadais not available, keepcsprngand explain that the hardware path is not ready yet - do not silently switch users onto the mixed
openentropyaggregate unless they explicitly want that
Important default:
openentropyis not the default sourcecsprngis the default source until the user explicitly changes itopenentropyis only used when the user explicitly selects local hardware
Use opendivination setup --json if the agent wants a structured result.
Install
# Easiest CLI install
pipx install opendivination
# Python SDK install
pip install opendivination
The default install requires no QRNG device and no embedding model. Out of the box, draws use the
computer RNG source csprng.
QCicada hardware support is currently verified on Python 3.13. The base package works on Python
3.14, but the openentropy dependency does not build there yet.
Guided Setup
The simplest onboarding path is:
opendivination setup
That guided command writes ~/.config/opendivination/config.json and can:
- keep the default
csprngpath - switch to a remote QRNG provider like
anuoroutshift - store remote QRNG API keys in the config file
- pick a detected local hardware source such as
qcicada
The config file is written with owner-only permissions when possible.
Non-interactive examples:
opendivination setup --source-profile computer
opendivination setup --source-profile remote_quantum --qrng-provider anu --api-key YOUR_KEY
opendivination setup --source-profile local_hardware --hardware-source qcicada
Core Commands
opendivination draw tarot --json
opendivination draw iching --method yarrow --json
opendivination sources --json
Those default to your configured source, or csprng if you have not run setup yet.
Source Modes
OpenDivination has three practical source paths:
csprng: regular computer RNG, available by default, no extra setup- network QRNG: sources like
anuoroutshift - hardware QRNG: sources like
qcicadaviaopenentropy
If you want the closest thing to explicit non-classical entropy, the opinionated order is:
qcicada?conditioning=raw&mode=raw: best local quantum path, raw device outputanu: remote quantum APIoutshift: remote quantum-origin API with provider-side post-processingopenentropy: mixed local physical entropy pool, useful but not a pure quantum source
Check what is available on the current machine:
opendivination sources --json
To save a preferred source for future draws:
opendivination setup
If you care about trust or randomness provenance, always inspect:
provenance.source_idprovenance.is_quantum
Tarot
from opendivination.oracles.tarot import draw_tarot_sync
result = draw_tarot_sync(source="csprng")
print(result.card.name, result.orientation.value)
print(result.provenance.source_id, result.provenance.is_quantum)
The default source is your configured source, or csprng if unset. To opt into QRNG for one draw,
pass an explicit source such as source="anu" or source="qcicada".
QRNG
Network QRNG examples:
opendivination draw tarot --source anu --json
opendivination draw iching --source anu --json
If you want future draws to use ANU by default:
opendivination setup --source-profile remote_quantum --qrng-provider anu --api-key YOUR_KEY
Hardware QRNG with QCicada requires the optional hardware dependency and a working OpenEntropy / QCicada setup:
python3.13 -m pip install "opendivination[hardware]"
opendivination sources --json
opendivination draw tarot --source qcicada --json
If qcicada does not show up in sources --json, the hardware path is not ready yet.
If you are using Python 3.14, install the hardware path with Python 3.13 until openentropy
supports 3.14.
After the hardware stack is ready, you can save it as the default:
opendivination setup --source-profile local_hardware --hardware-source qcicada
Tarot Resonance
Resonance is now one stable text-only algorithm:
- sample raw entropy
- choose a small uniform shortlist from the deck
- render each shortlisted card as text
- render the entropy as
bare_hex_spaced - embed both with the chosen text embedding model
- pick the closest card inside the shortlist
Stable defaults:
- tarot card text:
descriptive - entropy text:
bare_hex_spaced - entropy bytes:
256 - shortlist size:
3 - entropy source default:
csprng - local provider:
local - local model: Ollama
nomic-embed-text
from opendivination.embeddings.providers import create_embedding_provider
from opendivination.oracles.tarot import draw_tarot_by_resonance_sync
provider = create_embedding_provider("local", model="nomic-embed-text")
result = draw_tarot_by_resonance_sync(
provider=provider,
source="csprng",
)
print(result.card.name, result.score)
print(result.provenance.source_id, result.provenance.is_quantum)
Resonance is opt-in. Standard tarot and I Ching draws do not need embeddings. Do not treat resonance as a base-install command; it requires a working embedding runtime.
After embedding setup, CLI:
opendivination draw tarot \
--mode resonance \
--embed-provider local \
--embed-model nomic-embed-text \
--json
For a QRNG-backed resonance draw, add an explicit source:
opendivination draw tarot \
--mode resonance \
--embed-provider local \
--embed-model nomic-embed-text \
--source qcicada \
--json
Supported stable embedding runtimes:
localollamasentence_transformersopenaiopenai_compatiblegeminideterministicfor tests
The simplest local embedding path is:
- install Ollama
- run
ollama pull nomic-embed-text - run
opendivination draw tarot --mode resonance --embed-provider local --embed-model nomic-embed-text --json
If Ollama is not running, --embed-provider local will fail unless you separately install
sentence-transformers and use --embed-provider sentence_transformers.
Coherence Scoring
Pass a question with --question / -q to get a coherence score — how semantically similar your
question is to the drawn symbol's meaning. Works with both tarot and I Ching:
opendivination draw tarot -q "What should I focus on?" --embed-provider local --json
opendivination draw iching -q "How should I approach this conflict?" --embed-provider local --json
Python SDK:
from opendivination.embeddings.providers import create_embedding_provider
from opendivination.oracles.tarot import draw_tarot_sync
provider = create_embedding_provider("local")
result = draw_tarot_sync(source="csprng", question="What awaits?", provider=provider)
if result.coherence:
print(f"Coherence: {result.coherence.score:.4f}")
Coherence uses embedding cosine similarity — no LLM required. The question text is never stored;
only a SHA-256 hash appears in the result. Coherence is fully optional: omit --question and
draws work exactly as before.
JSON Card Text Config
Tarot card text can be customized with JSON.
Default path:
~/.config/opendivination/config.json
You can also pass --config /path/to/config.json.
Example:
{
"tarot": {
"card_text": {
"profiles": {
"descriptive": {
"template": "Tarot card: {name}. Arcana: {arcana}. Suit: {suit}. Keywords: {keywords}.",
"overrides": {
"Death": "Tarot card: Death. Transformation, ending, and renewal."
}
}
}
}
}
}
A copyable example also lives at skills/divination/examples/config.json.
Provenance
When randomness or trust matters, use:
provenance.source_idprovenance.is_quantum
OpenDivination keeps interpretation separate from entropy facts. If the source is csprng, it is reported honestly as software entropy.
Sources
Named sources include:
qcicadaopenentropy:qcicadaanuoutshiftcsprng
Inspect availability with:
opendivination sources --json
Skill
The OpenClaw skill bundle is in skills/divination/SKILL.md and installs as the divination
skill.
For the skill, the easiest setup is:
- install the CLI with
pipx install opendivination - install the
divinationskill bundle into your OpenClaw skills directory - use QRNG or resonance only when you intentionally opt in to them
For QCicada hardware support through pipx, use Python 3.13 explicitly:
pipx install --python python3.13 'opendivination[hardware]'
Development
pip install -e ".[dev]"
pytest
ruff check src tests skills/divination/scripts
mypy src
python3 skills/divination/scripts/run_opendivination.py --check
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 Distribution
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 opendivination-0.1.0.tar.gz.
File metadata
- Download URL: opendivination-0.1.0.tar.gz
- Upload date:
- Size: 34.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8fb8c3ca77fdca69babc0e082e5a9ea6ed08dfed2de0753e19e04876d70cd88
|
|
| MD5 |
b9d8be44cf60ed847b868130e9028a3d
|
|
| BLAKE2b-256 |
b145bc707765a128bb076fbe287a25cee1e875e3ade759449597a60cd5a25264
|
Provenance
The following attestation bundles were made for opendivination-0.1.0.tar.gz:
Publisher:
publish.yml on amenti-labs/opendivination
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opendivination-0.1.0.tar.gz -
Subject digest:
e8fb8c3ca77fdca69babc0e082e5a9ea6ed08dfed2de0753e19e04876d70cd88 - Sigstore transparency entry: 1161726768
- Sigstore integration time:
-
Permalink:
amenti-labs/opendivination@e2b3ca968711ca98b86cfbbad9c56c773fc42203 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/amenti-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2b3ca968711ca98b86cfbbad9c56c773fc42203 -
Trigger Event:
release
-
Statement type:
File details
Details for the file opendivination-0.1.0-py3-none-any.whl.
File metadata
- Download URL: opendivination-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f14da8dfa1a30a662416f07d3197359a0355a0b32243e9c0007ec72909b95d0
|
|
| MD5 |
9418c69fbca7352d92f08d9e5b78a2eb
|
|
| BLAKE2b-256 |
50f188df592730e5140afab8a27ae53ccf35c767693b74459ea76878bab90cc9
|
Provenance
The following attestation bundles were made for opendivination-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on amenti-labs/opendivination
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opendivination-0.1.0-py3-none-any.whl -
Subject digest:
5f14da8dfa1a30a662416f07d3197359a0355a0b32243e9c0007ec72909b95d0 - Sigstore transparency entry: 1161726913
- Sigstore integration time:
-
Permalink:
amenti-labs/opendivination@e2b3ca968711ca98b86cfbbad9c56c773fc42203 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/amenti-labs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e2b3ca968711ca98b86cfbbad9c56c773fc42203 -
Trigger Event:
release
-
Statement type: