CausalNerve
CausalNerve: online causal graph adaptation for streaming non-stationary systems.
Core Capabilities
- Real-time causal structure revision without retraining (see Section 6 benchmarks).
- Intervention simulation via Pearl's do-calculus (native) (demonstrated in Turbofan demo).
- Structural isolation guarantee: do(X) only affects descendants (formalized in PAPER.md).
Installation
pip install causalnerve
pip install causalnerve causalnerve-observe # for dashboard
Upgrade Note
To upgrade to the latest stabilized version:
pip install --upgrade causalnerve causalnerve-observe
Quickstart
from causalnerve import CausalNerve
from causalnerve.datasets import SyntheticStreamGenerator
nerve = CausalNerve(nodes=6, state_dim=32)
nerve.fit(SyntheticStreamGenerator.stable(n_cycles=200), epochs=20)
nerve.watch(SyntheticStreamGenerator.with_drift(drift_at=100))
Expected output:
CausalNerve Summary
────────────────────────────────────────
Cycles processed: 200
Structural alarms: 3
Edits accepted: 1 (edge 4->2, conf=0.71)
Edits rejected: 2
Final leakage: 0.031
Causal equilibrium: reached at cycle 147
────────────────────────────────────────
Run nerve.why(4) for root cause analysis.
Run nerve.what_if({2: 0.5}) to simulate interventions.
What CausalNerve Is Not
- CausalNerve is not a causal discovery algorithm (use PCMCI for that).
- CausalNerve is not a replacement for physics simulations.
- CausalNerve is not validated for safety-critical deployment without domain expert review of its structural revisions.
Scientific Benchmarks
Evaluated on NASA C-MAPSS FD001 (Engines 81-100).
| Method | SHD ↓ | Det. Delay ↓ | Runtime ↑ | Online? |
|---|---|---|---|---|
| CausalNerve | 0.0 ± 0.0 | 221.7 ± 60.3 | 83 ms | Yes |
| PCMCI | 105.8 ± 9.3 | N/A (offline) | 4613 ms | No |
| VAR-LiNGAM | 20.0 ± 0.0 | N/A (offline) | 1 ms | No |
| Granger | 158.9 ± 13.7 | N/A (offline) | 780 ms | No |
Note: CausalNerve is structurally self-repairing (via automated dual-world validation), which incurs an ~80ms overhead compared to static architectures. It trades offline causal discovery accuracy for online adaptability; specifically, CausalNerve loses to PCMCI on Structural Hamming Distance (SHD) for stationary chain graphs.
Examples
We provide three definitive demonstrations of the autonomous capabilities:
- Real-time Causal Self-Repair in Turbofan Engines
- Tracking Changing Brain Connectivity During Seizure
- Detecting Cascading Failures in Distributed Systems
Documented Limitations
CausalNerve is bound by constraints in scalability, expected calibration error (ECE) under rapid distribution shifts, and sensitivity to highly correlated sensor noise. For a rigorous audit of system boundaries and known failure modes, please read FAILURES.md.
Citation
If you use CausalNerve in your research, please cite our technical paper:
@software{causalnerve2026,
author = {CausalNerve Core Team},
title = {CausalNerve: Adaptive Structural Dependency Learning},
year = {2026},
url = {https://github.com/guru-s/CausalNerve}
}
License
MIT License
Metadata
Release files for causalnerve 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| causalnerve-1.0.5.tar.gz | 226.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| causalnerve-1.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 450.8 kB
Release files / causalnerve-1.0.5.tar.gz
| Download URL | causalnerve-1.0.5.tar.gz |
|---|---|
| Size | 226.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3de2f49e8545bf25a1ea36d4ecb809f3e29e42f4aeb9f9b22a74149a6824c57
|
|
BLAKE2b-256 checksum How to use checksums |
3a6243d51468f831d2630129f95a9cfd4dca51466b6d4bbc121f7960fcbf5bca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 28, 2026.
Transparency logRelease files / causalnerve-1.0.5-py3-none-any.whl
| Download URL | causalnerve-1.0.5-py3-none-any.whl |
|---|---|
| Size | 224.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29b942828395d8fbefc3171383a1d935b241ef8ff84f435d0beecb00408d2b42
|
|
BLAKE2b-256 checksum How to use checksums |
faeb63eb7da1776548bf651e1fce6f13cb4a6294929af23736892b52bb78809f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 28, 2026.
Transparency log