NeoSyntropyDocumentation

Core concepts

Groups organize nodes

A group is a named collection of nodes. It can also author an internal subgraph (nodes, routers, entry, edges) that compiles into the parent FSM. ControlManager still owns routing, validation, and state.

Organization, with optional authored flow

Groups name collections of nodes for organization and candidate metadata. A semantic edge may target a group to scope routing; when entry is set, entering the group lands on that entry state.

Authoring helpers (@group.node, routers, entry, add_edge) compile into the parent FSM. They do not create a second control path — one pipeline owns the sequence end to end.

Author a group subgraph

Python SDKpython
from neosyntropy import DeterministicRouter, EmptyOutput, Group, OpenInput, SemanticRouter

billing = Group(name="billing")

@billing.node(id="ValidateCard", input_schema=OpenInput, output_schema=EmptyOutput)
def validate(ctx):
    return ctx.result(output={}, state_updates={"card_valid": True})

@billing.node(id="ProcessPayment", input_schema=OpenInput, output_schema=EmptyOutput)
def pay(ctx):
    return ctx.result(output={})

@billing.node(id="SendReceipt", input_schema=OpenInput, output_schema=EmptyOutput)
def receipt(ctx):
    return ctx.result(output={}, next_state="End")

internal_logic = DeterministicRouter(
    id="BillingLogic",
    rules=[
        (lambda ctx: ctx.state.get("card_valid") is True, "ProcessPayment"),
        (lambda ctx: ctx.state.get("card_valid") is False, "RejectCard"),
    ],
)
post_pay = SemanticRouter(
    id="PostPayIntent",
    routes={"wants_receipt": "SendReceipt", "wants_refund": "ProcessRefund"},
)
billing.routers = [internal_logic, post_pay]
billing.entry = "ValidateCard"
billing.add_edge("ValidateCard", "BillingLogic")
billing.add_edge("ProcessPayment", "PostPayIntent")