feat:客户agent以及记忆模块优化

This commit is contained in:
2026-09-12 19:56:48 +08:00
parent 30160128a4
commit 3103389aec
10 changed files with 86 additions and 54 deletions
+3 -6
View File
@@ -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,