feat(web): memory related interface parameter transfer adjustment

This commit is contained in:
zhaoying
2026-01-26 11:04:30 +08:00
parent 988a41f5e4
commit 4f4f55d67f
5 changed files with 36 additions and 634 deletions

View File

@@ -1093,606 +1093,4 @@ export const groupDataByType = (data: any[], groupKey: string) => {
})
return grouped
}
export const mockTestResult = {
"generated_at": "2025-12-12T09:48:43.389893",
"entities": {
"extracted_count": 148
},
"dedup": {
"total_merged_count": 39,
"breakdown": {
"exact": 30,
"fuzzy": 0,
"llm": 9
},
"impact": [
{
"name": "记忆熊",
"type": "Person",
"appear_count": 9,
"merge_count": 8
},
{
"name": "宋朝",
"type": "Organization",
"appear_count": 5,
"merge_count": 2
},
{
"name": "军费",
"type": "EconomicMetric",
"appear_count": 2,
"merge_count": 1
},
{
"name": "学生",
"type": "Person",
"appear_count": 6,
"merge_count": 5
},
{
"name": "废除丞相制度",
"type": "Event",
"appear_count": 6,
"merge_count": 3
},
{
"name": "六部",
"type": "Organization",
"appear_count": 4,
"merge_count": 3
},
{
"name": "六部缺乏协调机制",
"type": "Concept",
"appear_count": 2,
"merge_count": 1
},
{
"name": "丞相",
"type": "Position",
"appear_count": 4,
"merge_count": 1
},
{
"name": "总理",
"type": "Position",
"appear_count": 2,
"merge_count": 1
},
{
"name": "各部委",
"type": "Organization",
"appear_count": 2,
"merge_count": 1
},
{
"name": "六部直接对皇帝负责",
"type": "AdministrativeStructure",
"appear_count": 2,
"merge_count": 1
},
{
"name": "秦国",
"type": "Organization",
"appear_count": 5,
"merge_count": 2
},
{
"name": "文官集团",
"type": "Organization",
"appear_count": 2,
"merge_count": 1
}
]
},
"disambiguation": {
"block_count": 1,
"effects": [
{
"left": {
"name": "节度使",
"type": "Role"
},
"right": {
"name": "节度使",
"type": "Person"
},
"result": "成功区分"
}
]
},
"memory": {
"chunks": 2
},
"triplets": {
"count": 88
},
"core_entities": [
{
"type": "Organization",
"type_cn": "组织",
"count": 16,
"entities": [
"厂卫机构",
"西厂",
"东厂",
"工部",
"地方军阀"
]
},
{
"type": "Event",
"type_cn": "事件",
"count": 12,
"entities": [
"均田制瓦解",
"无法批阅完所有政务",
"废除丞相制度",
"持续战争",
"政令执行困难"
]
},
{
"type": "Condition",
"type_cn": "Condition",
"count": 9,
"entities": [
"缺乏协作机制",
"作战效率低下",
"厢军装备不足",
"军权分散",
"军事专业化难以提升"
]
},
{
"type": "Person",
"type_cn": "人物",
"count": 8,
"entities": [
"官员",
"宦官",
"节度使",
"皇帝",
"文士"
]
},
{
"type": "Concept",
"type_cn": "Concept",
"count": 8,
"entities": [
"行政紧张",
"军力不足",
"秦国统一六国的原因",
"六部缺乏协调机制",
"专业分工"
]
},
{
"type": "Action",
"type_cn": "Action",
"count": 6,
"entities": [
"再花钱募兵",
"建立军功爵制度",
"裁撤兵员",
"削减装备",
"建立法律制度"
]
},
{
"type": "Outcome",
"type_cn": "Outcome",
"count": 5,
"entities": [
"打仗更吃亏",
"提升国家组织能力",
"降低行政效率",
"士兵效忠个人而非国家",
"政令推行困难"
]
},
{
"type": "EconomicMetric",
"type_cn": "EconomicMetric",
"count": 4,
"entities": [
"财政",
"财政支出",
"支出",
"军费"
]
},
{
"type": "Statement",
"type_cn": "Statement",
"count": 3,
"entities": [
"没有银子",
"禁军由文官控制导致作战效率低下",
"武器没材料"
]
},
{
"type": "State",
"type_cn": "State",
"count": 3,
"entities": [
"军队更弱",
"理解不足",
"不足"
]
},
{
"type": "HistoricalPeriod",
"type_cn": "HistoricalPeriod",
"count": 3,
"entities": [
"春秋战国史",
"唐朝史",
"宋朝"
]
},
{
"type": "Attribute",
"type_cn": "Attribute",
"count": 3,
"entities": [
"资源丰富",
"易守难攻",
"政策连续性强"
]
},
{
"type": "Right",
"type_cn": "Right",
"count": 3,
"entities": [
"军事指挥权",
"财政调度权",
"募兵权"
]
},
{
"type": "Policy",
"type_cn": "Policy",
"count": 2,
"entities": [
"商鞅变法",
"禁军由文官控制"
]
},
{
"type": "MilitaryCondition",
"type_cn": "MilitaryCondition",
"count": 2,
"entities": [
"军力不足",
"缺乏战略纵深"
]
},
{
"type": "Role",
"type_cn": "Role",
"count": 2,
"entities": [
"节度使",
"协调中枢"
]
},
{
"type": "Position",
"type_cn": "Position",
"count": 2,
"entities": [
"总理",
"丞相"
]
},
{
"type": "PoliticalCharacteristic",
"type_cn": "PoliticalCharacteristic",
"count": 2,
"entities": [
"旧贵族势力弱",
"中央集权程度高"
]
},
{
"type": "Phenomenon",
"type_cn": "Phenomenon",
"count": 1,
"entities": [
"宋朝军事弱势"
]
},
{
"type": "Factor",
"type_cn": "Factor",
"count": 1,
"entities": [
"制度性因素"
]
},
{
"type": "EconomicFactor",
"type_cn": "EconomicFactor",
"count": 1,
"entities": [
"财政压力"
]
},
{
"type": "EconomicIndicator",
"type_cn": "EconomicIndicator",
"count": 1,
"entities": [
"财政支出"
]
},
{
"type": "MilitaryStrategy",
"type_cn": "MilitaryStrategy",
"count": 1,
"entities": [
"对外战略被动"
]
},
{
"type": "MilitaryCapability",
"type_cn": "MilitaryCapability",
"count": 1,
"entities": [
"机动能力弱"
]
},
{
"type": "PersonGroup",
"type_cn": "PersonGroup",
"count": 1,
"entities": [
"武将"
]
},
{
"type": "EconomicCondition",
"type_cn": "EconomicCondition",
"count": 1,
"entities": [
"财政压力"
]
},
{
"type": "InstitutionalPolicy",
"type_cn": "InstitutionalPolicy",
"count": 1,
"entities": [
"废除丞相制度"
]
},
{
"type": "StateOfAffairs",
"type_cn": "StateOfAffairs",
"count": 1,
"entities": [
"中央决策高度集中于皇帝"
]
},
{
"type": "Institution",
"type_cn": "Institution",
"count": 1,
"entities": [
"科举"
]
},
{
"type": "Function",
"type_cn": "Function",
"count": 1,
"entities": [
"统筹大事小情"
]
},
{
"type": "AdministrativeStructure",
"type_cn": "AdministrativeStructure",
"count": 1,
"entities": [
"六部直接对皇帝负责"
]
},
{
"type": "AdministrativeProblem",
"type_cn": "AdministrativeProblem",
"count": 1,
"entities": [
"皇帝一人批不完政务"
]
},
{
"type": "Behavior",
"type_cn": "Behavior",
"count": 1,
"entities": [
"互相推诿责任"
]
},
{
"type": "Resource",
"type_cn": "Resource",
"count": 1,
"entities": [
"银子"
]
},
{
"type": "Situation",
"type_cn": "Situation",
"count": 1,
"entities": [
"没人拍板"
]
},
{
"type": "HistoricalState",
"type_cn": "HistoricalState",
"count": 1,
"entities": [
"秦国"
]
},
{
"type": "Location",
"type_cn": "地点",
"count": 1,
"entities": [
"关中"
]
},
{
"type": "HistoricalEvent",
"type_cn": "HistoricalEvent",
"count": 1,
"entities": [
"安史之乱"
]
},
{
"type": "PoliticalAction",
"type_cn": "PoliticalAction",
"count": 1,
"entities": [
"中央整顿"
]
},
{
"type": "PoliticalPhenomenon",
"type_cn": "PoliticalPhenomenon",
"count": 1,
"entities": [
"藩镇割据加剧"
]
},
{
"type": "EconomicEntity",
"type_cn": "EconomicEntity",
"count": 1,
"entities": [
"中央财政"
]
},
{
"type": "System",
"type_cn": "System",
"count": 1,
"entities": [
"募兵制"
]
},
{
"type": "WorkRole",
"type_cn": "WorkRole",
"count": 1,
"entities": [
"掌控禁军"
]
}
],
"triplet_samples": [
{
"subject": "记忆熊",
"predicate": "MENTIONS",
"predicate_cn": "提到",
"object": "宋朝军事弱势"
},
{
"subject": "宋朝军事弱势",
"predicate": "RESULTED_IN",
"predicate_cn": "resulted in",
"object": "制度性因素"
},
{
"subject": "记忆熊",
"predicate": "MENTIONS",
"predicate_cn": "提到",
"object": "禁军由文官控制导致作战效率低下"
},
{
"subject": "禁军由文官控制",
"predicate": "RESULTED_IN",
"predicate_cn": "resulted in",
"object": "作战效率低下"
},
{
"subject": "记忆熊",
"predicate": "MENTIONS",
"predicate_cn": "提到",
"object": "厢军装备不足"
},
{
"subject": "记忆熊",
"predicate": "MENTIONS",
"predicate_cn": "提到",
"object": "宋朝"
},
{
"subject": "记忆熊",
"predicate": "MENTIONS",
"predicate_cn": "提到",
"object": "军费"
}
],
"self_reflexion": [
{
"conflict": {
"data": [
{
"id": "76be6d82d8804beda6baa3d3447d6cbc",
"statement": "学生对\"六部缺乏协调机制\"的具体影响表示理解不足。",
"group_id": "group_123",
"chunk_id": "4a0804127d35456f86d4f06e1fa458f7",
"created_at": "2025-12-12 09:48:00.166068",
"expired_at": null,
"valid_at": null,
"invalid_at": null,
"entity_ids": []
}
],
"conflict": true,
"conflict_memory": {
"id": "e268a6fff35543fab471986c188e023e",
"statement": "学生对\"六部缺乏协调机制\"的具体影响表示理解不足。",
"group_id": "group_123",
"chunk_id": "e6cb5f56020e4a8d925d148e1d2fbda0",
"created_at": "2025-12-12 09:48:00.166068",
"expired_at": null,
"valid_at": null,
"invalid_at": null,
"entity_ids": []
}
},
"reflexion": {
"reason": "同一学生在不同时间点重复提出对'六部缺乏协调机制'具体影响的理解困难,表明原有解释未能有效解决其认知障碍,存在记忆冗余与教学反馈失效的冲突。",
"solution": "保留后出现的记忆记录chunk_id为4a0804127d35456f86d4f06e1fa458f7作为最新学习状态将其设为有效将前次相同内容的记忆id为e268a6fff35543fab471986c188e023e标记为失效避免重复干预并基于后续完整解释优化知识呈现逻辑。"
},
"resolved": {
"original_memory_id": "e268a6fff35543fab471986c188e023e",
"resolved_memory": {
"id": "e268a6fff35543fab471986c188e023e",
"statement": "学生对\"六部缺乏协调机制\"的具体影响表示理解不足。",
"group_id": "group_123",
"chunk_id": "e6cb5f56020e4a8d925d148e1d2fbda0",
"created_at": "2025-12-12 09:48:00.166068",
"expired_at": null,
"valid_at": null,
"invalid_at": "2025-12-12 09:48:00.166068",
"entity_ids": []
}
}
}
]
}
}