Long-term memory for Pi, stored as notes in Linkly AI.
Tell Pi a lasting preference once, for example "from now on, write code comments in English". Pi saves it as a Linkly AI note tagged #记忆. Every new session starts with those notes in its system prompt, so Pi keeps following them without being reminded.
You need:
- Pi 1.0 or later, signed in to a model
- Linkly AI Desktop running, with the
linklyCLI installed. In the Desktop app, open the Agent usage page and click Install in the Linkly AI CLI row under Advanced, or runcurl -sSL https://updater.linkly.ai/cli/install.sh | sh
Then run:
pi mcp add linkly --url http://127.0.0.1:60606/mcp --exposure direct
pi install git:github.com/LinklyAI/pi-linkly-memory60606 is the default port. If pi mcp list doesn't show connected, run linkly status and use the MCP address it prints.
Start pi and state a preference. Pi saves it and tells you what it remembered. Open a new session and ask for something the preference applies to.
- Read. Before every agent run, the extension lists the notes tagged
#记忆with thelinklyCLI, reads them, and adds them to the system prompt as auser_memorysection, together with rules for when and how to save memories. Editing a memory in Linkly AI takes effect on the next message. - Write. Following those rules, the model saves and updates memories with the Linkly AI MCP tool
note_save. The rules tell it to update a memory that already covers the topic instead of creating a duplicate.
Memories are ordinary Linkly AI notes, so you can read, edit, or delete them in the app. To see them in one place, create a library and add a note filter for the 记忆 tag; matching notes are added automatically.
The extension loads up to 200 memories and puts up to 12,000 characters of them into the prompt in full. The rest are listed by title, and a memory longer than 200 lines is not included in full either; the model reads them when needed.
| Environment variable | Default | Meaning |
|---|---|---|
LINKLY_MEMORY_TAG |
记忆 |
Tag that marks memory notes |
LINKLY_CLI |
linkly |
Command or path of the Linkly AI CLI |
pi update git:github.com/LinklyAI/pi-linkly-memory
pi remove git:github.com/LinklyAI/pi-linkly-memoryRemoving the extension leaves your memory notes in Linkly AI.
Apache-2.0