Skip to content

symfonic.memory.orchestrator.config

config

OrchestratorConfig -- centralized configuration for the memory library.

Replaces all hardcoded values with a single frozen configuration object. Supports construction from environment variables or defaults.

OrchestratorConfig

Bases: BaseModel

Immutable configuration for the MemoryOrchestrator and its components.

All tunable parameters are centralized here. Construct via with_defaults() for quick setup or from_env() to read from environment variables prefixed with SYMFONIC_GRAPH_MEMORY_.

from_env classmethod

from_env() -> OrchestratorConfig

Create a config by reading SYMFONIC_GRAPH_MEMORY_ environment variables.

v8.0: the three legacy env vars (SYMFONIC_GRAPH_MEMORY_COMPACTION_THRESHOLD, SYMFONIC_GRAPH_MEMORY_LLM_MODEL, SYMFONIC_GRAPH_MEMORY_LLM_TEMPERATURE) were silent no-ops with a DeprecationWarning for many minor releases. They now raise ValueError at config-load time so silent-setters get a loud signal instead of an invisible warning.

Supported variables

SYMFONIC_GRAPH_MEMORY_DEFAULT_TOP_K

Source code in src/symfonic/memory/orchestrator/config.py
@classmethod
def from_env(cls) -> OrchestratorConfig:
    """Create a config by reading SYMFONIC_GRAPH_MEMORY_ environment variables.

    v8.0: the three legacy env vars
    (``SYMFONIC_GRAPH_MEMORY_COMPACTION_THRESHOLD``,
    ``SYMFONIC_GRAPH_MEMORY_LLM_MODEL``,
    ``SYMFONIC_GRAPH_MEMORY_LLM_TEMPERATURE``) were silent no-ops
    with a ``DeprecationWarning`` for many minor releases.  They
    now raise ``ValueError`` at config-load time so silent-setters
    get a loud signal instead of an invisible warning.

    Supported variables:
        SYMFONIC_GRAPH_MEMORY_DEFAULT_TOP_K
    """
    kwargs: dict[str, object] = {}

    top_k = os.environ.get(f"{_ENV_PREFIX}DEFAULT_TOP_K")
    if top_k is not None:
        kwargs["default_top_k"] = int(top_k)

    # v8.0: loud failure for the three legacy no-op vars.
    _removed = {
        "COMPACTION_THRESHOLD": (
            "Use SleepConsolidator phases instead."
        ),
        "LLM_MODEL": (
            "LLM model is controlled by AgentConfig.model."
        ),
        "LLM_TEMPERATURE": (
            "LLM temperature is controlled by AgentConfig.model.temperature."
        ),
    }
    for suffix, guidance in _removed.items():
        full_name = f"{_ENV_PREFIX}{suffix}"
        if os.environ.get(full_name) is not None:
            raise ValueError(
                f"{full_name} was removed in v8.0 (it has been a "
                f"silent no-op since the v6.x era).  {guidance}  "
                f"Unset the variable in your deployment env."
            )

    return cls(**kwargs)

with_defaults classmethod

with_defaults() -> OrchestratorConfig

Create a config with all default values.

Source code in src/symfonic/memory/orchestrator/config.py
@classmethod
def with_defaults(cls) -> OrchestratorConfig:
    """Create a config with all default values."""
    return cls()