How to create and manage polygroups in geometry script?

For example, how “append box” on a polygroup index 0 and another “append box” on polygroup 1? I’m having difficulty using the “Set Polygroup Material ID” node.

image