AWS Neptune Graph Sessions: Scalable, Cost-Effective Graphs for AI Agents
Home/Blog/Tech/AWS Neptune Graph Sessions: Scalable, Cost-Effective Graphs for AI Agents
Cloud PlatformsConfirmed

AWS Neptune Graph Sessions: Scalable, Cost-Effective Graphs for AI Agents

Amazon Neptune introduces Graph Sessions, a new compute mode for scalable, cost-effective graph databases tailored for AI agents and GraphRAG assistants, featuring automatic scaling to zero and rapid resumption.

Confirmed facts

Amazon Neptune now supports Neptune Graph Sessions, a new compute mode designed for agents, GraphRAG assistants, AI agents, and per-user analytics.

This compute mode automatically scales memory and CPU, and scales to zero when idle. It allows each agent, user, or task to have its own graph without incurring the minimum cost associated with a provisioned graph, which is 16 m-NCU (Neptune capacity units).

When creating a graph, users select a starting size of either 4 s-NCU (sessions Neptune capacity units) or 8 s-NCU of working memory. Each Graph Sessions graph includes memory headroom, allowing it to scale up to twice its starting size for data loading and query execution. For instance, a 4 s-NCU graph can utilize up to 8 s-NCU of memory, and an 8 s-NCU graph can use up to 16 s-NCU.

Billing for Neptune Graph Sessions is based on the actual memory used by the graph. If a graph's usage fits within a smaller size, it is billed at that smaller size.

An idle graph automatically scales to zero after 15 minutes. When a new query arrives, the graph resumes in seconds. Crucially, the graph and its data are preserved when scaled to zero, eliminating the need to reload data for each session.

Neptune Graph Sessions graphs can be created using the AWS Management Console, AWS CLI, or AWS SDKs. They can be queried using openCypher, similar to other Neptune Analytics graphs. Additional information is available in the Neptune Analytics User Guide and the Amazon Neptune pricing page.

Technical analysis

The introduction of Neptune Graph Sessions addresses a critical need for scalable and cost-effective graph database solutions, particularly for emerging AI-driven applications. Graph databases excel at representing complex relationships and interconnected data, which is fundamental for AI agents requiring contextual understanding, knowledge reasoning, and memory. For GraphRAG (Retrieval Augmented Generation) assistants, graphs provide a structured knowledge base to ground large language models (LLMs), enhancing factual accuracy and reducing hallucinations by enabling precise retrieval of relevant, interconnected information.

Historically, deploying dedicated graph instances for every AI agent, user session, or task has been cost-prohibitive due to the minimum compute requirements of provisioned graph databases. The confirmed 16 m-NCU minimum for a provisioned Neptune graph illustrates this baseline cost. Neptune Graph Sessions directly mitigates this challenge by offering a compute mode that scales to zero when idle. This operational model means that resources are consumed only when actively processing queries, drastically reducing the total cost of ownership for intermittent or bursty workloads. The ability to provide each agent or user with its own isolated graph environment simplifies data management and security, avoiding the complexities of multi-tenancy within a single, larger graph.

The automatic scaling of memory and CPU, coupled with the rapid resumption from an idle state in seconds, has significant engineering implications. Developers are freed from the burden of manually provisioning and scaling graph resources, allowing them to focus on application logic and graph data modeling. For interactive AI agents or real-time GraphRAG queries, the 'resumes in seconds' capability is vital for maintaining responsiveness and a seamless user experience. This automatic lifecycle management reduces operational overhead and the need for complex infrastructure orchestration, making it easier to deploy and manage a large number of individual graph instances.

A key benefit for developers is the persistence of graph data even when scaled to zero. The confirmation that 'Your graph and its data are kept, so you do not reload data for each session' is crucial. This ensures that agents or user sessions can maintain state and context across periods of inactivity without incurring continuous compute costs or the latency and complexity of re-ingesting data. This enables the creation of stateful AI agents that can 'remember' past interactions and knowledge without requiring an always-on, expensive backend. For GraphRAG, it means a user's specific knowledge graph can be spun up and down as needed, preserving their conversational context and personalized data.

The s-NCU (sessions Neptune capacity units) model, with starting sizes of 4 s-NCU or 8 s-NCU and memory headroom up to twice the starting size, provides a flexible and cost-efficient resource allocation mechanism. The fact that users are 'billed for the memory your graph uses' and that a graph fitting a smaller size is billed accordingly, ensures a true pay-for-use model. This contrasts sharply with the fixed costs of over-provisioning for peak capacity. Engineers can select a conservative starting size, knowing that the graph will automatically scale memory as needed, up to the defined headroom, while only paying for actual consumption. This granular billing and scaling capability makes it economically viable to deploy thousands of small, dedicated graphs for diverse AI agent tasks or personalized analytics.

From a developer experience perspective, the integration with standard AWS tools (Console, CLI, SDKs) ensures familiarity and ease of adoption for existing AWS users. The support for openCypher as a query language, consistent with other Neptune Analytics graphs, means developers can leverage existing graph query skills and tools. This consistency reduces the learning curve and promotes interoperability within the broader Neptune ecosystem. The focus on openCypher also suggests a commitment to open standards for graph querying, which can benefit long-term maintainability and portability of graph applications.

Sources