Skip to content

Session Manager

The SessionManager API manages the full lifecycle of a Neptune Analytics graph for data lake analytics: create → import → analyze → export → destroy.

This is the primary interface for the “Graph Over Data Lake” workflow — run graph algorithms on data that lives in your data lake without moving it permanently into a graph database.

  1. Define your data source — point to S3 Tables, Databricks, Snowflake, OpenSearch, or any Athena-accessible source

  2. Create a graph — SessionManager provisions a Neptune Analytics instance

  3. Import data — project your tabular data into graph form via Athena SQL queries

  4. Analyze — run graph algorithms (community detection, centrality, traversal) or explore with openCypher

  5. Export results — write results back to S3 or persist as Iceberg tables

  6. Destroy — tear down the graph when done (no ongoing cost)

SourceConnectorDemo
Amazon S3 TablesNative Athena SQLNotebook
Amazon S3 VectorsCustom Athena connectorNotebook
Databricks Unity CatalogJDBC-based Athena connectorNotebook
SnowflakeAthena Snowflake connectorNotebook
Amazon OpenSearchAthena OpenSearch connectorNotebook
Any Athena source25+ federated connectors

For data already in S3-compatible formats (CSV, Parquet), Neptune Analytics also supports native S3 import without Athena.

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

The SessionManager class is in nx_neptune/session_manager.py.

from nx_neptune.session_manager import SessionManager
session = SessionManager(
graph_id="my-graph",
region="us-west-2",
iam_role_arn="arn:aws:iam::123456789012:role/NeptuneRole",
s3_import_path="s3://my-bucket/import/",
s3_export_path="s3://my-bucket/export/",
)
# Create graph, import data, run algorithms, export, destroy

For explicit control over Neptune Analytics instance lifecycle (create, start, stop, delete), see the instance management module:

Configuration settings are handled through the NeptuneConfig class in nx_plugin/config.py.