Skip to content

symfonic.capabilities.memory.procedural

procedural

Where a learned procedure is written, as something a composition root can ask for.

Phase 12 writes a draft skill and a reviewer approves it; both go through the graph the memory store already reads. This is the one function a deployment needs in order to have that store, and it exists so a composition root does not have to import symfonic.memory.layers.procedural -- a module with no __all__, and the reach past the public surface a generated project's own test refuses.

The same graph as the memory store, deliberately. A skill is a memory: it was extracted from this scope's turns, it is isolated by the same scope rule, and a second store would be a second answer to "what has this tenant learned".

procedural_layer

procedural_layer(graph: Any, **options: Any) -> Any

The procedural store over graph.

graph is the GraphBackend a composition root already has, or the GraphMemoryStore over it -- the same pair :func:~.phases.quick. phase_graph accepts, and for the same reason.

Imported inside the call: the layer pulls in the router, the predicates and the skill renderer, and a deployment that never learns a procedure should not pay for them in every import symfonic.agent.

Source code in src/symfonic/capabilities/memory/procedural.py
def procedural_layer(graph: Any, **options: Any) -> Any:
    """The procedural store over ``graph``.

    ``graph`` is the ``GraphBackend`` a composition root already has, or the
    ``GraphMemoryStore`` over it -- the same pair :func:`~.phases.quick.\
    phase_graph` accepts, and for the same reason.

    Imported inside the call: the layer pulls in the router, the predicates and
    the skill renderer, and a deployment that never learns a procedure should
    not pay for them in every ``import symfonic.agent``.
    """
    from symfonic.capabilities.memory.phases.quick import phase_graph
    from symfonic.memory.layers.procedural import ProceduralLayer

    return ProceduralLayer(phase_graph(graph), **options)