Andrey is a causal discovery package for Python.
- Fast: The fastest causal discovery package.
- Accurate: more than 80% fewer errors than other popular packages.
- One API: 27 methods, each one function call.
- Agent-ready: a command line that answers in JSON, and a skill for coding agents.
uv add andrey-core
pip install andrey-core
- Optional extras:
andrey-core[torch]for GPUs,andrey-core[viz]for charts and graph layouts - Development version:
uv add git+https://github.com/Abel-ai-lab/andrey - Installation guide: the extras, a PyTorch build for your GPU, and building Andrey from source
Four ideas make it fast; each is animated in a blog post:
- Do many things at once: thousands of independence tests run as one array operation, with the same results.
- Never compute twice: the correlation matrix is computed once and cached; GES memoizes its local scores.
- Skip what can't matter: tests with a closed form settle most edges before any matrix is inverted.
- Use the hardware you have: with the optional PyTorch extra, a GPU computes large entropy tables.
What's inside
| Family | Methods | Returns |
|---|---|---|
| Constraint-based | pc, fci, gfci, cdnod |
CPDAG, PAG |
| Score-based | ges, gies, xges, hc, tabu, exact_search, calm |
CPDAG, DAG |
| Permutation-based | boss, grasp |
CPDAG |
| Linear non-Gaussian | direct_lingam, ica_lingam, multi_group_direct_lingam |
DAG |
| Temporal causal discovery | varma_lingam, longitudinal_lingam, pcmci, pcmciplus, lpcmci, granger |
Temporal graph |
| Latent variables | gin, rcd, bottom_up_parce_lingam |
DAG, PAG |
| Pairwise direction | anm, pnl |
Two-node DAG |
Quick start
Learn the protein-signaling network of Sachs et al. (2005) from 853 cells, and score it against the known network:
import andrey
from andrey.data import load_dataset
from andrey.metrics import score
sachs = load_dataset("sachs") # 853 cells, 11 proteins, and the known network
out = andrey.pc(sachs.data) # learn a graph
print(out)
scores = score(out.structure, sachs.graph)
print({k: round(scores[k], 2) for k in ("shd", "skeleton_precision", "skeleton_recall")})
PC cpdag | 11 nodes | 8 edges (6 undirected, 2 directed)
raf -- mek
plc -- pip3
pip2 -- pip3
erk -- akt
erk -- pka
akt -- pka
p38 -> pkc
jnk -> pkc
{'shd': 11, 'skeleton_precision': 1.0, 'skeleton_recall': 0.47}
PC finds 8 edges, all among the known network's 17. The structural Hamming distance (SHD) counts the edges to add, remove, or reorient to reach the known network: 11 here (9 edges are missing, and 2 are oriented that the known network leaves undirected), and 17 for a graph with no edges.
For your own data, pass a pandas DataFrame or a NumPy array: one row per sample, one column per variable. From a shell or an agent:
andrey run pc --data your_data.csv # JSON when piped, a summary in a terminal
To give your coding agent Andrey's skill, paste this prompt into it:
Install Andrey's agent skill: make sure the andrey-core package is installed, run
`andrey --skill`, and save its output as andrey/SKILL.md in your skills folder.
Learn more
- Documentation: guides and the API reference.
- Examples: notebooks, one method or task each.
- Demos: step through methods and explore results in your browser.
- What's new in 0.8.0: KCI, RCoT, CMIknn, and GPDC, four tests for nonlinear dependence, with its release card.
- Release cards: every size, time, and error count.
- Launch post, FAQ, and changelog.
- Roadmap: the planned work, in order.
Andrey is in alpha: the API may change between releases, so pin the version you use. Linux is fully tested; macOS and Windows install and run on the CPU, but the full test suite and the GPU speedups (CUDA / MPS) are not tested there yet.
Citing, license, contributing
If you use Andrey in your work, please cite it, or use the citation file:
@software{andrey,
author = {{Abel AI Lab}},
title = {Andrey: Accelerated, accurate, agentic causal discovery},
year = {2026},
version = {0.8.0},
url = {https://andrey.abel.ai},
}
Andrey is released under the Apache License 2.0. Bug reports and pull requests are welcome in the issue tracker; the contributing guide explains how to set up a development environment.
Andrey is inspired by causal-learn, pgmpy, Tetrad, and many other causal discovery packages.
Metadata
Release files for andrey-core 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| andrey_core-0.8.0.tar.gz | 491.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| andrey_core-0.8.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / andrey_core-0.8.0.tar.gz
| Download URL | andrey_core-0.8.0.tar.gz |
|---|---|
| Size | 491.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c156deb3b4c7046c937b2d43fd1c206be9f14e836b79ea2daa0e077d9e06945
|
|
BLAKE2b-256 checksum How to use checksums |
9c231f743e6f408227a315ab7e98401b9549995bd8bb2949bf185224404343b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 23, 2026.
Transparency logRelease files / andrey_core-0.8.0-py3-none-any.whl
| Download URL | andrey_core-0.8.0-py3-none-any.whl |
|---|---|
| Size | 567.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de22efd2b8fd33d812dfc88dc41ae4b903b8be53092ddb394ad78942348040a9
|
|
BLAKE2b-256 checksum How to use checksums |
aa83d17334286cac72f5399a4722df630ecb0c80d8abe0c8593c81c91694f989
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 23, 2026.
Transparency logSecurity for andrey-core 0.8.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for andrey_core-0.8.0.tar.gz
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 Oct 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.