From memory-graph
Operating protocol for the memory-graph MCP server. Load at session start so the agent runs `recall` before any task, persists findings with `record_finding` after solving, and uses the knowledge graph for relationships. Required reading for any agent paired with this plugin.
How this skill is triggered — by the user, by Claude, or both
Slash command
/memory-graph:memory-graphThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> The MCP server is the engine; this skill is the operating manual. Three pillars: **recall, record, link**. Anything else is sugar.
The MCP server is the engine; this skill is the operating manual. Three pillars: recall, record, link. Anything else is sugar.
recall(query="<the task in your own words>", top_k=5)
This single call searches across memories + KG + wiki by semantic similarity. If a result scores > 0.6, read it before doing the work. If top_canonicals is non-empty, expand the most relevant with wiki_get(canonical_id).
| Need | Call |
|---|---|
| Just past solutions | recall(query=..., scope="memories") |
| Just decisions/patterns | recall(query=..., scope="kg", node_type="Decision") |
| Just curated docs | recall(query=..., scope="wiki") |
| Expand a hit into full text | wiki_get(canonical_id) |
Rule: if
recallreturns a relevant result, USE it. Don't re-derive.
record_finding(
finding_type="solution", # solution | decision | insight | problem | pattern | context
title="Short, specific, searchable",
content="Symptom → cause → fix → validation. Terse but complete.",
related_files=["path/to/touched.py"],
tags=["domain", "subsystem"],
source_agent="<your-agent-name>",
)
One call does: vector memory + KG node + canonical_id dedup + tldr_32/brief_96 compression + auto-edges (cosine ≥ 0.62) + auto-promote at reuse ≥ 3 + auto-wiki on canonical.
| Type | When | Example |
|---|---|---|
solution | Bug fixed | "Fix: DuckDB lock → retry with backoff" |
decision | Design choice | "Decision: workspace-scoped DuckDB, never global" |
insight | Non-obvious pattern | "Insight: VS Code MCP customInstructions only fire on cold start" |
problem | Issue identified | "Problem: wiki_lint flags 12 orphaned pages" |
pattern | Reusable approach | "Pattern: recall before file-search saves 5+ tool calls" |
context | Resumable state | "Context: mid-migration v3→v4; halt at db.py:142" |
related_files.git log already captures them).Auto-edges (RELATED_TO) are inferred by record_finding. Add typed edges manually when meaningful:
kg_add_edge(from_id="solution.new", to_id="solution.old", rel_type="SUPERSEDES")
kg_add_edge(from_id="solution.x", to_id="problem.y", rel_type="SOLVES")
kg_add_edge(from_id="decision.a", to_id="decision.b", rel_type="DEPENDS_ON")
Valid types: SOLVES, CAUSED_BY, DEPENDS_ON, RELATED_TO, USES_TOOL, SUPERSEDES.
Traverse when you need lineage:
kg_neighbors(node_id="...", direction="both")
kg_path(from_id="problem.y", to_id="solution.x")
kg_influential(top_k=10, node_type="Decision")
collective_store(type="knowledge", key="api-contract-v2", value={...}, scope="project")
collective_get(key="api-contract-v2", scope="project")
TTLs: knowledge|result|consensus|system = permanent · context = 1h · task = 30m · error = 24h · metric = 1h.
Memoize expensive idempotent tool calls:
hit = cache_check(tool_name="lakehouse_sql_query", args_hash="ventas_q1")
if hit["hit"]:
return hit["result"]
# ... run ...
cache_store(tool_name="lakehouse_sql_query", args_hash="ventas_q1", result=json.dumps(r), ttl_seconds=3600)
record_finding(finding_type="solution", title=..., content=..., related_files=[...])kg_add_edge(from_id=<solution>, to_id=<problem>, rel_type="SOLVES") (optional)recall(query="prior decisions about <topic>")kg_influential(top_k=5, node_type="Decision")record_finding(finding_type="decision", title=..., content=...)kg_add_edge(from_id=<new>, to_id=<superseded>, rel_type="SUPERSEDES") if it replaces somethingrecall(query="<error message>", scope="memories") — past fixesrecall(query="<error keywords>", scope="kg") — related nodesrecord_finding(finding_type="solution", title="Fix: <error>", content="<root cause + fix>")memory_report() — healthrecall(query="recent context", top_k=3) — where we left offkg_influential(top_k=5) — most important decisionsThe retrieval quality of every other operation in this protocol depends on the embedding model. To change models safely:
embedding_status() # see active vs DB-stored + mismatch
embedding_benchmark(providers=[...]) # measure Recall@1/@5/MRR before swapping
embedding_migrate(target_provider="fastembed",
target_model="...",
dry_run=False) # re-embed everything under the new model
Never swap providers without migrating. Mixing vectors from different models silently breaks recall — cosine distances stop being comparable across models.
See PROTOCOL.md for the full operator manual.
memory_report() — counts + lint + top influentialmemory_consolidate(dry_run=False) — purge expired + recompute PageRank (weekly)wiki_bootstrap() — crystallize new canonicals (after large batches)recall because "I know what to do" — you don't know what the other agent decided last sprint.kg_add_node / wiki_crystallize for every node — record_finding handles both.memory_recall / kg_query as default — prefer recall (fused).Start of task → recall(query, top_k=5)
After solving → record_finding(type, title, content, files, tags)
Worth linking → kg_add_edge(from, to, rel_type)
Need full doc → wiki_get(canonical_id)
Share with agents → collective_store(type, key, value, scope)
Skip expensive call → cache_check → cache_store
Weekly cleanup → memory_consolidate(dry_run=False)
Health check → memory_report()
Searches MemPalace before answering questions about past work, people, projects, or prior decisions. Returns verbatim stored content instead of guessing from model memory.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Guides Payload CMS config (payload.config.ts), collections, fields, hooks, access control, APIs. Debugs validation errors, security, relationships, queries, transactions, hook behavior.
npx claudepluginhub brayanfz013/memory-graph-mcp --plugin memory-graph