feat:客户agent以及记忆模块优化
This commit is contained in:
@@ -140,13 +140,9 @@ class MemoryAwareClientAgent:
|
||||
|
||||
for index, candidate in enumerate(candidates):
|
||||
try:
|
||||
evidence_count = 1
|
||||
if candidate.get("signal_type") == "interest_query":
|
||||
count, reached = await self.memory_service.record_interest_signal(
|
||||
customer_id=customer_id,
|
||||
tag=candidate["tag"],
|
||||
)
|
||||
if not reached:
|
||||
continue
|
||||
# 兴趣主题首次出现即保存为候选,后续由长期记忆按精确内容合并证据。
|
||||
candidate["memory_type"] = "CUSTOMER_PREFERENCE"
|
||||
candidate["source"] = "dialogue_inferred"
|
||||
memory = MemoryUnitDTO(
|
||||
@@ -157,6 +153,7 @@ class MemoryAwareClientAgent:
|
||||
content=candidate["content"],
|
||||
source=candidate["source"],
|
||||
evidence_ref=[{"session_id": session_id, "query": query}],
|
||||
evidence_count=evidence_count,
|
||||
)
|
||||
_, save_warnings = await self.memory_service.save_memory(
|
||||
customer_id=customer_id,
|
||||
|
||||
Reference in New Issue
Block a user