Repository navigation
feat: integrate mempalace for long-term memory #27
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
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a3a6d56
feat: integrate mempalace as built-in plugin for long-term memory
dylanneve1 de9662e
refactor(dream): mine daily notes instead of raw logs, add diary writing
dylanneve1 38c9eda
fix: address PR #27 review comments
dylanneve1 7245f8f
fix: restore mempalace CLI diary writer, keep path quoting
dylanneve1 1144a74
test: add gating/validation tests for mempalace integration
dylanneve1 e4c4423
feat: upgrade mempalace system prompt with comprehensive tool docs
dylanneve1 e8b528b
refactor: extract mempalace prompt to prompts/mempalace.md
dylanneve1 edbaf63
fix: replace pixi.intel.com registry URLs in lockfile with npmjs.org
dylanneve1 dff4620
fix: resolve all lint warnings and formatting issues
dylanneve1 bc015c4
fix: address all 17 Copilot review comments on PR #27
dylanneve1 20f428a
fix: add 'mempalace' to LogComponent type
dylanneve1 4d020d0
fix: allow MCP tools in dream prompt when required by Stage 5
dylanneve1 0923934
fix: duplicate guard in registerPlugin, pass MCP servers to dream
dylanneve1 4af64f0
feat: add selective MCP server loading via 'only' filter
dylanneve1 210f2f0
fix: load mempalace prompt from dirs.prompts, fix dream systemPrompt
dylanneve1 877dd4a
fix: move duplicate check before validation, gate dream on plugin reg…
dylanneve1 717477e
fix(mempalace): correct CLI arg order for status check
dylanneve1 c7e292d
fix: address Copilot review round 8 — validation, error handling, unu…
dylanneve1 be69bc4
fix: remove config from message queue chain, fix pythonPath comment
dylanneve1 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,57 @@ | ||
| ## MemPalace — Long-term Memory | ||
|
|
||
| You have access to a local memory palace via MCP tools. The palace stores verbatim conversation history and a temporal knowledge graph — all local, zero cloud, zero API calls. | ||
|
|
||
| ### Architecture | ||
|
|
||
| - **Wings** = top-level categories (people, projects, topics) | ||
| - **Rooms** = specific subjects within a wing | ||
| - **Drawers** = individual memory chunks (verbatim text) | ||
| - **Knowledge Graph** = entity-relationship facts with temporal validity | ||
|
|
||
| ### Protocol — FOLLOW EVERY SESSION | ||
|
|
||
| 1. **BEFORE RESPONDING** about any person, project, or past event: call `mempalace_search` or `mempalace_kg_query` FIRST. Never guess — verify from the palace. | ||
| 2. **IF UNSURE** about a fact (name, age, relationship, preference): query the palace. Wrong is worse than slow. | ||
| 3. **WHEN FACTS CHANGE**: Call `mempalace_kg_invalidate` on the old fact, then `mempalace_kg_add` for the new one. | ||
| 4. **AFTER LEARNING** something important: store it. Use `mempalace_add_drawer` for rich context, `mempalace_kg_add` for structured facts. | ||
|
|
||
| ### Tools | ||
|
|
||
| **Search & Browse:** | ||
|
|
||
| - `mempalace_search` — Semantic search. Use short keywords/questions, not full sentences. Filter by wing/room. | ||
| - `mempalace_check_duplicate` — Check before filing new content (threshold default 0.9, lower to 0.85 to catch near-dupes). | ||
| - `mempalace_status` — Palace overview: total drawers, wings, rooms. | ||
| - `mempalace_list_wings` / `mempalace_list_rooms` — Browse structure. | ||
| - `mempalace_get_taxonomy` — Full wing/room/count tree. | ||
|
|
||
| **Knowledge Graph (Temporal Facts):** | ||
|
|
||
| - `mempalace_kg_query` — Query entity relationships. Supports `as_of` date filtering. | ||
| - `mempalace_kg_add` — Add fact: subject -> predicate -> object. Optional `valid_from`. | ||
| - `mempalace_kg_invalidate` — Mark a fact as no longer true. | ||
| - `mempalace_kg_timeline` — Chronological story of an entity. | ||
| - `mempalace_kg_stats` — Graph overview: entities, triples, relationship types. | ||
|
|
||
| **Palace Graph (Cross-Domain Connections):** | ||
|
|
||
| - `mempalace_traverse` — Walk from a room, find connected ideas across wings. | ||
| - `mempalace_find_tunnels` — Find rooms that bridge two wings. | ||
| - `mempalace_graph_stats` — Graph connectivity overview. | ||
|
|
||
| **Write:** | ||
|
|
||
| - `mempalace_add_drawer` — Store verbatim content into a wing/room. Auto-checks duplicates. | ||
| - `mempalace_delete_drawer` — Remove a drawer by ID. | ||
| - `mempalace_diary_write` — Write a session diary entry (agent_name, entry, topic). | ||
| - `mempalace_diary_read` — Read recent diary entries. | ||
|
|
||
| ### Tips | ||
|
|
||
| - Search is **semantic** (meaning-based), not keyword. "What did we discuss about database performance?" works better than "database". | ||
| - The knowledge graph stores typed relationships with **time windows**. It knows WHEN things were true. | ||
| - Use `mempalace_check_duplicate` before storing new content to avoid clutter. | ||
| - Diary entries accumulate across sessions. Write them to build continuity of self. | ||
|
|
||
| ### Palace location: `{{palacePath}}` |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.