> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/user-guide/causal-graph.md).

# Build Causal Graph

When you build a Digital Twin with the **Discover & train** action, RootCause runs causal discovery across all the variables in your 360 Table. The output is a **causal graph** — a directed map of cause and effect relationships in your data.

The graph answers a different question from standard analytics. Correlation tells you which variables move together. The causal graph tells you which ones *drive* others, which direction influence flows, and where the real leverage points are.

For the technical background on how discovery works, see [Causal Discovery](/core-technologies/causal-discovery.md).

***

## Starting discovery

Discovery runs as part of building a Digital Twin, and there are two ways into the same builder:

* **From the Ontology page** — the **Recommended Datasets** panel proposes analysis-ready views; **Create & build twin** saves one as a dataset and opens the twin builder with it pre-selected.
* **From the Digital Twins list** — click **New Digital Twin** and pick your Data View in the builder's data step.

Either way, keep the default **Discover from data** method and click **Discover & train** in the final step. RootCause discovers the causal structure and trains the model in one run, which takes a few minutes depending on dataset size. When it completes, open the twin's **Relationships** tab to review the discovered graph. [Step 5: Build Digital Twin](/user-guide/creating-digital-twin.md) walks through the builder itself.

***

## Reading the graph

<figure><img src="/files/OxDnZRTdcCjFAt2cHk78" alt="The Relationships view: the discovered causal graph on the left and the relationships table on the right"><figcaption><p>The Relationships view: the causal graph beside the relationships table — 31 relationships here, with a further 140 candidate connections tested and ruled out. Clicking any node reveals what drives it and how much each driver contributes.</p></figcaption></figure>

The graph has two elements:

* **Nodes** — each node is a variable from your Data View
* **Edges** — lines between nodes represent causal relationships

**Edge types:**

| Edge                    | Meaning                                               |
| ----------------------- | ----------------------------------------------------- |
| A → B (solid arrow)     | A causes B — direction is well-evidenced              |
| A — B (undirected line) | A and B are related, but direction is uncertain       |
| A ↔ B (bidirectional)   | A and B share an unobserved common cause (confounder) |

Nodes are color-coded by data type. Clicking any node opens a **Variable Details** panel on the right, showing how well the variable is explained, which variables drive it, and a Sankey diagram of the causal paths flowing into or out of it.

***

## Reviewing the graph

The graph opens as a flowchart of draggable nodes on a pannable canvas. Click a node to highlight its direct connections. To navigate:

* **Canvas controls** — zoom in and out, fit the graph to the window, and lock the canvas against accidental dragging. **Recompute layout** redraws the arrangement after you have moved nodes around. None of these change the model itself.
* **Search variables** — find a node by name in a large graph.
* **Path Analysis** — from a node's Variable Details panel, Sankey diagrams show how causal influence flows into a target variable (inbound) or out of a source variable (outbound). The width of each flow indicates contribution weight.

Start with your key outcome variable (churn, revenue, conversion rate). Click it to see what drives it directly and what the major inbound paths are. Then expand outward.

***

## Refining with domain knowledge

The discovered graph is a statistical starting point. You can incorporate what you already know:

**Known relationships** — if you're certain a causal link exists (from an experiment, physical law, or domain expertise), declare it. RootCause will respect the constraint when re-running discovery.

**Blocked relationships** — if a relationship is impossible (for example, customer age cannot be caused by purchase behavior), block it. The algorithm will exclude that edge.

To add constraints, open the twin's **Config** tab and click **Modify model**. In the builder's **Add domain knowledge** step, add your known or blocked relationships, then choose **Re-discover & train**. The graph updates to reflect both the statistical evidence and your domain rules.

**Undirected edges** (A — B) are flagged for human review. If you know which direction causality runs, add a Known relationship to resolve it. If you're uncertain, it's fine to leave it — the model handles it.

***

## Evaluating model quality

The **Evaluation** tab shows how well each variable is predicted by its causes in the graph:

* **Categorical variables:** Accuracy, AUC
* **Numeric variables:** MSE, MAE, R²

Variables with weak metrics may need more data, additional drivers, or a refinement pass on the graph structure.

***

## Next step

With the causal graph reviewed and refined, you're ready to fit it into a runnable model.

Next step: [Step 5: Build Digital Twin](/user-guide/creating-digital-twin.md)
