Install PyGX, write your first symbolic object, then pick the track that matches your work. This page is the front door — the complete guide, API reference, and runnable notebooks live in the full documentation.
PyGX requires Python 3.12+ and is published on PyPI under Apache 2.0. The hot paths run in a native Rust core (pygx-core, installed automatically) with wheels for Linux, macOS, and Windows on CPython 3.12–3.14 — including free-threaded 3.14t.
import pygx as pg
class Model(pg.Object, topo=True):
units: int = 8
def on_sym_ready(self):
super().on_sym_ready()
self.scale = self.units * 2 # derived state,
# never goes stale
class Trainer(pg.Object):
model: Model
lr: float = 0.01
t = Trainer(model=Model(units=128))
t.sym_init_args # the call, kept
t.sym_rebind({'model.units': 64}) # edit any depth
t.model.scale # 128 — recomputed, unasked
t.to_json_str() # round-trips to the real class
The guide is organized by what you're building. Each track is a topic-specific path through the same toolkit.
Late and partial binding, deep direct manipulation, context-aware components, declarative patching, and DSLs — useful well outside ML.
general · pg_object_style →Models, pipelines, and experiments expressed as symbolic trees — easy to log, diff, share, and recombine, with no separate spec language.
symbolic modeling · patching →Drop search into an existing program by replacing scalars with hyper primitives, then drive distributed search. Toy problems, industrial uses, and research.
toy · industrial · research →Populations are lists of symbolic programs and mutation is a rewrite of the structure itself — so one mutator works on a neural net, a tour of cities, or a symbolic expression.
onemax · tsp · function regression →The abstraction underneath PyGX: a symbolic object can be both executed and manipulated, and the two stay in sync. Conceptual material on the symbolic object model and symbolic detour — start here to understand why it works the way it does.
Learning hubGenerated from source — every public symbol, signature, and docstring.
Browse the API →Quality gates, conventions, and the pg.Object style guide for contributors.
Read the guide →The original PyGlove paper introducing symbolic programming for AutoML.
Read the paper →The full documentation has the complete guide, API reference, and runnable notebooks.