neo4j-gds-skill

Neo4j Graph Data Science (GDS) embedded plugin via Python client or Cypher — covers GraphDataScience, gds.v2 plugin endpoints, gds.version, native projection, Cypher projection, graph catalog operations, stream/stats/mutate/write modes, memory estimation, PageRank, Louvain, WCC, FastRP, KNN, Node Si

By neo4j-contrib · 570 installs

npx skills add neo4j-contrib/neo4j-skills --skill neo4j-gds-skill

Source repository · Upstream listing

When to Use Running GDS algorithms against embedded GDS plugin through Python client ( graphdatascience ) Running GDS algorithms through CALL gds. Cypher procedures Aura Pro, self managed Neo4j, local Neo4j, or offline DBMS with GDS plugin installed Projecting named in memory graphs, running centrality/community/similarity/path/embedding algorithms Chaining algorithms via mutate mode; building FastRP → KNN pipelines Writing node embeddings for Neo4j vector indexes / structural similarity search Memory estimation before large graph operations When NOT to Use Aura Graph Analytics Sessions / AGA / GdsSessions / AuraGraphDataScience → neo4j aura graph analytics skill AuraDB Cypher API with { memory: ... } or { sessionId: ... } → neo4j aura graph analytics skill Cypher query authoring → neo4j cypher skill Driver/connection setup → neo4j driver python skill GraphRAG retrieval → neo4j graphrag skill Creating/querying vector indexes over written embeddings → neo4j vector index skill Context Use Aura Pro with GDS plugin This skill Self managed/local/offline Neo4j with GDS plugin This skill AuraDB serverless analytics session neo4j aura graph analytics skill Self managed Neo4j attached to AGA session neo4j aura graph analytics skill Non Neo4j data source neo4j aura graph analytics skill Pre flight Use only with embedded GDS plugin. GDS plugin unavailable: client raises GdsNotFound at construction; Cypher raises Unknown function 'gds.version' . AuraDB serverless analytics → neo4j aura graph analytics skill . Self managed/local → install or enable GDS plugin. Compatibility: graphdatascience 2.1 / 2.2 — GDS = 2.13 and < 2.28 / < 2026.10; 2.0 — GDS < 2026.9. All: Python = 3.10 and < 3.15, Neo4j Python driver = 5.26 and < 7.0, pandas 2–3, pyarrow 21–25. GDS server < 2.13 → DeprecationWarning at construction; pin graphdatascience<2 (client 1.22) there. Client 1.x fallback (GDS server < 2.13) 2.0 1.x client gds.page rank , gds.louvain , … — no v2 prefix gds.v2.page rank , gds.v2.louvain , … gds.graph.project.native(...) gds.v2.graph.project(...) gds.graph.project.cypher(query) gds.graph.cypher.project(query, database=...) Graph / Model GraphV2 / ModelV2 gds.graph.drop(...) → list[GraphInfo] gds.v2.graph.drop(...) → single GraphInfo Graph.drop(fail if missing=) Graph.drop(failIfMissing=) run cypher(...) — always retries run cypher(..., retryable=...) Migration guide: [Neo4j GDS Python client 2.0 migration](https://neo4j.com/docs/graph data science client/current/migration from 1x/) GDS plugin releases track the server: 2026.09.0 requires Neo4j 2026.09 — check the [GDS compatibility table](https://neo4j.com/docs/graph data science/current/installation/supported neo4j versions/) before upgrading either side. GDS plugin 2026.07.0 removed CALL gds.userLog() — read hints and warnings from driver result summary notifications or the Neo4j debug log; track task progress with CALL gds.listProgress() . 2.0 client rules: Plain endpoints, no v2 prefix — untyped 1.x endpoints and gds.v2. are gone snake case parameters: page rank , fast rp , mutate property , write property Typed result attributes: result.write millis , not result["writeMillis"] ( stream still returns DataFrame) Server version via gds.server version() — no gds.version() client method (Cypher RETURN gds.version() still valid) Procedure aliases: gds.betweenness ≡ gds.betweenness centrality ; also gds.closeness , gds.degree , gds.eigenvector , gds.harmonic , gds.kcore Pipelines: gds.pipeline.node classification / link prediction / node regression — the only API in 2.0 gds.run cypher(query, auto commit=True) [2.1] for CALL { … } IN TRANSACTIONS — 2.0 default retryable transaction rejects it; on 2.0 use the Neo4j driver directly gds.db driver() [2.1] → underlying neo4j.Driver for custom sessions/transactions; closed by gds.close() only if client created it mode="READ" / "WRITE" strings accepted wherever QueryMode is [2.1] No async/job handle API on the plugin surface — compute() , async , gds.jobs are AGA Sessions only Graph Catalog Operations Native Projection Native projection: plugin/simple Python client workflow only. AGA Sessions → neo4j aura graph analytics skill . 1.x fallback: gds.v2.graph.project(...) . Cypher Projection (use for new Cypher workflows, filters, transforms) gds.graph.project.cypher(query) takes no database= — set GraphDataScience(..., database=...) at construction or call gds.set database(...) before projecting. Query must end with exactly one RETURN gds.graph.project(...) . If validation fails: use gds.run cypher(...) , then gds.graph.get("graphName") . 1.x fallback: gds.graph.cypher.project(query, database=...) . AGA Sessions → neo4j aura graph analytics skill ; never use plugin Cypher projection. Undirected Projection Native projection: set orientation: 'UNDIRECTED' per relationship type. Plugin Cypher projection: set undirectedRelationshipTypes: [' '] in fifth gds.graph.project(...) config argument. Leiden is defined for directed and undirected graphs. Project undirected relationships when community structure is naturally symmetric. Inspect and Drop Memory Estimation — run before large projections and algorithms Execution Modes Mode Side effect Returns Use when stream None Row per node/pair Inspect results; top N stats None Single aggregate row Summary/convergence check mutate Adds node property or relationship type/property to in memory graph only Stats row Chain algorithms write Persists node property or relationship to Neo4j DB Stats row Final step — make queryable Pattern: stream to verify → mutate to chain → write to persist. mutate property must not exist in the in memory graph. Relationship algorithms such as KNN also require mutate relationship type . After write , re project to use written properties in subsequent GDS calls (in memory graph does not see DB writes). gds.util.asNode() — Enrich Stream Results stream mode yields nodeId (internal GDS integer). gds.util.asNode(nodeId) translates it back to the DB node so you can access properties. Not needed for write , mutate , or stats modes — those don't return per node data. Core Algorithms PageRank (centrality) Louvain (community detection) Leiden is a refinement of Louvain avoiding poorly connected communities — use when community quality raw speed. modularity in stats result: range 0.5 to 1.0. [field] Values 0.3 often indicate meaningful community structure; 0.7 is strong. Leiden is defined for directed and undirected graphs. Project undirected relationships when community structure is naturally symmetric. WCC — Weakly Connected Components Run WCC first to understand graph structure; partition disconnected graphs before expensive algorithms. Betweenness Centrality Node Similarity Jaccard similarity from common neighbors — no node properties required. FastRP (node embeddings) Fast, scalable, production ML pipelines. Set randomSeed for reproducibility. For ANN search over structural embeddings, after write , create a Neo4j vector index over the written property. Use neo4j vector index skill . KNN — K Nearest Neighbors Finds k most similar nodes per node based on node properties (typically embeddings). FastRP → KNN Pipeline (recommendation) Algorithm Selection Goal Algorithm Influence via network links PageRank / ArticleRank Bottleneck / bridge nodes Betweenness Centrality Direct connections Degree Centrality Community (general, fast) Louvain Community (higher quality) Leiden Is graph connected? WCC (run first) Similarity from embeddings KNN Similarity from neighbors Node Similarity Shortest path (positive weights) Dijkstra / A k alternative paths Yen's Fast scalable embeddings FastRP Feature rich nodes GraphSAGE (client: gds.graph sage ; Cypher: gds.beta.graphSage ) Full algorithm catalog → [references/algorithms.md](references/algorithms.md) Common Errors Error Cause Fix Unknown function 'gds.version' Embedded GDS plugin unavailable AGA → neo4j aura graph analytics skill ; self managed/local → install plugin GdsNotFound at client construction GDS plugin not installed on target DB Install/enable GDS plugin; AuraDS endpoint only with GDS AttributeError: ... no attribute 'version' gds.version() does not exist in client 2.0 Use gds.server version() DeprecationWarning at client construction GDS server < 2.13 Upgrade GDS server, or pin graphdatascience<2 and use the 1.x mapping table Insufficient heap memory / OOM Graph too large for available JVM heap Run gds.graph.project.estimate ; increase server.memory.heap.max size Procedure not found: gds.leiden Older or incompatible GDS Check CALL gds.list() for available procedures; upgrade GDS or use Louvain Node property 'X' not found after mutate Property not projected or wrong graph name Verify G.node properties() includes the property; check mutate property spelling Graph 'myGraph' already exists Leftover projection from failed run overwrite=True , CALL gds.graph.drop('myGraph') , or gds.graph.drop(G) mutate property already exists Re running algorithm on same projection Drop and re project, or use different mutate property name No algorithm results Source/target node not in projection Verify node labels/rel types match projection; check G.node count() AttributeError: 'list' object ... after gds.graph.drop(...) 2.0 returns list[GraphInfo] Index the result; 1.x client returns a single GraphInfo A query with 'CALL { ... } IN TRANSACTIONS' can only be executed in an implicit transaction from run cypher 2.0 runs every query in a retryable managed transaction graphdatascience =2.1 + run cypher(query, auto commit=True) Full Workflow 1. Create gds with GraphDataScience(...) . 2. Verify plugin: gds.server version() or RETURN gds.version() . 3. Estimate memory: gds.graph.project.estimate(...) and algorithm .estimate(...) . 4. Project named graph with gds.graph.project.native(...) or gds.graph.project.cypher(query) . 5. Run gds. .stream first; switch to mutate ; use write only when satisfied. 6. Drop graph with gds.graph.drop(G) . 7. GDS server < 2.13 → client 1.22 via the mapping table above. Built in test datasets: gds.graph.datasets.load cora() , gds.graph.datasets.load karate club() , gds.graph.datasets.load imdb() MCP Tool Mapping Operation MCP tool RETURN gds.version() read cypher gds.pageRank.stream(...) read cypher gds.pageRank.write(...) write cypher gds.graph.drop(...) write cypher List available procedures read cypher → CALL gds.list() Before any write cypher : show exact Cypher, expected nodes/relationships affected, and ask for confirmation. For algorithm write mode, estimate or run stats first when available. References [references/algorithms.md](references/algorithms.md) — full algorithm catalog: all procedures, parameters, tiers, Cypher + Python examples [references/graph projection.md](references/graph projection.md) — projection deep dive: filtering, heterogeneous graphs, relationship orientation, property types [GDS Manual](https://neo4j.com/docs/graph data science/current/) [Python Client Docs](https://neo4j.com/docs/graph data science client/current/) Checkli