Skip to content

symfonic.capabilities.prompting.extraction

extraction

Model-visible memory-extraction directives for the prompting compiler.

The directive is a normal authored contribution: it shares the compiler's budget and never parses or persists model output itself. Durable extraction is still owned by MemoryExtractionService composed beside prompting.

ExtractionDirectiveSource dataclass

ExtractionDirectiveSource(template_path: Path | None = None, cadence: int = 1, scope_path: str = '', untrusted: bool = False, offline_safe: bool = True, scope_aware: bool = True)

Render a custom or bundled extraction directive on its declared cadence.

extraction_contribution

extraction_contribution(source: ExtractionDirectiveSource, *, order: int = 900) -> Any

Declare the directive in L1, after stable system instructions.

Source code in src/symfonic/capabilities/prompting/extraction.py
def extraction_contribution(source: ExtractionDirectiveSource, *, order: int = 900) -> Any:
    """Declare the directive in L1, after stable system instructions."""
    from symfonic.capabilities.prompting.contracts import (
        ContributionScope,
        PromptContribution,
        TrustTier,
    )
    from symfonic.capabilities.prompting.layers import Layer

    return PromptContribution(
        contribution_id="memory.extraction.directive",
        source=source,
        capability="memory",
        layer=Layer.L1,
        tier=TrustTier.PLATFORM,
        scope=ContributionScope.TENANT,
        order=order,
    )