6.5 MiniHarness 记忆系统架构
6.5.1 存储层:MemoryEntry 与 MemoryStore
from datetime import datetime
from typing import List, Optional
class MemoryEntry:
"""包含 5 个维度的记忆条目"""
def __init__(self, memory_id: str, content: str,
memory_type: str = "episodic", # 类型划分
tags: List[str] = None,
confidence: float = 1.0, # 置信度
expiry: Optional[datetime] = None): # 过期时间
self.id = memory_id
self.content = content
self.type = memory_type
self.tags = tags or []
self.confidence = confidence
self.expiry = expiry
# 自动跟踪时间戳和版本
self.created_at = datetime.now()
self.last_modified = datetime.now()
self.version = 16.5.2 上下文组装:需求驱动的选择性加载
6.5.3 整合层:四阶段记忆巩固
6.5.4 系统集成要点
最后更新于
