Skip to main content

Andrey: accelerated, accurate, agentic causal discovery

PyPI version PyPI downloads CI status Python 3.11, 3.12, 3.13, 3.14 License: Apache 2.0


⭐ What's new in 0.18.0

0.18.0 is a release of new methods and fixes. DAGMA is supported, with its gap stated: like NOTEARS, its result depends on the data's scale, and against its authors' package on its paper's simulation it made no more errors in any of 42 settings. DAS, SkewD, and CPCM, experimental, extend functional causal modeling, for larger graphs, skewed noise, and effects with a chosen distribution such as counts. load_dataset loads the Tübingen cause-effect pairs. ANM, PNL, and LOCI return the same direction under any order of the rows, and PCMCI+ the same p-values under any order of the columns. An AI policy holds every change, however it is written, to the same rules and checks.

0.18.0 release card · Post: Functional causal models


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: 50 supported methods, each one function call.
  • Any data: continuous, categorical, mixed, time series, nonlinear, hidden confounders.
  • Agent-ready: a command line that answers in JSON, and a skill for coding agents.
uv add andrey-core
pip install andrey-core

You install andrey-core and then import andrey.

  • Optional extras: andrey-core[torch] for GPUs and CALM, andrey-core[viz] for charts and graph layouts
  • From GitHub, the latest release: uv add "andrey-core @ git+https://github.com/Abel-ai-lab/Andrey@main"
  • Installation guide: the extras, a PyTorch build for your GPU, and building Andrey from source

Andrey: accelerated, accurate, agentic. 50 supported methods. Data types: continuous,
      categorical, mixed, time series, nonlinear. Real data processing: missing values,
      background knowledge, edge confidence. Graphs: DAG, CPDAG, PAG, temporal; hidden
      confounders. Acceleration: parallel CPU; GPU with PyTorch (CUDA). Portability: NetworkX,
      pcalg, Graphviz DOT, NumPy. Interface: Python, CLI, skill.

Release cards

What's inside

Family Methods Returns
Constraint-based pc, fci, gfci, cdnod, fci_jci, icp, iamb, inter_iamb, mmpc CPDAG, PAG, DAG, Undirected graph
Score-based ges, gies, gnies, xges, ages, hc, tabu, exact_search, calm, notears, dagma, mmhc, rsmax2 CPDAG, DAG
Permutation-based boss, grasp, boss_fci, grasp_fci, igsp, ut_igsp CPDAG, PAG
Functional causal models direct_lingam, ica_lingam, multi_group_direct_lingam, cam, resit, cpcm_graph*, skewd_mv*, score_matching, nogam, das* DAG
Temporal causal discovery varma_lingam, longitudinal_lingam, pcmci, pcmciplus, jpcmciplus, lpcmci, granger, dynotears Temporal graph
Latent variables gin, rcd, bottom_up_parce_lingam, camuv DAG, PAG
Pairwise direction anm, pnl, loci, cpcm*, skewd* Two-node DAG

* Experimental: not supported yet (see its Limitations), and the API may change.

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

  indep_test: fisherz
  tie_break: rank
{'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 where the known network's CPDAG leaves them 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

Andrey is in alpha: the API may change between releases, so pin the version you use. Linux is supported; macOS and Windows install and run on the CPU, with no guarantee yet (Testing). Apple GPUs are not supported in the alpha.

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.18.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.

We write much of Andrey with AI coding tools, under our maintainers' direction and review, and you are welcome to use them in a contribution. However a change is written, it follows the same rules, passes the same checks, and goes through a pull request that a person answers for. Benchmark numbers come from recorded runs and are never written by an AI tool, and each blog post and release card ends with a statement of how AI tools were used to write it. The AI policy has the rules.

Andrey is inspired by causal-learn, pgmpy, Tetrad, and many other causal discovery packages.

Metadata

Release files for andrey-core 0.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for andrey-core 0.18.0
File Size Uploaded Provenance Actions
andrey_core-0.18.0.tar.gz 1.1 MB With provenance Details for andrey_core-0.18.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for andrey-core 0.18.0
File Interpreter ABI Platform Actions
andrey_core-0.18.0-py3-none-any.whl Python 3 none any Details for andrey_core-0.18.0-py3-none-any.whl

Total release size: 2.2 MB

Release files / andrey_core-0.18.0.tar.gz

Download URL andrey_core-0.18.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
3d55f33be14cda29892724bc7b254597be2562892c0a6a9c8f62d85b296bf85e
BLAKE2b-256 checksum
How to use checksums
b696f5f6bf7d8f2f51c801f865dd91273d7d3050ce1343727f17e344d78a929f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / andrey_core-0.18.0-py3-none-any.whl

Download URL andrey_core-0.18.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ca4552f52e425c869a20cad016a629c020f28579eaf44dda1cfaf4d6157d5296
BLAKE2b-256 checksum
How to use checksums
18cbc79a9f39813376c0e1958783e2fab8b5614fd0193547b41a9f6f44cc3bd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for andrey-core 0.18.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for andrey_core-0.18.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 Nov 19, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page