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 = 2.0 required; = 2.2 recommended
2.0 endpoints: no v2 prefix — gds.page rank. , gds.graph.node properties. , gds.graph.construct(...)
Use snake case parameters end to end
Call gds.verify connectivity() after session creation — verifies session and, if attached, the source DB
Estimate memory before large sessions
Set TTL; default 1h idle, max 7d (hard 7 day lifetime cap)
Close session when done: gds.delete() or sessions.delete(session name=...) stops billing
Use AuraAPICredentials.from env() and DbmsConnectionInfo.from env() — never hardcode credentials
Installation
2.0–2.2 require: Python = 3.10, neo4j driver 5.26–7.0, pandas 2–3, pyarrow 21–25, numpy <3.
Client 1.x (legacy)
2.0 renamed/reorganized the client. Pinned to 1.22 ( graphdatascience<2 )? Map:
1.x 2.0
gds.v2.<endpoint gds.<endpoint — v2 prefix gone; untyped 1.x endpoints removed
gds.graph.project(graph name, query) (remote) gds.graph.project.cypher(graph name, query)
gds.graph.project native(...) gds.graph.project.native(...)
GraphV2 / ModelV2 Graph / Model — from graphdatascience import Graph
Graph.drop(failIfMissing=) / Model.drop(failIfMissing=) fail if missing=
gds.v2.verify session connectivity() / gds.v2.verify db connectivity() gds.verify connectivity() — existed in 1.x too; v2 namespace gone
run cypher(..., retryable=) removed — always retries
gds.graph.project.cypher(database=...) removed — gds.set database(...) before projecting
gds.graph.node labels.mutate(write concurrency=, job id=) parameters removed
ArrowEndpointVersion.from arrow info check version compatibility
Migration guide: [Neo4j GDS Python client 2.0 migration](https://neo4j.com/docs/graph data science client/current/migration from 1x/)
2.0 additions: GdsSessions.estimate(algorithms=[...]) per algorithm memory; GdsSessions.get or create(show progress=...) ; keyword only GdsSessions.delete(session name= session id=) returns False when nothing deleted; overwrite=True on gds.graph.project / generate / construct / filter / sample drops a same named graph first; gds.graph.drop(...) accepts multiple graphs → list[GraphInfo] .
2.1 additions: gds.run cypher(query, auto commit=True) for CALL { … } IN TRANSACTIONS (2.0 default retryable transaction rejects it); gds.db driver() → session client's managed neo4j.Driver (closed by gds.close() ); mode="READ" / "WRITE" strings accepted for QueryMode .
Key Patterns
Step 1 — Authenticate
Member of multiple projects or organizations: set AURA PROJECT ID or pass project id= — 2.1 checks organizations first when deriving the default project.
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 must use gds.graph.project.remote(...) ; graph name goes to gds.graph.project.cypher(...) , not the query. Query containing gds.graph.project without .remote is auto rewritten with a warning. undirectedRelationshipTypes / inverseIndexedRelationshipTypes inside the query → ValueError — pass as method args.
Only numeric node properties can be projected into a session; fetch string properties via db node properties when streaming.
Standalone sessions cannot remote project — ValueError: Remote projection is only supported for attached Sessions.
1.x fallback: gds.graph.project(graph name=..., query=...) .
Native remote projection (no Cypher query) — gds.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.cypher 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() — sessions accept numeric properties only.
Step 5 — Run Algorithms
ML pipelines: gds.pipeline.node classification / link prediction / node regression — the only API in 2.0.
1.x fallback: gds.v2.page rank.mutate(...) ; untyped 1.x endpoints like gds.pageRank.mutate(...) are gone in 2.0.
Plugin algorithm reference → neo4j gds skill ; AGA limitations differ.
Step 6 — Async Job Polling
Long running algorithms — non blocking compute() returns a JobHandle :
Handle methods: .job id() , .status() → JobStatus ( .status , .progress , .succeeded() , .aborted() , .running() ), .done() , .wait( , termination flag=None) , .cancel() , .summary(wait=True) , .stream(wait=True) , .mutate(mutate property=..., wait=True) , .write(write properties=...) .
GraphSAGE prediction as job [2.2]: gds.graph sage.compute(G, model name) (classic model), gds.graph sage.supervised.compute(G, model name, feature properties) (adds predicted class , predicted probabilities ), gds.graph sage.unsupervised.compute(G, model name, feature properties) — each returns JobHandle ; materialize via .stream() / .mutate() / .write() .
Async projections return ProjectionJobHandle ( gds.graph.project.native async(...) , cypher async(...) ); write backs yield WriteJobHandle . 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
RuntimeError getting an already expired session TTL exceeded sessions.list() to check; recreate session
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.graph.project.cypher() or gds.graph.construct()
ValueError: Remote projection is only supported for attached Sessions. Standalone session cannot remote project Use gds.graph.construct(...) from DataFrames instead
NotAvailableInStandaloneSessions Feature needs an attached DB (e.g. gds.topological link prediction , remote projection) Attach a DB or pick another algorithm
Algorithm job FAILED Memory limit exceeded or unsupported algorithm Increase SessionMemory ; check NotAvailableOutsideAura for attached only features
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.graph.construct() ; fetch strings later via db node properties
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/
Client migration guide 1.x → 2.0 https://neo4j.com/docs/graph data science client/current/migration from 1x/
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 )
[ ] Connected sessions: AURA INSTANCEID or NEO4J URI , plus NEO4J USERNAME , NEO4J PASSWORD set for DbmsConnectionInfo.from env()
[ ] AGA feature enabled for Aura project (Aura Console → project settings)
[ ] Memory estimated before session creation ( sessions.estimate(..., algorithms=[...]) )
[ ] Cloud location chosen near data source
[ ] gds.verify connectivity() called after session creation
[ ] Remote projection uses gds.graph.project.cypher(graph name, query) with gds.graph.project.remote(...) inside query
[ ] Remote projection graph name passed to the endpoint, not the remote function
[ ] undirected relationship types passed as method args, never inside the query
[ ] 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(session name=...) or gds.delete() )