Crates.io | deep_causality |
lib.rs | deep_causality |
version | 0.11.5 |
created_at | 2023-07-10 10:32:38.274853+00 |
updated_at | 2025-09-25 09:08:03.274111+00 |
description | Computational causality library. Provides causality graph, collections, context and causal reasoning. |
homepage | https://deepcausality.com/about/ |
repository | https://github.com/deepcausality/deep_causality.rs |
max_upload_size | |
id | 912839 |
size | 682,414 |
Website | Getting started | Documentation | Blog | Discord | Crates
DeepCausality is a hypergeometric computational causality library that enables fast, context-aware causal reasoning over complex multi-stage causality models. DeepCausality pioneers uniform reasoning across deterministic and probabilistic modalities across static and dynamic contextual causal models. DeepCausality comprises of three core pillars: The Context is an explicit and dynamic hypergraph that models the operational environment, supporting non-Euclidean and non-linear temporal structures. The Causaloid is a polymorphic, composable unit that can encapsulate a causal function. The Effect Ethos is a deontic guardrail that uses a defeasible calculus to ensure a system's actions remain verifiably aligned with its safety and mission objectives. The DeepCausality project is hosted as a sandbox project in the Linux Foundation for Data & Ai.
DeepCausality comprises of three main components:
DeepCausality is a framework for building systems that can reason about cause and effect in complex, dynamic environments. It achieves this by treating causality as a process of effect propagation between simple, composable * Causaloids* that operate on an explicit, flexible Context, all governed by a verifiable safety layer called the * Effect Ethos*. For an introduction to DeepCausality, see the introduction document and the more detailed deep dive.
DeepCausality implements the Effect Propagation Process (EPP), which uses a single axiomatic foundation of causality as
a functional dependency (E2 = f(E1)
). From this single axiom, it derives the context to support Euclidean,
non-Euclidean and non-linear, structures, the causaloid for handling static and dynamic causal structures, and the
effect ethos. The full text of the EPP monograph is accessible via the the publication repository.
DeepCausality is written in Rust with production-grade safety, reliability, and performance thanks to its UltraGraph backend.
DeepCausality provides recursive causal data structures that concisely express arbitrary complex causal structures.
DeepCausality enables context awareness across complex data stored in multiple contexts.
DeepCausality simplifies modeling of complex tempo-spatial patterns and non-Euclidean geometries.
DeepCausality supports adaptive reasoning.
DeepCausality comes with Causal State Machine (CSM).
DeepCausality supports programmable ethics via the EffectEthos.
In your project folder, just run in a terminal:
cargo add deep_causality
git clone https://github.com/deepcausality-rs/deep_causality.git
cd deep_causality
make example
deep_causality
: The main DeepCausality library.deep_causality_algorithms
: Provides algorithms for the DeepCausality library.deep_causality_data_structures
: Provides data structures for the DeepCausality library.deep_causality_discovery
: A custom DSL for causal discovery.deep_causality_macros
: Provides macros for the DeepCausality library (deprecated).deep_causality_num
: Numerical traits and utils used across the other crates.deep_causality_rand
: Random number generator and statistical distributions used in deep_causality_tensor and otherdeep_causality_tensor
: A custom tensor type used in deep_causality_algorithms and deep_causality_discovery crates.deep_causality_uncertain
: Provides a custom crate for handling uncertainty.examples
: A collection of example code.ultragraph
: A hyper-graph library used as a backend in the deep_causality library.Cargo works as expected, but in addition to cargo, a makefile exists that abstracts over several additional tools you for linting and formatting. To check and install missing tools, please run the following command:
make install
You find the install script in the script folder.
The script tests and tries to install all required developer dependencies. if the automatic install fails, the script will show a link with further installation instructions.
After all dependencies have been installed, the following commands are ready to use.
make build Builds the code base incrementally (fast) for dev.
make bench Runs all benchmarks across all crates.
make check Checks the code base for security vulnerabilities.
make example Runs the example code.
make fix Fixes linting issues as reported by clippy
make format Formats call code according to cargo fmt style
make install Tests and installs all make script dependencies
make start Starts the dev day with updating rust, pulling from git remote, and build the project
make test Runs all tests across all crates.
The scripts called by each make command are located in the script folder.
In addition to Cargo and related tools, the entire mono-repo is configured to build and test with Bazel. Please install bazelisk as it is the only requirement to build the repo with Bazel. For more details on working with Bazel, see the Bazel document.
Contributions are welcomed especially related to documentation, example code, and fixes. If unsure where to start, open an issue and ask. For more significant code contributions, please run make test and make check locally before opening a PR.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in deep_causality by you, shall be licensed under the MIT license without additional terms or conditions.
For details:
The project took inspiration from several researchers and their projects in the field:
DeepCausality implements the following research publications:
Parts of the implementation are also inspired by:
Finally, inspiration, especially related to the hypergraph structure, was derived from reading the Quanta Magazine.
This project is licensed under the MIT license.
For details about security, please read the security policy.
JetBrains, the premier software development IDE provider, has granted a free all-product license to the DeepCausality project. The project team expresses its gratitude towards JetBrains generous support.