Skip to main content

sagrada-engine

A deterministic belief-revision operator for AI agents. Every change to what an agent believes — assert, revise, retract, merge, split — goes through one operator that records it in a hash-chained, replayable log. The model proposes; the operator writes; the record replays — so what was believed, and when, is something you recompute rather than something you are told.

No network, no telemetry, no model calls. The wheel is a single compiled extension (Rust core, PyO3 binding) with zero Python dependencies.

pip install sagrada-engine

Sixty seconds

>>> import sagrada
>>> state = sagrada.PyKnowledgeState()
>>> state = state.apply_assert("deploy-rule", "production deploys require two approvals")
>>> state = state.apply_retract("deploy-rule")
>>> state = state.apply_assert("deploy-rule", "production deploys require one approval")

>>> [(h['operation_type'], h['definition']) for h in state.concept_history('deploy-rule')]
[('assert', 'production deploys require two approvals'), ('retract', None), ('assert', 'production deploys require one approval')]

>>> state.verify_chain()
True

The rule was asserted, retracted, and quietly replaced with a weaker one. The history shows all three events — including the retraction — and the chain verifies. A memory that only stored the current value would show one clean assert of the weaker rule, with no sign a stricter policy had ever existed.

What it guarantees

  • Deterministic, canonical state. States serialize to a canonical byte form and hash with SHA-256. Determinism is over the record, not the call: hand the same record log to any wheel in this release and the state hash comes back byte-identical. Measured on all four shipped platforms — Linux x86_64, Linux aarch64, macOS arm64, macOS x86_64 — by replaying one log emitted on another; the empty state is 01ea42171f2295cbb54a24c017724becb37a712b2fcd5b9f525d1e9ea045650a on each. Re-running the same apply_* calls does not reproduce a hash, and shouldn't: each write mints a fresh concept id and timestamp, so it is a genuinely different history. 0.3.0 ships no Windows wheels.
  • Hash-chained history. Each operation appends a record chained by SHA-256. verify_chain() recomputes the chain: tampering with any record, or its order, fails it. reconstruct() goes further and replays the operations, checking that the records still produce the state they claim to.
  • Revision with postulates. The nine operations (assert, refine, revise, retract, relate, restructure, merge, split, reinforce) are classified against AGM-style belief-revision postulates; every record carries its classification, and agm_report() re-derives it for any transition. Write-time invariants — closure, status, finiteness — are enforced and refused at the boundary. The postulates themselves are reported, not enforced: read the report; silence is not compliance.
  • Temporal queries. state_at(n), per-term history, range diffs, and provenance (W3C PROV) export — questions a current-state snapshot cannot answer.

Immutability is the API: every apply_* returns a new state; the old one is untouched.

What the record does and does not establish

Replay a record log and you recompute the same state hash, so an edit to any record — or to their order — shows up. That is tamper-evidence, and it is not authorship: the chain is unsigned, so a party who rewrites the whole log and recomputes every hash produces a chain that verifies. Binding a record to a signer is what ER1 receipts are for.

And today this operator is the only implementation, so "recompute" means running this wheel. A published canonical-form spec — so anyone can write a verifier in any language, against golden vectors, the way er1-verify already works — is what this package owes you next. Until it exists, verification is reproducible but not yet independent, and you should read the claim above with that scope.

What it is not

It is not a database, a vector store, or an LLM framework. It is the small deterministic organ those systems lack: the one place writes go, so that reads can be trusted. Pair it with any model, any retrieval stack, any framework.

Part of Sagrada

The Sagrada system, published by Cruxia Labs:

  • er1-verify — offline verifier for ER1 action receipts; three conformant implementations on disjoint stacks (Python, Node, browser WebCrypto).
  • sagrada-mcp — MCP server that mounts this operator as governed agent memory.
  • sagrada-linter — coherence linter for prompts and agent transcripts.

License: Apache-2.0.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

