Persistent Memory
Save important information and recall it later. Your AI can access stored context across sessions.
sm_ailib_save
sm_ailib_recall
Persistent memory, free image generation and token modes — all in one lightweight MCP server and skill bundle.
Each feature is a tool your AI calls only when it needs it.
Save important information and recall it later. Your AI can access stored context across sessions.
sm_ailib_save
sm_ailib_recall
Generate images from text prompts using Pollinations AI and save the results locally.
sm_ailib_img
Switch between six token modes, from strict minimal responses to maximum audit.
sm_ailib_level 0–5
Choose how much context your AI should use.
Ultra-minimal responses.
sm_ailib_0
Minimal senior developer style.
sm_ailib_1
More context for focused tasks.
sm_ailib_2
Balanced everyday reasoning.
sm_ailib_3
Expanded context for complex tasks.
sm_ailib_4
Maximum context for detailed audits.
sm_ailib_5
Your AI runs these for you. You can also type them in chat.
sm_ailib_save <content>
Save information to persistent memory.
sm_ailib_recall <query>
Search and recall saved information.
sm_ailib_img <prompt>
Generate an image from a text prompt.
sm_ailib_level <0–5>
Switch token mode. The shortcuts sm_ailib_0 to sm_ailib_5 work too.
In chat you can also use the skill aliases @sm_ailib_save,
@sm_ailib_recall, @sm_ailib_img and
@sm_ailib_0 to @sm_ailib_5.
About five minutes. You need Node.js 18+ and Git.
Paste this into Claude Code, OpenCode, or any agent that can read a repository.
Install this MCP server and skill bundle for me: https://github.com/sgdev-official/SM-AILIB?tab=readme-ov-file — read the README, run npm install, register the sm-ailib server with SM_AILIB_HOME set, then confirm the tools sm_ailib_save, sm_ailib_recall, sm_ailib_img and sm_ailib_level work.
Both commands should print a version.
node -v
git --version
Run these in a terminal, one after another.
git clone https://github.com/sgdev-official/SM-AILIB.git
cd SM-AILIB
npm install
Stay inside the SM-AILIB folder so the commands find server.js.
macOS / Linux
claude mcp add sm-ailib --env SM_AILIB_HOME="$HOME/.sm-ailib" -- node "$PWD/server.js"
Windows PowerShell
claude mcp add sm-ailib --env SM_AILIB_HOME="$HOME\.sm-ailib" -- node "$PWD\server.js"
Memory and images are stored in the folder set by SM_AILIB_HOME.
Change it if you want them somewhere else.
Add this to your opencode.json, replacing the path with the full path to server.js.
{
"mcp": {
"sm-ailib": {
"type": "local",
"command": ["node", "/full/path/to/SM-AILIB/server.js"],
"environment": { "SM_AILIB_HOME": "~/.sm-ailib" },
"enabled": true
}
}
}
Restart your client, then ask it to save a note and read it back.
sm_ailib_save test-it-works
sm_ailib_recall test
If the note comes back, you are done. To update later, run
git pull and npm install again.
SM-AILIB is an MCP server and local skill bundle that adds persistent memory, image generation and token modes to supported AI clients.
Claude Code and OpenCode today. Any client that can run a local
MCP server should work with the same node server.js command.
On your machine, in the folder set by SM_AILIB_HOME
(default ~/.sm-ailib). Nothing is sent anywhere.
Yes. The source is on GitHub under the Apache-2.0 licence.
Yes. Image generation uses Pollinations AI, so it depends on network availability and that service.
Clone it, connect it, and your next chat remembers the last one.
Install SM-AILIB