claude-memory/graph/solutions/converted-memorygraph-mcp-to-claude-code-skill-8e2d19.md

78 lines
2.9 KiB
Markdown

---
id: 8e2d1904-24e0-41df-95f2-2edc4407b9f3
type: solution
title: "Converted MemoryGraph MCP to Claude Code Skill"
tags: [pai, claude-code, memorygraph, skills, architecture, migration]
importance: 0.9
confidence: 0.8
created: "2025-12-07T06:50:12.011310+00:00"
updated: "2026-03-05T03:42:26.412611+00:00"
relations:
- target: ebc3e5af-b3d1-486b-9751-8ece841aa93f
type: RELATED_TO
direction: outgoing
strength: 0.5
context: "Both part of PAI skills infrastructure improvements in same session"
- target: 089f4cd8-4b2b-49a5-aac1-af2811b8ea7d
type: RELATED_TO
direction: incoming
strength: 0.8
edge_id: 34b6ee00-1113-479b-8e28-e39f347c6bc0
- target: 8023fae6-eec1-4c93-bac8-1bd85dd61bae
type: BUILDS_ON
direction: incoming
strength: 0.74
edge_id: b4b234af-a7be-4144-b965-75642070199f
- target: dfe48a70-b8ab-4bb5-a3d8-6116fa498168
type: RELATED_TO
direction: incoming
strength: 0.76
edge_id: 51e04dfd-be31-4d5e-ab33-04ce2858a18f
- target: 2d6f02bc-5a7c-404d-a566-36107aaaf6e6
type: RELATED_TO
direction: incoming
strength: 0.84
edge_id: 59a5076a-d69f-4356-ba53-d63310042d65
- target: 967ad46d-ba89-4207-b870-db4b8558f2bb
type: RELATED_TO
direction: incoming
strength: 0.82
edge_id: bea60777-40fd-4541-a0e3-a3d2998443c6
- target: 1177d1f5-6df7-42ae-beef-bbd6b22d2fae
type: RELATED_TO
direction: incoming
strength: 0.76
edge_id: e90568a0-c9d3-47a8-9a67-7c26fe7644fa
- target: 96a6c125-bb69-45af-b1b6-a9b48654fb7e
type: BUILDS_ON
direction: incoming
strength: 0.74
edge_id: 711859b9-fdf3-4b7d-80ec-9dc7668aea4f
- target: 1af571c5-cf7a-4e40-b324-6973b56f2502
type: RELATED_TO
direction: incoming
strength: 0.72
edge_id: 1005eb83-94ae-44dc-987a-4d2763b894e9
- target: 9f09eb50-682d-4018-88d0-19d38ac574ed
type: RELATED_TO
direction: incoming
strength: 0.64
edge_id: a583bd33-b3e2-4ecd-80d6-678126791989
---
Converted MemoryGraph from MCP server to Claude Code skill to reduce token cost. MCP tools were always in context (~45 tools eating tokens every turn). Skill loads on-demand only when triggered.
Implementation:
- Created ~/.claude/skills/memorygraph/ with client.py (620 lines), SKILL.md, SCHEMA.md, feature.json
- Direct SQLite access to ~/.memorygraph/memory.db bypassing MCP protocol
- JSON-based search instead of FTS (existing FTS index wasn't populated)
- CLI interface: store, recall, get, relate, search, update, delete, related, stats, recent
All 11 core operations implemented:
- store_memory, recall_memories, get_memory, create_relationship (high priority)
- search_memories, update_memory, delete_memory, get_related_memories (medium)
- get_memory_statistics, get_recent_activity (low)
Updated ~/.claude/CLAUDE.md Memory Protocol to use CLI commands instead of MCP tools.
Documentation saved to NoteDiscovery at reference/skills/memorygraph.