Skip to content

howtoexitvim/causal-flow

Repository files navigation

CausalFlow

Visual Bayesian Network workbench.
Build · Infer · Understand causality — in your browser.

Live Demo · Docs · Quick Start

Stars License PRs Welcome Live Demo


CausalFlow is an open-source visual workbench for Bayesian Networks. Drop a CSV or define nodes from scratch, draw causal relationships, and run exact inference — all through a drag-and-drop interface. No code, no installs, no MATLAB license.

👉 Try the live demo

Features

  • 🖱️ Visual DAG Editor — Drag-and-drop nodes & edges on an infinite canvas (React Flow)
  • 📊 Three Workflows — Data-driven (CSV → structure learning → MLE), expert knowledge (manual priors), or hybrid
  • Real-Time Inference — Click to set evidence, watch posteriors update instantly via Variable Elimination
  • 🔀 Auto Layout — Dagre-powered hierarchical layout, one click to organize
  • 🧠 Smart Ingestion — Drop a CSV, auto-detect discrete variables and state spaces
  • 🎯 Prior Probability Editor — Define CPTs by hand when you have domain expertise but no data
  • 🏗️ Structure Learning — Hill-Climbing algorithm discovers causal structure from data
  • 🌐 Zero Install — Runs entirely in the browser + lightweight API backend

Screenshots


Canvas

DAG Construction

Inference

Evidence Propagation

Architecture

Frontend                          Backend
React 19 · React Flow · Zustand   FastAPI · pgmpy · NetworkX
Tailwind CSS · Dagre · Recharts   Variable Elimination · Hill-Climbing
          ↕  REST API  ↕

Quick Start

git clone https://github.com/shuqiwhat/causal-flow.git && cd causal-flow

Backend:

cd backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload        # → http://localhost:8000

Frontend:

cd frontend
npm install && npm run dev        # → http://localhost:5173

That's it. Open http://localhost:5173.

Deploy

One-click Docker:

docker compose up -d --build

Vercel + Render (free tier):

Component Platform Root Dir Config
Frontend Vercel frontend Set VITE_API_URL env var
Backend Render backend Auto-detected as Python

Contributing

PRs are welcome. See CONTRIBUTING.md.

  1. Fork → Branch → Commit → PR

Star History

Star History Chart

License

MIT — see LICENSE.


Built by @shuqiwhat

About

The open-source, visual-first Bayesian Network workbench.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors