Skip to content

Overview

nx-neptune is a Python library that brings graph analytics to your data lake. Project your data from Amazon S3 Tables, S3 Vectors, Databricks, Snowflake, OpenSearch, and other sources into Neptune Analytics for graph analysis — with results exported back to S3 or persisted as Iceberg tables.

nx-neptune exposes two distinct interfaces for different use cases:

Run graph algorithms on data that lives in your data lake — without moving it permanently into a graph database. The SessionManager API manages the full lifecycle: create, import, analyze, export, and destroy.

Supported data sources:

  • Amazon S3 Tables — query Iceberg tables via Athena SQL
  • Amazon S3 Vectors — project vector embeddings via a custom Athena connector
  • Databricks Unity Catalog — query via a JDBC-based Athena connector
  • Snowflake — query via the Athena Snowflake connector
  • Amazon OpenSearch — project embeddings from OpenSearch indices
  • Any source accessible through Athena federated queries

Session Manager docs

A NetworkX-compatible backend that lets you offload graph algorithm workloads to AWS with no code changes. Use familiar NetworkX APIs to seamlessly scale graph computations on-demand.

import networkx as nx
# Build a small social network
G = nx.DiGraph()
G.add_edges_from([
("Alice", "Bob"),
("Alice", "Carol"),
("Bob", "Carol"),
("Carol", "Dave"),
("Dave", "Alice"),
])
# Run PageRank on Neptune Analytics
scores = nx.pagerank(G, backend="neptune")
# Who's most influential?
top = sorted(scores.items(), key=lambda x: x[1], reverse=True)
for name, score in top:
print(f"{name}: {score:.4f}")

NetworkX Backend docs

  • Fraud detection — project financial transactions as a graph, run community detection (Louvain) to identify fraud rings
  • Product recommendation — project product catalogs with vector embeddings, run similarity search to find related items

Interactive Jupyter notebooks demonstrate each feature:

CategoryNotebooks
Algorithm demosPageRank, BFS, Degree, Closeness, Louvain, Label Propagation
Data lakeS3 Tables, S3 Vectors, Databricks, Snowflake, OpenSearch
Session managementSessionManager, Instance lifecycle