Use MERGE to avoid duplicate nodes

Apply MERGE upserts to prevent duplicate nodes in FalkorDB graphs.

22|2|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/FalkorDB/skills --skill use-merge-to-avoid-duplicate-nodes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Use MERGE to avoid duplicate nodes
Source: https://github.com/FalkorDB/skills/tree/main/cypher-skills/use-merge-to-avoid-duplicates
Command: npx skills add https://github.com/FalkorDB/skills --skill use-merge-to-avoid-duplicate-nodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent duplicate graph nodes by teaching reliable idempotent upsert patterns with MERGE operations in FalkorDB.

Core Features & Use Cases

  • Idempotent Upserts: Use MERGE to create nodes only when they do not already exist.
  • Conditional Updates: Apply ON CREATE and ON MATCH clauses to handle new and existing records differently.
  • Use Case: Maintain a user graph where repeated imports update existing users instead of creating duplicate nodes.

Quick Start

Use the MERGE skill to create or update user nodes without generating duplicates in my FalkorDB graph.

Frequently Asked Questions about Use MERGE to avoid duplicate nodes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate nodes during graph data imports in FalkorDB?

To prevent duplicate nodes during graph data imports in FalkorDB, use idempotent upsert operations with the Cypher MERGE clause. MERGE ensures a node is only created if it does not already exist, keeping your graph duplicate-free.

What is the difference between ON CREATE and ON MATCH in Cypher MERGE workflows?

In Cypher MERGE workflows, ON CREATE executes property updates only when a new node is generated, while ON MATCH applies conditional updates to existing records. This allows handling new and existing graph entities differently within a single query.

How to perform idempotent upserts in a FalkorDB graph database?

Perform idempotent upserts in a FalkorDB graph database by executing MERGE statements. This pattern safely creates missing nodes or updates existing ones, ensuring repeated data imports do not generate duplicate graph entities.

Can I update existing user properties instead of creating duplicates in FalkorDB?

Yes, you can update existing user properties instead of creating duplicates in FalkorDB by combining the MERGE clause with ON MATCH. This conditionally updates existing graph entities during repeated data imports without generating duplicates.

When should I use MERGE instead of CREATE for node management in a graph database?

Use MERGE instead of CREATE for node management when you need idempotent operations that prevent duplicate nodes. CREATE will generate a new node every time, whereas MERGE safely upserts data, making it ideal for maintaining duplicate-free graphs.