summaryrefslogtreecommitdiff
path: root/personal_agent/memory/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'personal_agent/memory/models.py')
-rw-r--r--personal_agent/memory/models.py13
1 files changed, 11 insertions, 2 deletions
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,
)