Use Palimem with VS Code + Copilot Agent
Connect Palimem to VS Code (Copilot Agent and other VS Code MCP clients) using ai-memory connect vscode. The helper merges a memory-service stdio entry into .vscode/mcp.json.
Prerequisites
Section titled “Prerequisites”- VS Code with MCP support (Copilot Agent or compatible extension)
- Node.js 18+
- Repository cloned and Node dependencies installed:
Terminal window cd app && npm install
Recommended install
Section titled “Recommended install”From your repository root:
node app/scripts/ai-memory.js connect vscode \ --project-root "$(pwd)" \ --data-dir .ai-memory/dataThis writes .vscode/mcp.json in the project. Reload the VS Code window so MCP servers are picked up.
Config block
Section titled “Config block”The committed sample lives at examples/vscode-copilot-agent/.vscode/mcp.json.sample:
{ "servers": { "memory-service": { "type": "stdio", "command": "node", "args": ["/absolute/path/to/repo/app/scripts/memory-service-mcp.js"], "env": { "MEMORY_SERVICE_DATA_DIR": "/absolute/path/to/repo/.ai-memory/data" } } }}VS Code uses a top-level servers object (not mcpServers). Use absolute paths; ai-memory connect vscode resolves them automatically.
Verification
Section titled “Verification”- Reload VS Code after writing the config.
- Ask the agent to call
tools/list, thenmemory_statuswith scoperepositoryand your project namespace.
tools/list — expect 11 tools.
memory_status — expect ok: true and index_status.state: "current".
Smoke test (non-interactive):
bash examples/vscode-copilot-agent/demo/vscode-copilot-smoke.shAgent prompt
Section titled “Agent prompt”Paste this into Copilot Agent to configure Palimem:
Set up Palimem as governed local memory for this VS Code project.
- Project: Palimem (spec v1.7.0)- Run: node app/scripts/ai-memory.js connect vscode --project-root "$(pwd)" --data-dir .ai-memory/data- Verify: tools/list (11 tools), then memory_status — expect ok and index_status current
Use local data directory .ai-memory/data. Do not enable cloud services.CLI options
Section titled “CLI options”| Flag | Purpose |
|---|---|
--project-config PATH |
Target .vscode/mcp.json (default: <project-root>/.vscode/mcp.json) |
--project-root PATH |
Repo root for resolving script paths (default: $PWD) |
--data-dir PATH |
MEMORY_SERVICE_DATA_DIR resolved to absolute (default: .ai-memory/data) |
--replace |
Overwrite existing memory-service entry |
--dry-run |
Print merged JSON without writing |
Troubleshooting
Section titled “Troubleshooting”MCP server not listed in VS Code
Reload the window after writing .vscode/mcp.json. VS Code reads MCP config on startup.
ENOENT on memory-service-mcp.js
Run cd app && npm install to install the Node wrapper.
Existing entry refused
Re-run with --replace:
node app/scripts/ai-memory.js connect vscode \ --project-root "$(pwd)" --data-dir .ai-memory/data --replaceTools show 9 instead of 11
Pull the latest main and reinstall. memory_query_temporal and memory_audit_export were added in spec v1.6.0.
Seed memory (optional)
Section titled “Seed memory (optional)”python3 app/import_markdown.py \ --data-dir .ai-memory/data \ examples/markdown/USER.md.sample \ examples/markdown/MEMORY.md.sampleNext steps
Section titled “Next steps”- Copilot IDE — same
.vscode/mcp.jsonsurface for IDE Copilot hosts - Palimpsest model — how supersession and layered memory work
- MCP tools reference — all 11 tools with arguments