Actions6
- Vector Store Actions
- Graph Database Actions
Overview
This node integrates with a Neo4j graph database, enabling users to perform various operations on graph data. Specifically, the Create Node operation allows users to add new nodes with specified labels and properties into the Neo4j database.
Common scenarios where this node is beneficial include:
- Building or extending knowledge graphs by programmatically adding entities.
- Automating data ingestion pipelines that require structured graph representations.
- Managing graph-based metadata or relationships in applications like recommendation systems or network analysis.
For example, you might use this node to create a "Person" node with properties such as name and age, which can later be connected to other nodes representing relationships or attributes.
Properties
| Name | Meaning |
|---|---|
| Index Name | The index name to use (optional). Defaults to "vector". |
| Node Label | The label for the node to be created in the graph database (required). |
| Node Properties | The properties of the node expressed as a JSON string (required). These define the node's attributes and their values. |
Output
The output is an array of JSON objects representing the result of the Cypher query that creates the node. Each object corresponds to a node created in the database and includes its properties and metadata as returned by Neo4j.
Example output structure (simplified):
[
{
"n": {
"labels": ["LabelName"],
"properties": {
"property1": "value1",
"property2": "value2"
}
}
}
]
No binary data output is produced by this operation.
Dependencies
- Requires access to a Neo4j database instance.
- Requires credentials including URI, username, password, and optionally the database name.
- Uses the
@langchain/community/graphs/neo4j_graphpackage internally to interact with Neo4j. - The node expects valid Cypher queries and JSON-formatted node properties.
Troubleshooting
- Invalid JSON in Node Properties: If the
Node Propertiesinput is not a valid JSON string, the node will throw an error when parsing. Ensure the JSON syntax is correct. - Connection Errors: Issues connecting to the Neo4j database may occur if credentials are incorrect or the database is unreachable. Verify connection details and network accessibility.
- Cypher Query Errors: If the generated Cypher query is malformed (e.g., invalid label names or property keys), Neo4j will return an error. Check that labels and properties conform to Neo4j naming rules.
- Unimplemented Operations: Attempting to use operations not yet implemented (like "Create Relationship") will result in an explicit error indicating the feature is unavailable.