You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
8
9
9
## [Unreleased]
10
10
11
+
### Features
12
+
13
+
-**`supersede()` / `mempalace_kg_supersede` — atomic fact replacement.** Closes an open fact and opens its successor at a single shared instant, so a point-in-time query at the boundary returns only the new value. This is the primitive for a single-valued fact change (model, employer, address) instead of hand-rolling `kg_invalidate` + `kg_add`, which left the two facts sharing the transition day. `at` defaults to the current UTC instant. (#1913)
14
+
15
+
### Bug Fixes
16
+
17
+
-**`kg query --as-of` no longer returns a superseded fact and its successor at the shared boundary.**`_temporal_filter_sql` now treats validity as half-open `[valid_from, valid_to)` (strict upper bound), so a fact whose `valid_to` equals the query instant has ended and only the successor matches. Standalone date-only facts still stay valid through the end of their final day (whole-day expansion retained). (#1913)
Copy file name to clipboardExpand all lines: mempalace/mcp_server.py
+74-1Lines changed: 74 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -381,6 +381,7 @@ def _parse_args():
381
381
{
382
382
"mempalace_kg_add",
383
383
"mempalace_kg_invalidate",
384
+
"mempalace_kg_supersede",
384
385
"mempalace_create_tunnel",
385
386
"mempalace_delete_tunnel",
386
387
"mempalace_delete_hallway",
@@ -1797,7 +1798,7 @@ def tool_status():
1797
1798
2. BEFORE RESPONDING about any person, project, or past event: call mempalace_kg_query or mempalace_search FIRST. Never guess — verify.
1798
1799
3. IF UNSURE about a fact (name, gender, age, relationship): say "let me check" and query the palace. Wrong is worse than slow.
1799
1800
4. AFTER EACH SESSION: call mempalace_diary_write to record what happened, what you learned, what matters.
1800
-
5. WHEN FACTS CHANGE: call mempalace_kg_invalidate on the old fact, mempalace_kg_add for the new one.
1801
+
5. WHEN A SINGLE-VALUED FACT CHANGES (model, employer, address): call mempalace_kg_supersede(subject, predicate, old, new) to replace it atomically at one boundary — do NOT hand-roll invalidate + add, which leaves the old and new values overlapping at the boundary. Use mempalace_kg_invalidate for a fact that simply ended, and mempalace_kg_add to add an independent (possibly concurrent) fact.
1801
1802
1802
1803
This protocol ensures the AI KNOWS before it speaks. Storage is not memory — but storage + this protocol = memory."""
"description": "Atomically replace a fact with its successor at a shared boundary. Use when a single-valued fact changes (model, employer, address) instead of separate kg_invalidate + kg_add — a point-in-time query at the boundary then returns only the new value.",
4033
+
"input_schema": {
4034
+
"type": "object",
4035
+
"properties": {
4036
+
"subject": {"type": "string", "description": "The entity whose fact is changing"},
4037
+
"predicate": {
4038
+
"type": "string",
4039
+
"description": "The relationship type (e.g. 'uses_model', 'works_at')",
4040
+
},
4041
+
"old_object": {"type": "string", "description": "The value being replaced"},
4042
+
"new_object": {"type": "string", "description": "The new value"},
4043
+
"at": {
4044
+
"type": "string",
4045
+
"description": "Boundary instant (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ, optional; defaults to now UTC)",
Copy file name to clipboardExpand all lines: website/reference/mcp-tools.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,22 @@ Mark a fact as no longer true.
263
263
264
264
---
265
265
266
+
### `mempalace_kg_supersede`
267
+
268
+
Atomically replace a fact with its successor at a single shared boundary. Use when a single-valued fact changes (model, employer, address) instead of a separate `mempalace_kg_invalidate` + `mempalace_kg_add` — a point-in-time query at the boundary then returns only the new value.
269
+
270
+
| Parameter | Type | Required | Description |
271
+
|-----------|------|----------|-------------|
272
+
|`subject`| string |**Yes**| Entity whose fact is changing |
0 commit comments