neo4j-aura-graph-analytics-skill

Serverless Aura Graph Analytics (AGA) GDS Sessions — covers GdsSessions, AuraGraphDataScience, AuraAPICredentials, DbmsConnectionInfo, SessionMemory, get_or_create, remote graph projection with gds.v2.graph.project and gds.graph.project.remote, gds.v2 session endpoints, gds.v2.graph.construct, AuraD

By neo4j-contrib · 515 installs

npx skills add neo4j-contrib/neo4j-skills --skill neo4j-aura-graph-analytics-skill

Source repository · Upstream listing

When to Use Running GDS algorithms in Aura Graph Analytics GDS Sessions Creating GdsSessions or using AuraGraphDataScience Remote projecting connected Neo4j data with gds.graph.project.remote(...) Using AuraDB Cypher API projection with { memory: ... } or { sessionId: ... } Processing graph data from non Neo4j sources (Pandas, Spark, CSV) On demand / pipeline workloads — ephemeral sessions, pay per session minute Full isolation from the live database during analytics When NOT to Use Aura Pro with embedded GDS plugin → neo4j gds skill Self managed Neo4j with embedded GDS plugin → neo4j gds skill Writing Cypher queries → neo4j cypher skill Snowflake Graph Analytics → neo4j snowflake graph analytics skill Deployment Decision Table Deployment Use AuraDB Free this skill — max m 2GB , 1 concurrent session, unbilled Aura Pro + Graph Analytics plugin enabled (lightweight exploration, shared resources) neo4j gds skill Aura Pro / Pro Trial + session (isolated compute) this skill — up to 128 GB (Pro) / 8 GB (Pro Trial), 100 / 3 concurrent sessions AuraDB + Python client sessions this skill AuraDB + Cypher API this skill for AGA specific projection/session notes; neo4j cypher skill for query authoring Self managed Neo4j + AGA session this skill Self managed Neo4j + embedded plugin neo4j gds skill Non Neo4j data (Pandas, Spark) this skill (standalone mode) Defaults graphdatascience = 1.15 required; = 1.18 for Spark Prefer v2 endpoints: gds.v2.graph.project(...) , gds.v2.page rank. , gds.v2.graph.node properties. Use snake case parameters end to end; never mix v2 with camelCase params Use v1 if v2 endpoint missing/incompatible; label fallback Call gds.v2.verify session connectivity() after session creation Connected sessions: call gds.v2.verify db connectivity() when source DB access required Estimate memory before large sessions Set TTL; default 1h idle, max 7d Close session when done: gds.delete() or sessions.delete(name) stops billing Use AuraAPICredentials.from env() — never hardcode credentials Installation graphdatascience 2.0 (alpha) 2.0aN is pre release — pin <2 for production. Rename map for when 2.0 ships: 1.x 2.0 gds.v2.<endpoint gds.<endpoint — gds.v2 prefix gone; untyped 1.x endpoints removed gds.graph.project(...) (AGA) gds.graph.project.cypher(...) gds.graph.project native(...) (AGA) gds.graph.project.native(...) GraphV2 / ModelV2 Graph / Model — from graphdatascience import Graph Graph.drop(failIfMissing=) / Model.drop(failIfMissing=) fail if missing= run cypher(..., retryable=) removed — always retries ArrowEndpointVersion.from arrow info check version compatibility ServerVersion , SemanticVersion from top level graphdatascience.versions gds.graph.node labels.mutate(write concurrency=, job id=) parameters removed 2.0 minimums: GDS server 2.13, neo4j driver 5.26, pandas 2.x–3.x, pyarrow 21–25, numpy <3. 2.0 additions: GdsSessions.estimate(algorithms=[...]) for per algorithm memory; GdsSessions.get or create(show progress=...) ; gds.pipeline.get ; overwrite=True on gds.graph.project / generate / construct / filter / sample to drop a same named graph first; GdsSessions.delete(session id=...) returns False when nothing was deleted. Key Patterns Step 1 — Authenticate If member of multiple projects: set AURA PROJECT ID or pass project id= . Step 2 — Estimate Memory Step 3 — Create Session Mode A — AuraDB connected: Mode B — Self managed Neo4j: Mode C — Standalone (no Neo4j DB): get or create() is idempotent; reconnects to existing session by name. Step 4 — Project Graph From connected Neo4j (remote projection): CALL () { ... } required for multi pattern MATCH. Use UNION inside CALL for multiple labels/rel types. Remote query uses gds.graph.project.remote(...) ; pass graph name to gds.v2.graph.project(...) , not query. V1 fallback: gds.graph.project(graph name="my graph", query=query, undirected relationship types=["KNOWS"]) . Native remote projection (no Cypher query) [graphdatascience 1.22] — gds.v2.graph.project native(...) projects from the attached DB by label/type filter: Attached sessions only. Use project native for label/type filtered projections; use project(query=...) for transformations, computed properties, or UNION heterogeneous patterns. AuraDB Cypher API projection: Existing explicit session: Cypher API uses gds.graph.project(...) , not gds.graph.project.remote(...) . Put memory , ttl , sessionId , batchSize in fifth config argument. Session management via Cypher API: Implicit Cypher API sessions delete when all projected graphs in session are dropped. From Pandas DataFrames (standalone mode): Required columns — nodes: nodeId (int), labels (str). Relationships: sourceNodeId , targetNodeId , relationshipType . Drop string node properties before construct() . Step 5 — Run Algorithms V1 fallback: gds.pageRank.mutate(..., mutateProperty="pagerank") . Plugin algorithm reference → neo4j gds skill ; AGA limitations differ. ML pipelines in sessions [graphdatascience 1.22]: use gds.v2.pipeline.node classification , gds.v2.pipeline.link prediction , gds.v2.pipeline.node regression . gds.pipeline. emits a deprecation warning inside a GDS Session — use gds.v2.pipeline. . Step 6 — Async Job Polling Long running algorithms may return job handle. Poll until done: Large graphs: check .status() before reading results. Non blocking API [graphdatascience 1.22]: async projection variants (e.g. gds.v2.graph.project native async ) return a ProjectionJobHandle ; compute() returns a JobHandle , write back returns a WriteJobHandle . Handle methods: .job id() , .status() , .done() , .wait() , .result(wait=False) . List/recover jobs: Step 7 — Retrieve Results Standalone mode: no db node properties ; join source DataFrame: Step 8 — Write Back and Clean Up Write before delete; unwritten results lost when session closes. Session Management Common Errors Error Cause Fix AuthenticationError / 401 Wrong CLIENT ID / CLIENT SECRET Regenerate in Aura Console → Account → API credentials SessionNotFoundError Session expired (TTL exceeded) or name typo sessions.list() to check; recreate session GraphNotFoundError Projection dropped or session reconnected without re projecting Re run gds.v2.graph.project() or gds.v2.graph.construct() Algorithm job FAILED Memory limit exceeded or unsupported algorithm Increase SessionMemory ; check topological link prediction not used MemoryEstimationExceeded Graph larger than estimated Re estimate with actual counts; pick next tier up Results empty after session reconnect Results not written before session was closed Always write/stream before gds.delete() String node properties not supported String column in nodes DataFrame Drop string columns before gds.v2.graph.construct() AGA not enabled for project AGA feature not activated Enable in Aura Console → project settings References Load on demand: [references/workflows.md](references/workflows.md) — full AuraDB and standalone workflow examples, Spark integration [references/limitations.md](references/limitations.md) — AGA vs embedded GDS feature table, SessionMemory tiers, cloud locations WebFetch Need URL AGA Python client docs https://neo4j.com/docs/graph data science client/current/aura graph analytics/ AGA Cypher API docs https://neo4j.com/docs/graph data science/current/aura graph analytics/cypher/ Python client v2 docs https://neo4j.com/docs/graph data science client/current/v2 endpoints/ AuraDB tutorial notebook https://github.com/neo4j/graph data science client/blob/main/examples/graph analytics serverless.ipynb GDS algorithm reference https://neo4j.com/docs/graph data science/current/algorithms/ Checklist [ ] Aura API credentials created and set in environment ( AURA CLIENT ID , AURA CLIENT SECRET ) [ ] AGA feature enabled for Aura project (Aura Console → project settings) [ ] Memory estimated before session creation ( sessions.estimate(...) ) [ ] Cloud location chosen near data source [ ] gds.v2.verify session connectivity() called after session creation [ ] Connected sessions call gds.v2.verify db connectivity() when source DB access required [ ] Remote projection uses gds.v2.graph.project(..., query) with gds.graph.project.remote(...) inside query [ ] Remote projection graph name passed to endpoint, not remote function [ ] AuraDB Cypher API projection uses fifth config map for memory or sessionId [ ] Explicit Cypher API sessions use gds.session.getOrCreate(...) ; implicit sessions dropped with projected graph [ ] TTL set to avoid unexpected costs on idle sessions [ ] Async algorithm jobs polled until RUNNING DONE before reading results [ ] Results written back (connected modes) or streamed and persisted (standalone) before deletion [ ] Session deleted when done ( sessions.delete(...) or gds.delete() )