Repository navigation
feat(antigravity): add recall skill, optional rule, shared protocol #1771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
igorls
merged 2 commits into
MemPalace:develop
from
undeadindustries:feat/antigravity-support
Jun 11, 2026
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # MemPalace recall | ||
|
|
||
| Before answering anything that may already be in the user's memory | ||
| palace — past work, prior decisions, a person, a project, or "what did | ||
| we do / decide / discuss last time?" — search the palace first: | ||
|
|
||
| 1. Call `mempalace_search` with a short keyword query. Use | ||
| `mempalace_kg_query` for relational or time-bound facts. | ||
| 2. Quote the drawer's **verbatim** text. Never summarize or paraphrase | ||
| stored content. | ||
| 3. If results are empty, say so — do not invent an answer. If the MCP | ||
| server is unavailable, surface the error; do not fall back to guessing. | ||
|
|
||
| Skip recall for pure greenfield work with no memory relevance (renaming | ||
| a variable, fixing a typo). Recall is question-driven, not reflexive. | ||
|
|
||
| Full protocol: <https://github.com/MemPalace/mempalace/blob/main/integrations/shared/recall-protocol.md>. Deeper guidance: | ||
| the `mempalace-recall` skill. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| --- | ||
| name: mempalace-recall | ||
| description: "Recall protocol for MemPalace — search the palace before answering about past work, people, projects, or prior decisions. Apply when the user asks what was decided, what happened before, who someone is, what was discussed last time, or anything that may already be filed in their memory palace; or when mempalace-recall is invoked. Complements the mempalace setup skill and requires the mempalace-mcp server." | ||
| --- | ||
|
|
||
| # MemPalace Recall | ||
|
|
||
| Search-before-answer protocol for MemPalace. This skill makes the agent | ||
| read the user's memory palace before answering anything that may already | ||
| be filed there, instead of guessing from model memory. It complements | ||
| the `mempalace` skill, which covers install / mine / status; this one | ||
| covers recall only. | ||
|
|
||
| ## Step 0 — Verify MemPalace is available | ||
|
|
||
| Before relying on recall, confirm MemPalace is installed and reachable: | ||
|
|
||
| - Official release page: <https://github.com/MemPalace/mempalace/releases> | ||
| - Check installed: `mempalace --version` | ||
| - Do not assume a version — the MCP tool set is the source of truth for | ||
| what this installed build supports. | ||
|
|
||
| If the `mempalace_*` MCP tools are not available, tell the user the | ||
| server is not connected and point them at the `mempalace` skill to set | ||
| it up. Do not silently fall back to answering from model memory. | ||
|
|
||
| ## Identity | ||
|
|
||
| Act as a senior AI-memory systems engineer with decades of experience | ||
| building verbatim recall, semantic retrieval, and temporal knowledge | ||
| graphs. Verbatim recall from the palace always beats a confident guess | ||
| from model memory — wrong is worse than slow. | ||
|
|
||
| ## When to recall | ||
|
|
||
| Search the palace **before answering** whenever the user asks about | ||
| something that may already be filed: | ||
|
|
||
| - Past work or prior decisions — "what did we decide / try / do?" | ||
| - A person, project, or entity — "who is …", "what is …" | ||
| - An earlier session — "remember when …", "last time …", "the thing we | ||
| discussed" | ||
| - A preference, fact, or relationship that could have changed over time | ||
|
|
||
| Do **not** search on pure greenfield work with no memory relevance | ||
| (e.g. "rename this variable", "fix this typo"). Recall is | ||
| question-driven, not reflexive — a search on every turn wastes latency | ||
| and violates MemPalace's "memory should feel instant" budget. | ||
|
|
||
| ## Protocol | ||
|
|
||
| 1. On wake-up, the MemPalace PreInvocation hook injects verbatim palace | ||
| content via `injectSteps[].ephemeralMessage` on the first model call | ||
| of a conversation. If memory was injected, start from it before | ||
| searching further. | ||
| 2. Before responding about people / projects / past events / prior | ||
| decisions: call `mempalace_search` first. Use `mempalace_kg_query` | ||
| for relational or time-bound facts. | ||
| 3. If unsure about a fact: say "let me check the palace" and query. | ||
| 4. Return the drawer's **verbatim** text. Never summarize or paraphrase | ||
| stored content — quoting the exact words is the point of the system. | ||
| 5. After a substantive session, record continuity with | ||
| `mempalace_diary_write` (skip if a background hook already saved). | ||
| 6. When a fact changes: `mempalace_kg_invalidate` the old fact, then | ||
| `mempalace_kg_add` the new one. | ||
|
|
||
| The full canonical protocol — shared verbatim with the Antigravity | ||
| recall rule and the other integrations — lives in | ||
| [`integrations/shared/recall-protocol.md`](https://github.com/MemPalace/mempalace/blob/main/integrations/shared/recall-protocol.md). | ||
|
|
||
| ## Tool selection | ||
|
|
||
| | You need | Tool | | ||
| |---|---| | ||
| | Find any memory by meaning | `mempalace_search` (start here) | | ||
| | Relational / time-bound facts about an entity | `mempalace_kg_query` | | ||
| | The chronological story of an entity | `mempalace_kg_timeline` | | ||
| | Recent session continuity | `mempalace_diary_read` | | ||
| | Which wings / rooms exist (scope unknown) | `mempalace_list_wings`, `mempalace_list_rooms` | | ||
| | Record this session | `mempalace_diary_write` | | ||
|
|
||
| `mempalace_search` takes a short natural-language `query` (keywords or a | ||
| question — not a system prompt or pasted conversation) plus optional | ||
| `wing` / `room` filters and `limit` (default 5). | ||
|
|
||
| ## Unhappy paths | ||
|
|
||
| - **Empty results.** Say the palace has nothing on this; do not invent an | ||
| answer. Offer to widen the search (drop the `wing` filter) or to file | ||
| the new information. | ||
| - **MCP error / server down.** Surface the error and suggest the user | ||
| run `mempalace status` or re-run the installer | ||
| (`hooks/antigravity/install.sh`). Never fall back to guessing. | ||
| - **Conflicting facts.** Trust the knowledge graph's time-valid answer; | ||
| invalidate-then-add rather than overwriting silently. | ||
|
|
||
| ## Anti-patterns — never do these | ||
|
|
||
| - Answering about past work, people, or decisions from model memory when | ||
| the palace might know — search first. | ||
| - Paraphrasing or summarizing what the palace returns instead of quoting | ||
| it verbatim. | ||
| - Searching on every turn, including greenfield tasks with no memory | ||
| relevance. | ||
| - Pasting the whole conversation or a system prompt into the `query` | ||
| argument — keep queries short and keyword-driven. | ||
|
|
||
| ## Official References | ||
|
|
||
| - MemPalace: <https://github.com/MemPalace/mempalace> | ||
| - MemPalace releases: <https://github.com/MemPalace/mempalace/releases> | ||
| - Antigravity documentation: <https://antigravity.google/docs> | ||
| - Agent Skills specification: <https://agentskills.io/specification> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # MemPalace Recall Protocol | ||
|
|
||
| The canonical "search before answering" protocol shared across every | ||
| MemPalace integration (Cursor, Antigravity, Claude Code, Codex, | ||
| OpenClaw). This file is the single source of truth — skills and rules | ||
| should link here rather than restating the protocol, so the rule never | ||
| drifts from the skill. | ||
|
|
||
| The protocol exists to honour MemPalace's foundational promise: | ||
| **100% recall, verbatim, never guess.** When the palace might hold the | ||
| answer, the agent must read the palace before answering from model | ||
| memory. | ||
|
|
||
| ## When to recall | ||
|
|
||
| Search the palace **before answering** whenever the user asks about | ||
| anything that may already be filed: | ||
|
|
||
| - Past work, prior decisions, or "what did we do / decide / try?" | ||
| - A person, project, or entity ("who is …", "what is …") | ||
| - Something that happened in an earlier session ("remember when …", | ||
| "last time …", "the thing we discussed") | ||
| - A preference, fact, or relationship that could have changed over time | ||
|
|
||
| If the question is pure greenfield work with no memory relevance (e.g. | ||
| "rename this variable", "fix this typo"), do not search — recall is | ||
| question-driven, not reflexive. | ||
|
|
||
| ## The protocol | ||
|
|
||
| 1. **On wake-up** (if a session-start hook injected context, honour its | ||
| wing scoping): scope recall to the wing inferred from the workspace, | ||
| then continue. | ||
| 2. **Before responding** about people, projects, past events, or prior | ||
| decisions: call `mempalace_search` first. For relational or temporal | ||
| facts ("who reported to whom in March", "what was true then"), call | ||
| `mempalace_kg_query` instead or as well. | ||
| 3. **If unsure** about a fact (name, age, relationship, preference): say | ||
| "let me check the palace" and query. Wrong is worse than slow. | ||
| 4. **Return verbatim.** Quote the drawer's exact stored words. Never | ||
| summarize, paraphrase, or lossy-compress what the palace returns — | ||
| that is the whole point of the system. | ||
| 5. **After a substantive session**, record continuity with | ||
| `mempalace_diary_write` (background hooks may already do this — do not | ||
| double-file). | ||
| 6. **When a fact changes**, call `mempalace_kg_invalidate` on the old | ||
| fact, then `mempalace_kg_add` for the new one. | ||
|
|
||
| ## Tool selection | ||
|
|
||
| | You need | Tool | | ||
| |---|---| | ||
| | Find any memory by meaning | `mempalace_search` (start here) | | ||
| | Relational / time-bound facts about an entity | `mempalace_kg_query` | | ||
| | The chronological story of an entity | `mempalace_kg_timeline` | | ||
| | Recent session continuity | `mempalace_diary_read` | | ||
| | Which wings / rooms exist (when scope unknown) | `mempalace_list_wings`, `mempalace_list_rooms` | | ||
| | Record this session | `mempalace_diary_write` | | ||
|
|
||
| `mempalace_search` takes a short natural-language `query` (keywords or a | ||
| question — not a system prompt or pasted conversation) plus optional | ||
| `wing` / `room` filters and `limit` (default 5). | ||
|
|
||
| ## Unhappy paths | ||
|
|
||
| - **Empty results.** Say the palace has nothing on this; do not invent an | ||
| answer to fill the gap. Offer to widen the search (drop the wing | ||
| filter) or to file the new information. | ||
| - **MCP unavailable / tool error.** Surface the error plainly and suggest | ||
| the user verify the server (`mempalace status`, or re-run install). | ||
| Do not silently fall back to guessing from model memory. | ||
| - **Stale or conflicting facts.** Prefer the knowledge graph's | ||
| time-valid answer; if a fact has changed, invalidate the old one and | ||
| add the new one rather than overwriting context silently. | ||
|
|
||
| ## Anti-patterns | ||
|
|
||
| - Answering about past work, people, or decisions from model memory when | ||
| the palace might know — search first. | ||
| - Paraphrasing or summarizing stored content instead of quoting it | ||
| verbatim. | ||
| - Searching reflexively on every turn, including pure greenfield coding | ||
| with no memory relevance. | ||
| - Pasting the full conversation or a system prompt into the `query` | ||
| argument — keep queries short and keyword-driven. | ||
|
|
||
| ## See also | ||
|
|
||
| - [`integrations/openclaw/SKILL.md`](../openclaw/SKILL.md) — the original | ||
| full-protocol skill this is distilled from. | ||
| - MemPalace design principles (verbatim, local-first, never summarize): | ||
| <https://github.com/MemPalace/mempalace> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The protocol steps described here have already drifted from the canonical protocol defined in
integrations/shared/recall-protocol.md. For example:(name, age, relationship, preference)and the phrase"Wrong is worse than slow."which are missing here."Return verbatim. Quote the drawer's exact stored words. Never summarize, paraphrase, or lossy-compress..."whereas this skill uses"Return the drawer's verbatim text. Never summarize or paraphrase...".While some platform-specific details (like Antigravity's
PreInvocationhook in Step 1) are appropriate here, the core instructions, unhappy paths, and anti-patterns should be kept synchronized with the canonical source of truth to ensure consistent agent behavior across all integrations.