neo4j-spring-data-skill

Builds Spring Boot apps with Spring Data Neo4j using @Entity mappings and repositories.

101|35|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neo4j-spring-data-skill
Source: https://github.com/neo4j-contrib/neo4j-skills/tree/main/neo4j-spring-data-skill
Command: npx skills add https://github.com/neo4j-contrib/neo4j-skills --skill neo4j-spring-data-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the challenge of wiring Neo4j into a Spring Boot application correctly, including entity mapping, repository queries, transactions, and optional vector search, without resorting to raw driver code.

Core Features & Use Cases

  • Spring Data Neo4j entity mapping: Define @Node, @Relationship, and @RelationshipProperties (including relationship IDs and target node mapping) for graph-first domain models.
  • Repository development (imperative and reactive): Implement Neo4jRepository / ReactiveNeo4jRepository with derived queries and safe @Query methods using parameter binding.
  • Practical application setup: Configure application.yml for local Neo4j and Neo4j Aura/TLS, including database selection and credentials via environment variables.
  • Advanced mapping behaviors: Use projections (interface/DTO/dynamic) to control payload shape, manage transaction boundaries, and address common SDN loading and performance pitfalls.
  • Spring AI integration: Enable Spring AI Neo4jVectorStore vector search with schema initialization and similarity search use cases.

Quick Start

Use this skill when you are developing a Spring Boot app with Spring Data Neo4j and want to map graph entities, write repository methods (including @Query), configure application.yml, and optionally enable Spring AI vector search.

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 graph entities in a Spring Boot application using Spring Data Neo4j?

Map graph entities in Spring Data Neo4j by annotating domain classes with @Node, @Relationship, and @RelationshipProperties to define graph-first models. This establishes target node mapping and relationship IDs without requiring raw driver code.

Can I use reactive repositories with Spring Data Neo4j?

Yes, Spring Data Neo4j supports reactive repositories via ReactiveNeo4jRepository. You can implement derived queries and safe @Query methods using parameter binding for both imperative and reactive data access flows.

What's the best way to configure application.yml for a Neo4j Aura connection in Spring Boot?

Configure Neo4j Aura connections in Spring Boot by setting the database URL, TLS settings, and credentials via environment variables in application.yml. This approach supports both local Neo4j and Aura cloud instances with proper authentication.

How do I write safe Cypher queries in Spring Data Neo4j @Query annotations?

Write safe Cypher queries in Spring Data Neo4j @Query annotations by using parameter binding instead of string concatenation. This prevents injection vulnerabilities while executing complex graph traversals through derived or custom repository methods.

Does Spring Data Neo4j support Spring AI vector search integration?

Yes, Spring Data Neo4j integrates with Spring AI Neo4jVectorStore. This enables schema initialization and similarity search use cases directly within your Spring Boot application for vector-based data retrieval.

How do I optimize data loading performance and payload shape in Spring Data Neo4j?

Optimize Spring Data Neo4j data loading by using interface, DTO, or dynamic projections to control payload shape. Combine this with proper transaction boundary management to address common SDN loading and performance pitfalls.