Skip to content

Picasso2453/forkbook

Forkbook

A branching Python notebook canvas. Cells form a DAG instead of a linear list — split execution into parallel branches, compare results side-by-side, and converge.

Forkbook Core is open source and local-first. Forkbook Cloud is paid for teams, sync, storage, AI, and compute.

Demos

Run Python, see streaming output

Demo 1 — run Python and see output

Split into branches, compare strategies side by side

Demo 2 — branch comparison

What it is

Most notebooks force you into a single linear chain of cells. Forkbook lets you:

  • Fork any cell into multiple parallel branches
  • Run branches independently with separate outputs
  • Compare results side-by-side on a canvas
  • Converge branches back into a single cell
  • Drag nodes freely on a whiteboard-style canvas

Built for research workflows where you want to try multiple approaches without copying an entire notebook.

Quick start

Requires Python 3.10+ and Node 18+.

git clone https://github.com/yourname/forkbook
cd forkbook

# Windows
start-dev.bat

# Linux / Mac
./start-dev.sh

Frontend: http://localhost:5173
Backend: http://localhost:8000

Manual start

# Terminal 1 — backend
cd backend
python -m venv .venv
.venv/Scripts/activate      # Windows
# source .venv/bin/activate  # Linux/Mac
pip install -r requirements.txt
uvicorn app.main:app --reload

# Terminal 2 — frontend
cd frontend
npm install
npm run dev

Stack

Layer Tech
Backend FastAPI, SQLite, SQLAlchemy async, jupyter_client
Frontend React, Vite, React Flow, CodeMirror 6, Zustand, Tailwind
Execution Jupyter kernel (real Python, streaming output via WebSocket)

Architecture

  • One Jupyter kernel per notebook — shared state across all branches
  • Cells stored in SQLite with parent_id forming the tree
  • Run — executes ancestors then the cell
  • Run Only — executes just that cell
  • Run All — topological sort across all branches
  • WebSocket per notebook at /ws/{notebook_id} streams output live

License

Forkbook Core is licensed under the GNU Affero General Public License v3.0.

AGPL means: you can use, modify, and distribute the code freely, including commercially — but if you run a modified version as a network service, you must publish your source code under the same license.

Forkbook Cloud — team workspaces, cloud sync, version history, shared compute, AI assistant, and enterprise features — is a separate commercial product.

Contributing

Issues and pull requests are welcome. See CONTRIBUTING.md for guidelines.

About

Forkbook is Jupyter, but instead of one long vertical notebook, your experiment can split into branches and merge again.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors