Skip to content

symfonic.capabilities.prompting.identity

identity

Who the assistant is, as a typed contribution the kernel can render.

domain.name was refused to the migrated path on an argument that was correct and narrower than it looked: the kernel template declares no DOMAIN_NAME placeholder, so admitting the config field would have accepted a value changing not one byte the model reads. Legacy did not substitute it either — it seeded an AGENT_IDENTITY memory node whose prose reaches the model every turn. The gap was never a placeholder; it was the identity itself.

This module is that identity as a value. Three strings, and deliberately nothing else: the kernel side must not learn DomainTemplate's shape, so the translation from legacy configuration lives in the compatibility adapter and what arrives here knows nothing about where it came from.

Third person, and not as a matter of taste. Legacy's own comment records the finding: first-person prose ("My name is X") is misattributed to the user on "who am I?" turns, so the persona is written about the assistant rather than by it. The wording below is legacy's, byte for byte, because parity claimed on a paraphrase is not parity.

AgentIdentity dataclass

AgentIdentity(name: str, role: str = 'assistant', tone: str = 'helpful')

The assistant's name, role and tone.

from_domain_name classmethod

from_domain_name(name: str | None, *, role: str = 'assistant', tone: str = 'helpful') -> AgentIdentity

Apply legacy's own naming rule to a configured domain name.

Source code in src/symfonic/capabilities/prompting/identity.py
@classmethod
def from_domain_name(
    cls, name: str | None, *, role: str = "assistant", tone: str = "helpful"
) -> AgentIdentity:
    """Apply legacy's own naming rule to a configured domain name."""
    resolved = (name or "").strip()
    if not resolved or resolved == _STOCK_DOMAIN_NAME:
        resolved = _UNNAMED
    return cls(name=resolved, role=role, tone=tone)

render

render() -> str

The prose legacy seeded, unchanged.

Source code in src/symfonic/capabilities/prompting/identity.py
def render(self) -> str:
    """The prose legacy seeded, unchanged."""
    return (
        f"The assistant's name is {self.name}. Its role is {self.role} "
        f"and its tone is {self.tone}. "
        "(This describes the assistant itself, not the user.)"
    )

AgentIdentitySource dataclass

AgentIdentitySource(identity: AgentIdentity, untrusted: bool = False, offline_safe: bool = True, scope_aware: bool = False, options: dict[str, Any] = dict())

A ContributionSource that renders one :class:AgentIdentity.

Not frozen for the reason :class:~.hms.HmsSystemSource is not: ContributionSource declares offline_safe and scope_aware as settable attributes, which a frozen dataclass cannot satisfy.