/memgraph:memgraph-model-graph-datafrom memgraph
Designs graph data models for Memgraph using Labeled Property Graph (LPG) principles. Helps with schema design, property vs relationship decisions, and importing CSV/Parquet data.
Ships in memgraph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Memgraph uses the Labeled Property Graph (LPG) model: nodes and relationships both carry properties (key-value pairs), and nodes can have multiple labels.
(:Person:Student {name: "Alice", age: 20})-[:STUDIES {grade: "A"}]->(:Subject {name: "Math"})
Write down what the database is for - use case drives the model. Ask:
Nouns become nodes. Group similar entities under labels.
Verbs become relationships. Name them as actions: KNOWS, WORKS_ON, BELONGS_TO.
| Data describes... | Store as... |
|---|---|
| The entity itself | Node property |
| The connection | Relationship property |
| A shared category/concept | Separate node + relationship |
Write the queries you'll actually run. Use PROFILE to check the query plan.
If a query is slow or awkward, revisit the model.
(:Product {name: "Milk", price: 2.99, expirationDate: "2024-01-01"})
Anti-pattern - categories as array property:
(:Product {name: "Milk", categories: ["Dairy", "Organic"]})
This forces scanning every node's array to find shared categories.
Pattern - categories as nodes:
(:Product {name: "Milk"})-[:BELONGS_TO]->(:Category {name: "Dairy"})
(:Product {name: "Milk"})-[:BELONGS_TO]->(:Category {name: "Organic"})
Query for related products:
MATCH (:Product {name: "Milk"})-[:BELONGS_TO]->(c)<-[:BELONGS_TO]-(other:Product)
RETURN other.name;
When a shared-value node accumulates too many relationships (e.g., a Country
node connected to millions of Person nodes), it becomes a supernode -
traversals through it are expensive. Strategies:
Country + Region hierarchy)| Anti-pattern | Better pattern |
|---|---|
| Model every detail as nodes/relationships | Focus on key entities and direct relationships |
| Duplicate entity data on multiple nodes | Single canonical node + relationships |
| Categories/tags as array properties | Category/tag nodes with typed relationships |
| String dates and numbers | Temporal types (date(), datetime()) and toInteger() |
| No indexes on frequently queried properties | Targeted label and label-property indexes |
| Index every property | Index only hot query fields |
| SQL-style JOIN thinking | Traversal-first Cypher |
| Knowledge encoded only in query strings | Encode semantics in graph structure |
CREATE for bulk relationship import | MERGE + indexes + LIMIT |
Unconstrained cartesian MATCH (a), (b) | Filtered MATCH with indexes and limits |
| Design without profiling | PROFILE real queries during modeling |
A knowledge graph encodes domain knowledge in the graph structure so the graph itself is "readable as sentences."
Weak model - skills stored as property arrays:
MATCH (p:Person)-[:WORKS_ON]->(t:Task)
WHERE all(skill IN t.Skills WHERE skill IN p.Skills)
RETURN *;
Knowledge is in the query, not the graph.
Strong model - skills as nodes with semantic relationships:
(:Person)-[:HAS]->(:Skill)
(:Task)-[:NEEDS]->(:Skill)
(:Person)-[:WORKS_ON]->(:Task)
Find sufficient skills:
MATCH (p:Person)-[:HAS]->(s:Skill)<-[:NEEDS]-(t:Task)
WHERE exists((p)-[:WORKS_ON]->(t))
RETURN p.name, collect(s.name);
Find skill gaps:
MATCH (p:Project)-[:REQUIRES]->(s:Skill)
OPTIONAL MATCH (person:Person)-[:HAS]->(s)
WITH p, s, collect(person) AS people
WHERE size(people) = 0
RETURN p.name AS project, collect(s.name) AS missingSkills;
MATCH path=(pivot:Project {name: "Data Pipeline"})-[*..2]-(n)
RETURN path;
RAM ≈ nodes × 204B + edges × 154B + properties + indexes
| Prefer | Over | Why |
|---|---|---|
Integer | String numbers | Smaller, faster comparison |
Boolean | String "true"/"false" | Lightest type |
date(), datetime() | String dates | ~15B vs ~22B; enables temporal queries |
Enum | Repeated strings | Less memory, faster comparison |
ANALYZE GRAPH after data load| Mode | Best for |
|---|---|
IN_MEMORY_TRANSACTIONAL | Default - ACID, concurrent reads/writes |
IN_MEMORY_ANALYTICAL | Bulk import (up to 6x faster), analytics workloads |
Switch for bulk loading:
STORAGE MODE IN_MEMORY_ANALYTICAL;
-- bulk import here
STORAGE MODE IN_MEMORY_TRANSACTIONAL;
Create a manual snapshot before switching back: CREATE SNAPSHOT;
Map CSV columns to node properties. Identify which columns represent entities (nodes) vs connections (relationships).
CREATE INDEX ON :Person;
CREATE INDEX ON :Person(name);
LOAD CSV FROM "/path/data.csv" WITH HEADER AS row
CREATE (:Person {
name: row.Name,
age: toInteger(row.Age),
dob: date(row.Date_of_Birth)
});
CSV values are always strings - convert with toInteger(), toFloat(),
date(), toBoolean().
MATCH (a:Person {name: "Alice"}), (b:Person {name: "Bob"})
MERGE (a)-[:FRIENDS_WITH]->(b);
Use MERGE (not CREATE) to avoid duplicate relationships. Use LIMIT and
WHERE a <> b to control combinatorial explosion.
USING PERIODIC COMMIT 1000
LOAD CSV FROM "/path/data.csv" WITH HEADER AS row
CREATE (:Node {id: row.id, name: row.name});
| Feature | LPG (Memgraph) | RDF |
|---|---|---|
| Data structure | Labeled nodes/edges + properties | Subject-predicate-object triples |
| Schema | Flexible, optional | Ontology-driven (RDFS/OWL) |
| Query language | Cypher | SPARQL |
| Performance | Real-time traversal + analytics | Semantic web / linked data |
| Ease of use | Intuitive, developer-friendly | Standards-heavy |
Choose LPG when: real-time analytics, schema flexibility, graph algorithms, developer ergonomics.
Choose RDF when: linked data integration, semantic reasoning, ontology required.
PROFILE on real queriesWhat SKILL.md sets; muted values are Claude Code's defaults
memgraph@memgraph is listed by memgraph/marketplace — review the source before installing
npx claudepluginhub memgraph/marketplace --plugin memgraph14 skills in this plugin
/memgraph-brand-uiGenerate apps, demos, dashboards, diagrams, landing pages, and any visual output that looks like it belongs in the Memgraph product family. Use whenever producing UI, visual artifacts (Mermaid, SVGs, charts), Lab-style admin tools, internal dashboards, feature splash pages, or embeddable widgets for Memgraph engineers./memgraph-cpp-query-modulesDevelop custom query modules in C++ for Memgraph graph database. Use when creating high-performance graph algorithms, procedures (ProcedureType::Read/Write), or functions using the mgp.hpp C++ API. Covers compilation, memory management, graph traversal, and module deployment./memgraph-cypher-syntaxWrite Cypher queries for Memgraph, including Memgraph-specific extensions like deep path traversals (BFS, DFS, WSP, ASP, KSP with filter/weight lambdas), text and vector search, parallel execution, and CALL subqueries. Use when the user asks to write, fix, or optimize a Cypher query for Memgraph, or asks about Cypher syntax differences between Memgraph and Neo4j.Other plugins' skills for the same job