From c22cdbffa50ac634f7fecf080f3c3b5662e67131 Mon Sep 17 00:00:00 2001 From: batsumaru <> Date: Thu, 17 Sep 2026 11:07:06 +0900 Subject: Added importance --- personal_agent/memory/models.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'personal_agent/memory/models.py') diff --git a/personal_agent/memory/models.py b/personal_agent/memory/models.py index aab2064..957f16e 100644 --- a/personal_agent/memory/models.py +++ b/personal_agent/memory/models.py @@ -15,11 +15,20 @@ class LongTermMemory: content: str category: MemoryCategory created_at: datetime + importance: int @classmethod - def create(cls, content: str, category: MemoryCategory) -> LongTermMemory: + def create( + cls, content: str, category: MemoryCategory, importance: int = 2 + ) -> LongTermMemory: + if importance not in (1, 2, 3): + raise ValueError("importance must be between 1 and 3") return cls( - id=uuid7(), content=content, category=category, created_at=datetime.now(UTC) + id=uuid7(), + content=content, + category=category, + created_at=datetime.now(UTC), + importance=importance, ) -- cgit v1.3