Hi
@eue! You may want to take a look at OCCT's OCAF (application framework) designed for keeping user's data between sessions and undo/redo the changes inside a session.
OCAF's capabilities are overviewed
here and
here. Also more information can be found in the official documentation.
In our projects we separate the initial data and the 3D presentations created on top of these data i.e. the presentations are transient objects that created/updated in response of changes of the permanent data that stored in OCAF. However, OCAF can deal with AIS_Shape-s directly, but keep in mind that it can be the source of oversized output file as the data are duplicated factually.