MCPcopy Create free account
hub / github.com/Spinachead/arg / UserMemoryModel

Class UserMemoryModel

app/db/models/user_memory_model.py:6–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4from db.base import Base
5
6class UserMemoryModel(Base):
7 __tablename__ = "user_memory"
8
9 id = Column(UUID(as_uuid=False), primary_key=True, comment="记忆ID")
10 userId = Column(UUID(as_uuid=False), ForeignKey("users.id", ondelete="CASCADE"), name="userId", index=True, comment="用户ID")
11 memoryText = Column(String(1024), name="memoryText", comment="记忆内容摘要")
12 importance = Column(Integer, default=1, comment="重要程度 1-5")
13 lastUsedTime = Column(String(50), name="lastUsedTime", default=func.now(), comment="最近使用时间")
14 createdAt = Column(String(50), name="createdAt", default=func.now(), comment="创建时间")
15 metadata_ = Column(JSONB, name="metadata", default={})
16 threadId = Column(UUID(as_uuid=False), ForeignKey("threads.id", ondelete="SET NULL"), name="threadId", index=True, comment="线程ID")
17
18 def __repr__(self):
19 return f"<UserMemory(id='{self.id}', userId='{self.userId}', memoryText='{self.memoryText[:20]}...', importance={self.importance})>"

Callers 1

add_user_memoryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected