# Store Memory

> <%*

- Skill: `ses770227/store-memory` (Agent Skill)
- Install (CLI): `npx skillmds@latest add ses770227/store-memory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/ses770227/store-memory/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: ses770227 (https://skillmd.com/u/ses770227)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/ses770227/store-memory

---

<%*
// Configuration
const python = "/Users/samuelxiang/Library/Mobile Documents/iCloud~md~obsidian/Documents/SamHigh/Scripts/AgentSkills/.venv/bin/python";
const script = "/Users/samuelxiang/Library/Mobile Documents/iCloud~md~obsidian/Documents/SamHigh/Scripts/AgentSkills/obsidian_bridge.py";

// Get selection
const selection = tp.file.selection();
if (!selection) {
    new Notice("Please select text to store as memory!");
    return;
}

// Prompt for Entity name
const entity = await tp.system.prompt("Entity Name (e.g. Project X, John Doe):");
if (!entity) return;

// Escape arguments
const safeText = selection.split("\\").join("\\\\").split('"').join('\\"');
const safeEntity = entity.split("\\").join("\\\\").split('"').join('\\"');

const cmd = `"${python}" "${script}" store_memory "${safeText}" "${safeEntity}"`;

try {
    if (!tp.user.run_cmd) throw new Error("User function 'run_cmd' not found.");
    
    new Notice("Storing memory...");
    const result = await tp.user.run_cmd(cmd);
    tR += "\n" + result;
} catch (e) {
    tR += `
> [!error] Template Error
> ${e.message}`;
}

%>
