Skip to content

Neptune Database Graph Store

You can use Amazon Neptune Database as a graph store. The lexical-graph requires Neptune engine version 1.4.1.0 or later.

Use the GraphStoreFactory.for_graph_store() static factory method to create an instance of a Neptune Database graph store.

To create a Neptune Database graph store (engine version 1.4.1.0 or later), supply a connection string that begins neptune-db://, followed by an endpoint:

from graphrag_toolkit.lexical_graph.storage import GraphStoreFactory
neptune_connection_info = 'neptune-db://mydbcluster.cluster-123456789012.us-east-1.neptune.amazonaws.com:8182'
with GraphStoreFactory.for_graph_store(neptune_connection_info) as graph_store:
...

To connect to Neptune via a proxy (e.g. a load balancer), you must supply a config dictionary to the GraphStoreFactory.for_graph_store() factory method, with a proxies dictionary of proxy servers to use by protocol or endpoint:

from graphrag_toolkit.lexical_graph.storage import GraphStoreFactory
neptune_connection_info = 'neptune-db://mydbcluster.cluster-123456789012.us-east-1.neptune.amazonaws.com:8182'
config = {
'proxies': {
'http': 'http://proxy-hostname:80'
}
}
with GraphStoreFactory.for_graph_store(
neptune_connection_info,
config=config
) as graph_store:
...