memgraph/skills/memgraph-cypher-syntax
- community
Checking that the SKILL.md file is still in the repository.
Write 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.
Install
npx vskill@latest install memgraph/skills/memgraph-cypher-syntaxSKILL.md
Writing Cypher for Memgraph
Memgraph implements openCypher with several extensions. This skill covers Memgraph-specific syntax and patterns that differ from standard Neo4j Cypher.
Clauses quick reference
Read
Write
Control
Analysis
MATCH patterns
Label matching
Label OR (|) cannot be used in CREATE or MERGE.
Variable-length paths
Deep path traversals (Memgraph-specific)
Built-in C++ traversal algorithms using relationship expansion syntax.
BFS (unweighted shortest)
DFS (all paths)
Weighted shortest path (WSP)
All shortest paths (ASP)
K shortest paths (KSP)
Source/target must be matched first, then passed via WITH:
Filter lambdas
2-argument (r, n | predicate) -- r is the relationship, n is the target node:
3-argument (r, n, p | predicate) -- p is the current path:
WSP/ASP with filter (4-argument adds w for current weight):
Hop limits
CALL subqueries
Scoped import (v3.5+):
Batching writes:
LOAD CSV / LOAD PARQUET
CSV values are always strings -- cast with toInteger(), toFloat(), date().
Periodic commit
ACID only per batch. Avoid concurrent writes during periodic execution.
Parameters
Use $paramName syntax (NOT curly braces):
Label parameterization (v3.1+):
Property map in CREATE only (not MATCH/MERGE):
Text search
Property names in queries use data. prefix. Boolean operators: AND, OR, NOT.
Vector search
Metrics: l2sq (default), cos, ip, pearson, haversine, hamming, jaccard.
Parallel execution (Enterprise)
Best for aggregation queries on scan operators. Requires priority_queue scheduler.
Schema procedures
Requires --schema-info-enabled=true.
TTL (Enterprise)
Reserved label TTL, reserved property ttl (microseconds since epoch).
Expressions
String predicates
CASE
exists() cannot be used inside CASE.
Pattern comprehension
List comprehension
Existential subqueries
Query optimization
Key operators in PROFILE output
| Operator | Meaning | Action | |
|---|---|---|---|
ScanAll | Full scan | Add indexes | |
ScanAllByLabel | Label index | OK for label-only queries | |
ScanAllByLabelProperties | Label+property index | Best | |
EdgeUniquenessFilter | Cyphermorphism | Split MATCH if unwanted | |
Cartesian | Cartesian product | Ensure smaller set is left branch |
Index hinting
Analyze graph (run after data load)
Reduce roundtrip
Use project(path) to deduplicate nodes in path results:
Return only needed data:
Efficient deletes (large graphs)
Never MATCH (n) DETACH DELETE n on >1M nodes (Delta memory spike).
Key differences from Neo4j
| Feature | Neo4j | Memgraph | ||
|---|---|---|---|---|
| Shortest path | shortestPath(...) | -[*BFS]-> | ||
| K shortest | SHORTEST k | `-[*KSHORTEST\ | k]->` | |
| Fixed length | --{2}-- | -[*2]- | ||
| NOT label | WHERE NOT n:Label | WHERE NOT n:Label (same since v3) | ||
elementId() | Returns string | Use id() (integer) | ||
| COUNT/COLLECT subquery | Supported | Use count()/collect() aggregations | ||
| Type predicate | val IS :: INTEGER | valueType(val) = "INTEGER" | ||
| Index creation | Sometimes auto | Always manual (unless flag enabled) | ||
| Constraint naming | Stored | Parsed but not stored (warning) |
Additional resources
- For the complete built-in function catalog, see REFERENCE.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/memgraph-cypher-syntax/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/memgraph/skills/memgraph-cypher-syntax)