sagrada_engine-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (895.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

sagrada_engine-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (845.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

sagrada_engine-0.3.0-cp313-cp313-macosx_11_0_arm64.whl (786.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

sagrada_engine-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl (839.3 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

sagrada_engine-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (896.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

sagrada_engine-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (845.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

sagrada_engine-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (787.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

sagrada_engine-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl (839.6 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

sagrada_engine-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (896.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

sagrada_engine-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (846.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

sagrada_engine-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (789.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

sagrada_engine-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl (841.7 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

sagrada_engine-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (896.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

sagrada_engine-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (846.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

sagrada_engine-0.3.0-cp310-cp310-macosx_11_0_arm64.whl (789.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

sagrada_engine-0.3.0-cp310-cp310-macosx_10_12_x86_64.whl (841.6 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file sagrada_engine-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cf51585d19026f919c3ffb991d876c3f035bef4a2fcde8b103101bf8f450814
MD5 2bc108d4538d4610927d06911e94dc28
BLAKE2b-256 e25722c383e822e0d72176196243213d6f194209774b4aa4c6aa9bc857f7d346

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7d1c2e28b04c2b2d23a6abf2c0fdeef9af3daa8b8237224f3c2de5fdf748399d
MD5 42b432b3d6d64dd1f65a6132171bdf3e
BLAKE2b-256 194789b62fa1d0402a4b668985c7746364273cd5f7ddf57295790b4b5d65fc05

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 35fa4ba6a170a55e873bc175206e357403344ac44883464e90d2be680e6689f9
MD5 abed7efb075d09380f72af4d045324fb
BLAKE2b-256 ad02e1567b78cc56c21c6366bf7e1ff2dd53a3cae2da3d390b412cfd1c7d3e61

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0b5252e3c7388a927b79cd893d1e61da7fd9ba9a194c46d32b11526e06c17d4d
MD5 eac1e4614a8177cdb602dab4e1e20615
BLAKE2b-256 16d3425b1e68b1650e87f44bb24699f09aed6a77b4b6ae1f69a65f231afb1aa3

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e9cf03b6e06d11f1bb8b0bc02294559cdc9cc5531659df2a1881a736a4321769
MD5 51695cd7c41a9f0698399d3524797f47
BLAKE2b-256 e4b9b2cb6ce694076f8e6b093c90b3ca6abe7d421bdf28226347e197af5f0e00

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8bb58fba0ed66f0935bb39d26f6fa2f7b0dbe8f45ff087a2b158d9d35c690e99
MD5 113932a1995a2658c6f04b720ab3684e
BLAKE2b-256 c00d66964a249bcafa47ba501debe20156684f40c5bde3ef8b1a38e9857118ef

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f427495f2ecdb384c2c2e43fc53eb077e43c238ef60193b9d6f62f139a4f515b
MD5 338e82a7001d1580b31039b2985e4acb
BLAKE2b-256 117e33c51b4f510f10756db5e5515609cdd235420b1f86ceb7079914eecbb5c0

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 deccc0b3d910ebb9c7b60f2c0db0c13bcd5d7187b2d3474b0e1d223f195a0b92
MD5 b39977a8d653d1c81f9b144820893cc4
BLAKE2b-256 23d9ed8bb87b9fb6c34621af88ddf06eaa6c61c398a903aae8add4172ff5d1b4

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 041a2c405df3ae5a99f36218869928efdb948e3ffbde6976b2a05bbef47d71f3
MD5 d5d77ea65760dedc5ea88ef608083439
BLAKE2b-256 1b9839d2aaa32f840e4af985133167a88d71a18a472933b73b9bb672f2e29851

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2a02c25f05b458222ae9eec9a18c6a524dbc3f0cc8cb66f11ffe9ef954ae2873
MD5 a68e996ddfdd4c76748001354fa2af75
BLAKE2b-256 975922be50dd7689e9df3ad76883195c51fd4c13ac0d6c2a774a6f1f139cd332

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f28c28fe163a6aa366a05caca4a2383564091b3fb3ac632692fe735539b091ca
MD5 deefb10a8886f6b2e9ac94a3a8a4a246
BLAKE2b-256 003920ef998f2adb0b252ca62b5e25687db60eb2727c1cda53a278e5ee9ce68f

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c74bf5156c5f619a9396929027a551765361b109ad753a6158f29fdd718b3332
MD5 e32ced4ba8ea559df2459ae55024e4dd
BLAKE2b-256 beed2ef97700213d45b27f1ab5ffc5c06d22685ef039d52901c69590125cf614

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0ee04158bbc7aba39fcb47fe25965d5313004092e3ee3a62b0db2c4adefe1e9b
MD5 64953d0a8745a2f508f07522c356d6dd
BLAKE2b-256 edf6881307ddb5b5e8331526984d7b2612a9ac2ca7a1bc5ab0fdc61d620e81a8

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c33be2394f9b297fa513097cb8f58aa62589249bde5ed4a92d74e5f6568dd1bf
MD5 f4a48e3c262596d4192812a9e177de38
BLAKE2b-256 5ee5808e2beadcf170baf54998a0b4704d72daed88340e9b4be2de9f67f25cd7

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a2471a1f9568a9f6efe3d43ae61b08567ec8cdcd389fdec5c4a9b06b9502334c
MD5 13edd58a57089edb27806406cb68dcaf
BLAKE2b-256 2a4620c514794032d50b696b879af48572affe6c4068529a2da1212c3c1dd879

See more details on using hashes here.

File details

Details for the file sagrada_engine-0.3.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sagrada_engine-0.3.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 42e1396fc2fb97a20344c0264ec82f6441f28d8a659b16b832471f932c95774b
MD5 ff4a52f945266ffcdbe63f82121f2526
BLAKE2b-256 421ebec12122b097b0a680287cd54a26dffbd5fa879b74c6f8854955c5aa2243

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