Skip to content

Neo4J

Unstable API

0.7.0

@project-lakechain/neo4j-storage-connector

TypeScript Icon

The Neo4J connector makes it easy for developers to store CloudEvents ontologies in a Neo4j graph database. This connector makes it possible to store structured ontologies into a Neo4J database, whether it is hosted on AWS, on-premises, or on the Neo4J AuraDB service.

This connector is a very good choice for use-cases involving the storage of document as a knowledge graph.

💁 The Ontology documentation provides information about the standard structure of nodes and edges defined by Project Lakechain.



🗄ī¸ Indexing Documents

To use the Neo4J storage connector, you import it in your CDK stack, and connect it to a data source providing documents.

ℹī¸ You will also need to provide credentials stored in AWS Secrets Manager to the Neo4j storage connector.

import * as secrets from 'aws-cdk-lib/aws-secretsmanager';
import { Neo4jStorageConnector } from '@project-lakechain/neo4j-storage-connector';
import { CacheStorage } from '@project-lakechain/core';
class Stack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string) {
const cache = new CacheStorage(this, 'Cache');
// The Neo4j credentials secret.
const neo4jCredentials = secrets.Secret.fromSecretNameV2(
this,
'Neo4jCredentials',
process.env.NEO4J_CREDENTIALS_SECRET_NAME
);
// Create the Neo4j storage connector.
const connector = new Neo4jStorageConnector.Builder()
.withScope(this)
.withIdentifier('Neo4jStorage')
.withCacheStorage(cache)
.withSource(source)
.withUri('neo4j+s://neo4j.example.com')
.withCredentials(neo4jCredentials)
.build();
}
}


✏ī¸ Credentials

This middleware currently only supports basic authentication with Neo4j. You can provide the credentials to the connector by creating a secret in AWS Secrets Manager that follows the following structure.

{
"USERNAME": "neo4j",
"PASSWORD": "password"
}


🔐 VPC

If you have Neo4j instances deployed within a VPC private subnet, you can use the .withVpc method to provide the VPC instance to use to the middleware.

const connector = new Neo4jStorageConnector.Builder()
.withScope(this)
.withIdentifier('Neo4jStorage')
.withCacheStorage(cache)
.withSource(source)
.withVpc(vpc) // 👈 Specify the VPC to use.
.withUri('neo4j+s://neo4j.example.com')
.withCredentials(neo4jCredentials)
.build();


ℹī¸ Limits

The Neo4j storage connector middleware has several limitations that we document in this section.

  1. The first limitation is that only basic authentication is supported by the connector at the moment.
  2. Another limitation is that the connector will not store vector embeddings associated with a document into the database, only document metadata ontologies.


🏗ī¸ Architecture

This middleware is based on a Lambda ARM64 compute to perform the indexing of Nodes and Edges associated with the current document ontology into the destination Neo4J database. It also leverages AWS Secrets Manager to retrieve the Neo4J credentials at runtime.

Neo4J Storage Connector Architecture



🏷ī¸ Properties


Supported Inputs
Mime TypeDescription
*/*This middleware supports any type of documents.
Supported Outputs

This middleware does not produce any output.

Supported Compute Types
TypeDescription
CPUThis middleware only supports CPU compute.


📖 Examples