neo4j-spring-data-skill

Guides building Spring Boot applications with Spring Data Neo4j entity mapping and repositories.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-spring-data-skill-cardox6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-spring-data-skill
Source: https://github.com/cardox6/steuer-graph/tree/main/.agents/skills/neo4j-spring-data-skill
Command: npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-spring-data-skill-cardox6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers integrating Neo4j into Spring Boot applications face recurring pitfalls: incorrect entity mapping, N+1 relationship loading, unsafe Cypher parameter handling, and confusion between imperative and reactive stacks. This Skill provides version-accurate patterns and checklists for Spring Data Neo4j so generated code works correctly the first time. ## Core Features & Use Cases - Entity and Relationship Mapping: Correct usage of @Node, @Id/@GeneratedValue, @Relationship, @RelationshipProperties, and dynamic labels. - Repositories and Queries: Neo4jRepository and ReactiveNeo4jRepository definitions, derived queries, @Query with bound Cypher parameters, pagination, and projections (interface, DTO, dynamic). - Advanced Integration: Neo4jClient/Neo4jTemplate custom queries, transaction management, and Spring AI Neo4jVectorStore configuration for vector search. - Use Case: When asked to build a Spring Boot service that stores a graph of people and movies in Neo4j, the Skill produces correctly annotated entities, a repository with parameterized @Query methods returning collect(r), collect(p), and a working application.yml configuration. ## Quick Start Ask your assistant to create a Spring Boot Neo4j application with a Person entity, a Neo4jRepository, and the required application.yml configuration.

Frequently Asked Questions about neo4j-spring-data-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I map a Java class to a Neo4j node in Spring Data Neo4j?▼

Annotate the class with @Node("Label") and give it an @Id field, typically with @GeneratedValue for internal IDs. Use @Property to rename fields and @Relationship with an explicit direction for associations to other entities.

How do I write custom Cypher queries in a Neo4jRepository?▼

Add a method annotated with @Query containing your Cypher statement, and bind parameters with $paramName placeholders matching the method arguments. Never concatenate user input into the query string, as that opens Cypher injection risks.

Why are relationships null after loading an entity in Spring Data Neo4j?▼

SDN loads relationships only up to a default depth of one hop, so deeper associations come back empty. Write an explicit @Query that returns the root node together with collect(r) and collect(p) so SDN can map the full subgraph.

Can I use reactive repositories with Spring Data Neo4j?▼

Yes, extend ReactiveNeo4jRepository to get Mono and Flux return types, and add spring-boot-starter-webflux alongside the Neo4j starter. Do not mix imperative and reactive database access in the same application context.

Does Spring AI support Neo4j as a vector store?▼

Yes, the spring-ai-starter-vector-store-neo4j dependency provides Neo4jVectorStore, which reuses your spring.neo4j connection settings. Set initialize-schema to true and match embedding-dimension to your embedding model; Neo4j 5.15 or later is required.

When should I not use Spring Data Neo4j?▼

Avoid SDN when you need raw driver-level control without Spring, when the task is pure Cypher authoring, or when running GDS algorithms. Those cases are better served by the Java driver directly or dedicated Cypher and GDS tooling.