mempalace-pi
v0.1.0
Published
MemPalace extension package for pi, adding commands, tools, and save reminders for memory workflows.
Maintainers
Readme
MemPalace pi extension
A pi package that brings core MemPalace workflows to pi.
What it adds
- Slash commands:
/mempalace:help/mempalace:init/mempalace:search <query>/mempalace:mine [path]/mempalace:status/mempalace:doctor(custom rendered status panel)
- Agent tools:
mempalace_instructionsmempalace_initmempalace_searchmempalace_minemempalace_status
- MCP bridge:
- starts
python3 -m mempalace.mcp_serverwhen available - dynamically exposes MemPalace MCP tools to the agent
- uses MCP for
mempalace_statusandmempalace_searchwhen possible, with CLI fallback
- starts
- Session hooks:
- auto-save reminder every 15 non-command user messages
- pre-compaction reminder that blocks compaction until MemPalace save happens
Requirements
- Python 3.9+
mempalaceinstalled in the Python environment visible topython3,python, or themempalaceexecutable
Install in pi
Local package
From the package directory:
pi install .Or add the local path to .pi/settings.json / ~/.pi/agent/settings.json.
From npm
pi install npm:mempalace-piUsage
After installation, restart pi or run /reload, then use:
/mempalace:init/mempalace:status/mempalace:doctor/mempalace:search auth token rotation/mempalace:mine .
Publish to npm
Before publishing, confirm the package name is available:
npm view mempalace-pi nameThen publish:
npm publishPi will discover the package through the pi manifest in package.json.
Package structure
This package now follows a simple library-style layout:
mempalace-pi/
src/
index.ts # pi extension entrypoint
commands.ts # slash commands
hooks.ts # session and compaction hooks
renderers.ts # custom UI renderers
runtime.ts # shared runtime / MCP state
tools.ts # core tool registrations
utils.ts # CLI helpers and shared utilities
constants.ts # package constants
mcp-client.ts # internal MCP bridge helper
README.md
LICENSE
package.jsonThis avoids putting helper modules inside an auto-discovered extensions/ directory, which can cause pi to try loading non-extension files as extension entrypoints, and keeps the package closer to normal library structure best practices.
Notes
This extension now includes a built-in MCP bridge for mempalace.mcp_server, so pi agents can use the structured MemPalace tool surface when the MCP server is available. For compatibility, the package keeps CLI-backed fallbacks for setup, mining, and for status/search if MCP cannot be started.
If MEMPAL_DIR is set, the extension also kicks off a background mempalace mine "$MEMPAL_DIR" when an auto-save or pre-compact reminder triggers.
