Skip to content

symfonic.capabilities.memory.semantic_create

semantic_create

Scoped semantic fact creation for public HTTP composition.

SemanticCreateService

SemanticCreateService(graph: Any, *, vectors: Any = None, embedder: Any = None)

Create a fact on the graph at the caller's resolved scope.

The graph backend stamps the scope path during insertion. The service never obtains an agent or derives a scope from request body data.

Source code in src/symfonic/capabilities/memory/semantic_create.py
def __init__(
    self, graph: Any, *, vectors: Any = None, embedder: Any = None,
) -> None:
    if (vectors is None) != (embedder is None):
        raise ValueError("semantic create needs a vector backend and embedder together")
    self._graph = GraphMemoryStore(graph)
    self._vectors = VectorRecall(vectors, embedder) if vectors is not None else None
    # Legacy HTTP creation removes credential-shaped keys, including in
    # metadata. Keep that wire contract while using the capability scrubber.
    self._scrubber = CredentialScrubber(value_patterns=())