Interpret explicit memory identity for prompt admission, never infer from prose.
conversation_local
conversation_local(record: Any) -> bool
Raw episodes are transcript; classified events are durable memories.
Source code in src/symfonic/capabilities/memory/record_admission.py
| def conversation_local(record: Any) -> bool:
"""Raw episodes are transcript; classified events are durable memories."""
if record.layer is MemoryLayer.WORKING:
return True
if record.layer is not MemoryLayer.EPISODIC:
return False
identity, error = classification_identity(record.metadata, layer=record.layer)
return bool(error or identity is None or identity[0] != "past_event")
|
is_profile
is_profile(record: Any) -> bool
A declared human profile reserves a slot; malformed identity never does.
Source code in src/symfonic/capabilities/memory/record_admission.py
| def is_profile(record: Any) -> bool:
"""A declared human profile reserves a slot; malformed identity never does."""
if record.layer is not MemoryLayer.SEMANTIC:
return False
identity, error = classification_identity(record.metadata, layer=record.layer)
if error or identity is not None:
return not error and identity == ("profile", "user")
marker = str(record.metadata.get("label_prefix", "")).strip().upper()
text = record.text.lstrip().upper()
return marker == "SOUL" or text == "SOUL" or text.startswith(("SOUL ", "SOUL:"))
|