Skip to content

Ergodic

Causal AI: causal discovery, causal inference, and process intelligence.

Pre-alpha

This project is early scaffolding. The public API is not settled and will change.

New to causal inference itself? Start with the learn series: ten notebook guides that teach the ideas on commercial examples, no background assumed. Know the field and want the API? Walk through the getting started page, then read the concepts.

Three pillars

  • Causal discovery


    Learn causal structure from data, including time series.

    Discovery

  • Causal inference


    Estimate causal effects from data and a causal model, or from a panel design when the rollout is the experiment.

    Inference

  • Process intelligence


    Discover and analyze processes from event logs.

    Process

Built on shared foundations

  • Causal graphs


    One mixed-graph object covering DAG, ADMG, CPDAG, MAG, and PAG.

    Graphs

  • Domain knowledge


    Prior constraints that discovery and inference read.

    Knowledge

  • Data


    Typed datasets: tabular, time series, panel, hierarchical, event log.

    Data

  • Identification


    Graph to estimand, on a single graph or a whole equivalence class.

    Identification

Installation

pip install ergodic
uv add ergodic

Quick start

from ergodic import dag, DomainKnowledge, identify_effect

g = dag(["Smoking -> Tar", "Tar -> Cancer", "Smoking -> Cancer"])
g.d_separated("Smoking", "Cancer", "Tar")   # False: the direct edge remains

dk = DomainKnowledge().with_tiers([["Smoking"], ["Tar"], ["Cancer"]])
dk.is_consistent(g)   # True

identify_effect(g, "Smoking", "Cancer").estimand
# 'P(Cancer | do(Smoking)) = P(Cancer | Smoking)'

And the pillars meet in two calls: discover a graph from data, then estimate straight off it.

from ergodic import discover, estimate_effect, tabular

data = tabular(frame)
result = discover(data)
estimate_effect(result.graph, data, "X", "Y", strategy="dml")

See the API reference for the full surface.