diff --git a/mateclaw-server/src/main/java/vip/mate/memory/MemoryProperties.java b/mateclaw-server/src/main/java/vip/mate/memory/MemoryProperties.java index cfac27e0..dec2aeef 100644 --- a/mateclaw-server/src/main/java/vip/mate/memory/MemoryProperties.java +++ b/mateclaw-server/src/main/java/vip/mate/memory/MemoryProperties.java @@ -138,5 +138,8 @@ public class MemoryProperties { /** Trust score half-life in days for time decay */ private int trustHalfLifeDays = 60; + + /** Enable UI Forget button on facts (Phase 3) */ + private boolean forgetEnabled = false; } } diff --git a/mateclaw-server/src/main/java/vip/mate/memory/fact/controller/FactController.java b/mateclaw-server/src/main/java/vip/mate/memory/fact/controller/FactController.java index 30e86b88..fc143f49 100644 --- a/mateclaw-server/src/main/java/vip/mate/memory/fact/controller/FactController.java +++ b/mateclaw-server/src/main/java/vip/mate/memory/fact/controller/FactController.java @@ -64,8 +64,8 @@ public class FactController { public R forgetFact(@PathVariable Long agentId, @PathVariable Long factId, Authentication auth) { - if (!properties.getFact().isProjectionEnabled()) { - return R.fail("Fact projection is disabled"); + if (!properties.getFact().isForgetEnabled()) { + return R.fail(410, "Forget is disabled"); } FactEntity fact = factMapper.selectById(factId); diff --git a/mateclaw-server/src/main/resources/application.yml b/mateclaw-server/src/main/resources/application.yml index 10c74240..7d5275b0 100644 --- a/mateclaw-server/src/main/resources/application.yml +++ b/mateclaw-server/src/main/resources/application.yml @@ -218,3 +218,4 @@ mate: llm-extraction-enabled: false contradiction-check-enabled: false trust-half-life-days: 60 + forget-enabled: false diff --git a/mateclaw-server/src/main/resources/prompts/memory/contradiction-batch.txt b/mateclaw-server/src/main/resources/prompts/memory/contradiction-batch.txt new file mode 100644 index 00000000..100ca947 --- /dev/null +++ b/mateclaw-server/src/main/resources/prompts/memory/contradiction-batch.txt @@ -0,0 +1,24 @@ +You are checking for contradictions between facts about the same entity. + +For each pair below, determine if they genuinely contradict each other. +A contradiction means the two facts CANNOT both be true at the same time. + +Pairs to check: +{pairs} + +For each pair, respond in JSON array format: +[ + { + "factA": , + "factB": , + "isContradiction": true|false, + "reason": "brief explanation" + } +] + +Rules: +- Temporal differences are NOT contradictions (e.g. "uses Oracle" and "migrating to PostgreSQL" can coexist) +- Different scopes are NOT contradictions (e.g. "dev uses H2" and "prod uses MySQL") +- Only flag genuine logical conflicts where both cannot be simultaneously true +- Maximum 5 pairs per batch +- Output ONLY the JSON array, no explanation outside it