A comprehensive Neo4j graph database integration library for Griptape Nodes, providing complete CRUD operations, query execution, and connection management for Neo4j databases.
This library contains 8 specialized nodes that enable seamless interaction with Neo4j graph databases:
- Neo4j Driver - Configure database connections with authentication
- Neo4j Connection - Manage database sessions
- Execute Cypher - Run arbitrary Cypher queries
- Create Node - Add nodes with labels and properties
- Create Relationship - Connect nodes with typed relationships
- Find Nodes - Search and retrieve nodes with flexible filtering
- Update Node - Modify node properties
- Delete Node - Remove nodes and relationships
- Neo4j database (local or remote)
- Neo4j credentials (URI, username, password)
- Griptape Nodes Engine installed
-
Clone this repository to your Griptape Nodes workspace:
cd $(gtn config show workspace_directory) git clone https://github.com/griptape-ai/griptape-nodes-library-neo4j.git
-
Add the library to your Griptape Nodes engine:
- Copy the path to
neo4j_nodes_library/griptape_nodes_library.json
- In Griptape Nodes, go to Settings → App Events → Libraries to Register
- Add the JSON file path
- Copy the path to
Configure your Neo4j connection by setting these environment variables:
export NEO4J_URI="bolt://localhost:7687"
export NEO4J_DATABASE="neo4j"
export NEO4J_USERNAME="neo4j"
export NEO4J_PASSWORD="your-password"
Configures database connections with comprehensive authentication support.
Key Features:
- Multiple authentication methods (basic, bearer token, custom, none)
- Connection pooling and timeout configuration
- Built-in connection testing
- Driver registry to prevent memory leaks
Parameters:
uri
: Database URI (default: bolt://localhost:7687)database
: Database name (default: neo4j)auth_type
: Authentication methodusername
/password
: Credentials for basic authconnection_timeout
: Connection timeout in seconds
Creates and manages database sessions from a configured driver.
Key Features:
- Automatic driver creation if none provided
- Read/write session modes
- Configurable fetch sizes for streaming
- Session wrapper for lifecycle management
Parameters:
driver
: Optional Neo4j driver instancesession_mode
: read or write (default: write)fetch_size
: Records per batch (default: 1000)
Runs arbitrary Cypher queries with full result processing.
Key Features:
- Parameterized query support
- Result limiting and streaming
- Neo4j object to JSON conversion
- Comprehensive execution statistics
Parameters:
session
: Neo4j session instancecypher_query
: Cypher query to executeparameters
: Query parameters as JSONlimit
: Maximum records to returnconsume_all
: Process all results immediately
Creates nodes with labels and properties.
Parameters:
labels
: Comma-separated node labelsproperties
: Node properties as JSONreturn_node
: Return created node data
Connects nodes with typed relationships.
Parameters:
start_node_labels
/start_node_properties
: Start node criteriaend_node_labels
/end_node_properties
: End node criteriarelationship_type
: Relationship type namerelationship_properties
: Relationship properties as JSONcreate_missing_nodes
: Create nodes if they don't exist
Searches nodes with flexible filtering options.
Parameters:
labels
: Labels to match (optional)property_filters
: Property filters as JSONwhere_clause
: Custom WHERE clauselimit
/skip
: Pagination controlsorder_by
: Result ordering
Modifies node properties with SET/REMOVE operations.
Parameters:
match_labels
/match_properties
: Node matching criteriaupdate_properties
: Properties to update as JSONupdate_mode
: SET (add/update) or REMOVE
Removes nodes with safety confirmation.
Parameters:
match_labels
/match_properties
: Node matching criteriadetach_delete
: Remove connected relationshipsconfirm_delete
: Safety confirmation required
- Neo4j Driver → Configure connection
- Neo4j Connection → Create session
- Create Node → Add person nodes
- Create Relationship → Connect people
- Neo4j Connection → Establish session
- Find Nodes → Query specific nodes
- Execute Cypher → Run analytics queries
- Update Node → Store computed results
- Neo4j Connection → Connect to database
- Find Nodes → Locate outdated data
- Update Node → Refresh properties
- Delete Node → Remove obsolete nodes
All nodes provide comprehensive error messages with troubleshooting guidance. Check the message
output for detailed error information.
Set environment variables for automatic authentication:
export NEO4J_URI="bolt://your-server:7687"
export NEO4J_USERNAME="your-username"
export NEO4J_PASSWORD="your-password"
Properties should be provided as valid JSON strings:
{"name": "Alice", "age": 30, "city": "New York"}
Always connect a session from Neo4j Connection or Neo4j Driver to other nodes. Sessions handle connection lifecycle automatically.
- Verify Neo4j server is running
- Check URI format (bolt://, neo4j://, etc.)
- Confirm authentication credentials
- Test network connectivity
- Validate Cypher syntax
- Check parameter formatting (valid JSON)
- Verify node/relationship existence
- Review query execution summary
- Use appropriate fetch sizes for large result sets
- Set reasonable limits on Find Nodes operations
- Consider pagination for large datasets
- Use indexed properties for filtering
- Neo4j Python Driver: >= 5.25.0
- Griptape Nodes: Latest from GitHub
For issues and questions:
- Check node
message
outputs for specific error guidance - Review Neo4j server logs
- Verify JSON parameter formatting
- Test connections with simple queries first