/neo4j-skills:neo4j-aura-graph-analytics-skillfrom neo4j-skills
Provides guidance for Neo4j Aura Graph Analytics (AGA) GDS Sessions, including session creation, remote graph projection, algorithm execution, and lifecycle management for serverless graph analytics workloads.
Ships in neo4j-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
GdsSessions or using AuraGraphDataSciencegds.graph.project.remote(...){ memory: ... } or { sessionId: ... }neo4j-gds-skillneo4j-gds-skillneo4j-cypher-skillneo4j-snowflake-graph-analytics-skill| Deployment | Use |
|---|---|
| AuraDB Free | this skill — max m_2GB, 1 concurrent session, TTL max 30 min, session lifetime max 4 h, 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, lifetime max 7 days / 1 day |
| AuraDB + Python client sessions | this skill |
| AuraDB Free / Pro / BC / VDC + 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) |
graphdatascience >= 2.0 required; >= 2.4 recommendedv2 prefix — gds.page_rank.*, gds.graph.node_properties.*, gds.graph.construct(...)gds.verify_connectivity() after session creation — verifies session and, if attached, the source DBget_or_create(session_name=...)gds.delete() or sessions.delete(session_name=...) stops billingAuraAPICredentials.from_env() (reads CLIENT_ID, CLIENT_SECRET, PROJECT_ID) and DbmsConnectionInfo.from_env() — never hardcode credentialspip install "graphdatascience>=2.4" # 2.4 is the current stable release
2.0–2.2 require: Python >= 3.10, neo4j driver 5.26–7.0, pandas 2–3, pyarrow 21–25, numpy <3. 2.3: Python >= 3.11 and < 3.16 (3.10 dropped), pyarrow >= 22 and < 27 — stay on 2.2 for Python 3.10. 2.4: pyarrow >= 26.0.1 and < 27 (CVE-2026-111497 fix).
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
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.
2.3 additions: get_or_create attaches to Aura virtual graph instances (type auto-detected; pass uri= + aura_instance_id=); DbmsConnectionInfo(uri=...) used as-is for AuraDB instead of replaced by Aura API connection URL; graphs projected via AuraDB Cypher API usable from Python client and vice versa (preview); gds.graph.project.cypher on query matching no data reports no graph created.
2.4 additions: result_as_vector=True on fast_rp / node2vec / hash_gnn / graph_sage stream/mutate/write + session compute → Neo4j VECTOR values instead of LIST<FLOAT> (GDS 2026.11+); patience on graph_sage.train (early-stop after N consecutive epochs below tolerance, default 1); project.native accepts single string or list for labels/types/properties; page_rank.compute(username=...); QueryType / AlgorithmCategory are StrEnum → str(AlgorithmCategory.X) returns raw value, compares equal to string.
from graphdatascience.session import AuraAPICredentials, GdsSessions
sessions = GdsSessions(api_credentials=AuraAPICredentials.from_env())
# Reads: CLIENT_ID, CLIENT_SECRET, PROJECT_ID (optional) — NOT AURA_CLIENT_ID etc.
# Only AURA_* set → KeyError: 'CLIENT_ID'. Then build explicitly:
# AuraAPICredentials(os.environ["AURA_CLIENT_ID"], os.environ["AURA_CLIENT_SECRET"], os.environ.get("AURA_PROJECT_ID"))
# Create API credentials in Aura Console → Client credentials
Member of multiple projects or organizations: set PROJECT_ID or pass project_id= — 2.1 checks organizations first when deriving the default project.
from graphdatascience.session import AlgorithmCategory, SessionMemory
# Per-algorithm + config — preferred
memory = sessions.estimate(
node_count=1_000_000,
relationship_count=5_000_000,
algorithms=["wcc", "louvain", "fast_rp"],
)
# or with config:
memory = sessions.estimate(
node_count=1_000_000,
relationship_count=5_000_000,
algorithms={"fast_rp": {"embedding_dimension": 128}},
)
# Coarse category estimate — 1.x style, still available
memory = sessions.estimate(
node_count=1_000_000,
relationship_count=5_000_000,
algorithm_categories=[
AlgorithmCategory.CENTRALITY,
AlgorithmCategory.NODE_EMBEDDING,
AlgorithmCategory.COMMUNITY_DETECTION,
],
)
# Returns SessionMemory tier, e.g. SessionMemory.m_8GB
# Fixed tiers: m_2GB … m_512GB — see references/limitations.md
Mode A — AuraDB connected:
from graphdatascience.session import DbmsConnectionInfo, SessionMemory, CloudLocation
from datetime import timedelta
# Reads: AURA_INSTANCEID (takes precedence) or NEO4J_URI, plus NEO4J_USERNAME,
# NEO4J_PASSWORD, NEO4J_DATABASE
db_connection = DbmsConnectionInfo.from_env()
# Explicit: DbmsConnectionInfo(aura_instance_id=..., username=..., password=...)
# Virtual graph instance [2.3]: DbmsConnectionInfo(uri="neo4j+s://...", aura_instance_id=..., username=..., password=...)
gds = sessions.get_or_create(
session_name="my-analysis",
memory=memory,
db_connection=db_connection,
ttl=timedelta(minutes=30), # Free: max 30 min; Pro/BC/VDC: up to 7 days
)
gds.verify_connectivity()
Mode B — Self-managed Neo4j:
# Same from_env() — set NEO4J_URI (e.g. "bolt://my-server:7687"), no AURA_INSTANCEID
gds = sessions.get_or_create(
session_name="my-analysis-sm",
memory=SessionMemory.m_8GB,
db_connection=DbmsConnectionInfo.from_env(),
ttl=timedelta(hours=2),
cloud_location=CloudLocation("gcp", "europe-west1"),
)
gds.verify_connectivity()
Mode C — Standalone (no Neo4j DB):
gds = sessions.get_or_create(
session_name="my-standalone",
memory=SessionMemory.m_4GB,
ttl=timedelta(hours=1),
cloud_location=CloudLocation("gcp", "europe-west1"),
)
gds.verify_connectivity()
get_or_create() is idempotent; reconnects to existing session by name.
From connected Neo4j (remote projection):
query = """
CALL () {
MATCH (p:Person)
OPTIONAL MATCH (p)-[r:KNOWS]->(p2:Person)
RETURN p AS source, r AS rel, p2 AS target,
p {.age, .score} AS sourceNodeProperties,
p2 {.age, .score} AS targetNodeProperties
}
RETURN gds.graph.project.remote(source, target, {
sourceNodeLabels: labels(source),
targetNodeLabels: labels(target),
sourceNodeProperties: sourceNodeProperties,
targetNodeProperties: targetNodeProperties,
relationshipType: type(rel)
})
"""
G, result = gds.graph.project.cypher(
graph_name="my-graph",
query=query,
undirected_relationship_types=["KNOWS"],
)
print(f"Projected {G.node_count()} nodes, {G.relationship_count()} relationships")
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 with gds.graph.node_properties.stream(G, [...], db_node_properties=[...]) (attached sessions; see Step 7). Algorithm .stream() endpoints (e.g. gds.page_rank.stream) take no db_node_properties in client 2.x → TypeError: ... unexpected keyword argument 'db_node_properties'; mutate first, or join names back from the DB.
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:
G, result = gds.graph.project.native(
"my-graph",
["Person"], # node_label_filter
["KNOWS"], # relationship_type_filter
node_properties=["age", "score"],
undirected_relationship_types=["KNOWS"],
)
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:
CYPHER runtime=parallel
MATCH (source)
OPTIONAL MATCH (source)-->(target)
RETURN gds.graph.project(
'my-graph',
source,
target,
{},
{ memory: '2GB' }
)
Existing explicit session:
CYPHER runtime=parallel
MATCH (source)
OPTIONAL MATCH (source)-->(target)
RETURN gds.graph.project(
'my-graph',
source,
target,
{},
{ sessionId: '00000000-11111111' }
)
Cypher API uses gds.graph.project(...), not gds.graph.project.remote(...). Put memory, ttl, sessionId, batchSize in fifth config argument.
Cypher API works for sessions attached to AuraDB Free, Professional, Business Critical or VDC. Not supported: HITS, Topological Sort, Triangles listing, gds.graph.project.cypher, gds.graph.project.estimate, export/backup, gds.version (limitations). Models trained via Cypher API usable only in the same session. Size first with gds.session.estimate(...).
Session management via Cypher API:
CALL gds.session.getOrCreate('test-session', '2GB', duration({minutes: 30}))
YIELD id, name, status
RETURN id, name, status
CALL gds.session.list()
YIELD id, name, status, memory
RETURN id, name, status, memory
Implicit Cypher API sessions delete when all projected graphs in session are dropped.
From Pandas DataFrames (standalone mode):
import pandas as pd
nodes_df = pd.DataFrame([
{"nodeId": 0, "labels": "Person", "age": 30},
{"nodeId": 1, "labels": "Person", "age": 25},
])
rels_df = pd.DataFrame([
{"sourceNodeId": 0, "targetNodeId": 1, "relationshipType": "KNOWS"},
])
G = gds.graph.construct("my-graph", [nodes_df], [rels_df])
Required columns — nodes: nodeId (int), labels (str). Relationships: sourceNodeId, targetNodeId, relationshipType. Drop string node properties before construct() — sessions accept numeric properties only.
# Mutate — chain results without writing to DB
gds.page_rank.mutate(G, mutate_property="pagerank", damping_factor=0.85)
gds.fast_rp.mutate(G,
mutate_property="embedding",
embedding_dimension=128,
feature_properties=["pagerank"],
random_seed=42,
)
# Stream — inspect results as DataFrame
df = gds.page_rank.stream(G)
print(df.sort_values("score", ascending=False).head(10))
# Write — persist to connected Neo4j DB (connected modes only)
gds.louvain.write(G, write_property="community")
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.
Long-running algorithms — non-blocking compute() returns a JobHandle:
import time
job = gds.page_rank.compute(G, damping_factor=0.85) # algorithm config only — no mutate/write args
while not job.done():
time.sleep(5)
print(f"Job status: {job.status().status} {job.status().progress_percent()}")
if not job.status().succeeded(): # status string "done" / "aborted" / "running"
raise RuntimeError(f"Algorithm job failed: {job.status().status}")
df = job.stream(wait=False) # raises JobNotFinishedError if not done
# or: job.mutate(mutate_property="pagerank") / job.write(write_properties="pagerank") → WriteJobHandle
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:
gds.jobs.list() # JobInfo per job: job_id, name
handle = gds.jobs.get(G, job_id) # concrete handle type for the job
# Stream node properties
result_df = gds.graph.node_properties.stream(
G,
node_properties=["pagerank", "embedding"],
db_node_properties=["name"], # connected modes only — fetches string props from DB
)
result_df.head(10)
Standalone mode: no db_node_properties; join source DataFrame:
result_df = gds.graph.node_properties.stream(G, ["pagerank"])
result_df.merge(nodes_df[["nodeId", "name"]], how="left")
# Write node properties to connected Neo4j
gds.graph.node_properties.write(G, ["pagerank", "embedding"])
# Write relationship properties
gds.graph.relationships.write(G, "SIMILAR", ["score"])
# Query connected DB from session
gds.run_cypher("MATCH (n:Person) RETURN count(n)")
# Drop projected graph
gds.graph.drop(G)
# Delete session
sessions.delete(session_name="my-analysis")
# or: gds.delete()
Write before delete; unwritten results lost when session closes.
# List active sessions
from pandas import DataFrame
DataFrame(sessions.list())
# Reconnect to existing session
gds = sessions.get_or_create(session_name="my-analysis", memory=..., db_connection=...)
| Error | Cause | Fix |
|---|---|---|
KeyError: 'CLIENT_ID' | from_env() reads CLIENT_ID/CLIENT_SECRET, not AURA_* | Set those names or build AuraAPICredentials(...) explicitly |
AuraApiError (401/403) | Wrong or deleted client credentials, wrong project | Recreate in Aura Console → Client credentials; set PROJECT_ID |
RuntimeError getting an already-expired session | TTL exceeded | sessions.list() to check; recreate session |
SessionStatusError | Session failed or not usable | sessions.list() to check status; delete and recreate |
ValueError: A graph with name 'x' does not exist in the catalog. | 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 |
| Out of memory in session | 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 |
AuraApiError when creating session | AGA not enabled, or org memory/session cap reached | Org admin enables AGA / raises caps in Aura Console → organization settings |
TypeError: ... unexpected keyword argument 'db_node_properties' | Algorithm .stream() in client 2.x | mutate, then gds.graph.node_properties.stream(G, [...], db_node_properties=[...]) |
Load on demand:
| 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/ |
CLIENT_ID, CLIENT_SECRET, optional PROJECT_ID) — or AuraAPICredentials(...) built explicitlyAURA_INSTANCEID or NEO4J_URI, plus NEO4J_USERNAME, NEO4J_PASSWORD set for DbmsConnectionInfo.from_env()sessions.estimate(..., algorithms=[...]))gds.verify_connectivity() called after session creationgds.graph.project.cypher(graph_name, query) with gds.graph.project.remote(...) inside queryundirected_relationship_types passed as method args, never inside the querymemory or sessionIdgds.session.getOrCreate(...); implicit sessions dropped with projected graphjob.wait() or poll job.done(), then check job.status().succeeded() — never compare status to a stringsessions.delete(session_name=...) or gds.delete())What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub neo4j/agent-skills --plugin neo4j-skills30 skills in this plugin
/neo4j-agent-memory-skillAuthoritative reference for the neo4j-agent-memory Python package — a graph-native memory system for AI agents built on Neo4j — and for the hosted service (NAMS) at memory.neo4jlabs.com. Use this skill whenever the user mentions neo4j-agent-memory, agent memory with Neo4j, context graphs, the POLE+O model, MemoryClient/MemorySettings, the memory MCP server, or any of the framework integrations (LangChain, PydanticAI, CrewAI, AWS Strands, Google ADK, Microsoft Agent Framework, OpenAI Agents, LlamaIndex). Also use when the user mentions the hosted service at memory.neo4jlabs.com, NAMS, the Neo4j Agent Memory Service, the `nams_` API key prefix, or the hosted MCP endpoint. Also use when writing documentation, blog posts, tutorials, PRDs, or code samples for the project, when comparing agent memory approaches, or when positioning graph-native memory against vector-only approaches — even if the user doesn't explicitly name the package. Does NOT handle GraphRAG pipelines — use neo4j-graphrag-skill./neo4j-aura-agent-skillManages Neo4j Aura Agents via the v2beta1 REST API — create, list, get, update, delete, and invoke Aura agents backed by an AuraDB instance. Use when configuring Aura Agent tools (CypherTemplate, SimilaritySearch, Text2Cypher), setting system prompts, deploying agents to REST or MCP endpoints, invoking agents with natural language queries, or generating evaluation datasets (max 50 questions) for the Aura Agent evaluation feature. Covers OAuth2 auth, organization/project scoping, tool parameter schemas, and InvokeAgentResponse format. Does NOT cover AuraDB instance provisioning — use neo4j-aura-provisioning-skill. Does NOT cover vector index creation — use neo4j-vector-index-skill./neo4j-aura-provisioning-skillProvisions and manages Neo4j Aura instances via CLI (aura-cli v1.7+) or REST API. Use when creating, pausing, resuming, resizing, or deleting AuraDB Free/Professional/Business Critical/VDC instances; downloading credentials; scripting CI/CD pipelines; polling async status; or using the Terraform neo4j-labs/neo4jaura provider. Covers auth setup (client credentials OAuth2), credential lifecycle (download once — never recoverable), instance type selection, region codes, and Python provisioning scripts. Does NOT handle Cypher queries — use neo4j-cypher-skill. Does NOT cover Graph Data Science algorithms — use neo4j-gds-skill or neo4j-aura-graph-analytics-skill. Does NOT cover neo4j-admin/cypher-shell — use neo4j-cli-tools-skill./neo4j-cli-tools-skillUse when working with Neo4j command-line tools — neo4j-cli (modern unified CLI — Cypher via Bolt, schema inspection, Aura management, Docker containers, credential management, agent skill catalog install; install with curl -sSfL https://neo4j.sh/install.sh | bash), neo4j-admin (backup, restore, import, memory sizing), cypher-shell (ad-hoc queries, scripting, CI/CD), or neo4j-mcp (quick MCP server install). Does NOT cover Cypher query authoring — use neo4j-cypher-skill. Does NOT cover driver upgrades — use neo4j-migration-skill. Does NOT cover full MCP editor configuration — use neo4j-mcp-skill. Does NOT cover the relate embedded engine (relatedb.ai) — use the relate skill; choice guide in neo4j-getting-started-skill./neo4j-cypher-skillGenerates, optimizes, and validates Cypher 25 queries for Neo4j 2025.x and 2026.x. Use when writing new Cypher queries, optimizing slow queries, graph pattern matching, vector or fulltext search, subqueries, or batch writes. Covers MATCH, MERGE, CREATE, WITH, RETURN, CALL, UNWIND, FOREACH, LOAD CSV, SEARCH, expressions, functions, indexes, and subqueries. Does NOT handle driver migration or API changes — use neo4j-migration-skill. Does NOT cover DB administration or server ops — use neo4j-cli-tools-skill. Does NOT cover Cypher on the relate embedded engine — use the relate skill./neo4j-document-import-skillIngests unstructured and semi-structured documents into Neo4j as a knowledge graph. Use when chunking PDFs, HTML, plain text, or Markdown; extracting entities and relationships from text with an LLM (SimpleKGPipeline, neo4j-graphrag); loading JSON via apoc.load.json; building Document→Chunk→Entity graph structures; or connecting LangChain/LlamaIndex document loaders to Neo4j. Covers neo4j-graphrag SimpleKGPipeline, LLM Graph Builder web UI, entity resolution, chunking strategies, and graph schema design for RAG pipelines. Does NOT handle structured CSV/relational import — use neo4j-import-skill. Does NOT handle GraphRAG retrieval after ingestion — use neo4j-graphrag-skill. Does NOT handle vector index creation — use neo4j-vector-index-skill.Other plugins' skills for the same job