Skip to content

Commit

Permalink
spring-projectsGH-26 - Add support for Neo4j vector index.
Browse files Browse the repository at this point in the history
This commit brings support for Neo4j graph database in general,
and uses the vector index functionality available since version 5.11.

Aligned with the existing PgVector store and its tests.

The module creates indexes, if needed, for the vector search and
the identifier of the document object.

Add neo4j to vectordb docs page

Co-authored-by: Michael Simons <[email protected]>
  • Loading branch information
2 people authored and markpollack committed Sep 27, 2023
1 parent 92773f1 commit a6fba7a
Show file tree
Hide file tree
Showing 5 changed files with 634 additions and 2 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<module>spring-ai-docs</module>
<module>vector-stores/spring-ai-pgvector-store</module>
<module>vector-stores/spring-ai-milvus-store</module>
<module>vector-stores/spring-ai-neo4j-store</module>
</modules>

<organization>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ The `VectorStore` implementations supported by Spring AI are:

* InMemoryVectorStore
* SimplePersistentVectorStore
* PgVector - A Vector Store build on https://github.com/pgvector/pgvector[PostgreSQL/PGVector].
* Milvus - A Vector Store build on https://milvus.io/[Milvus]
* PgVector - The Vector Store https://github.com/pgvector/pgvector[PostgreSQL/PGVector].
* Milvus - The Vector Store https://milvus.io/[Milvus]
* Neo4j - The Vector Store https://neo4j.com/[Neo4j]

More are implementations are coming, with Pinecone being the next implementation.

Expand Down
78 changes: 78 additions & 0 deletions vector-stores/spring-ai-neo4j-store/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.experimental.ai</groupId>
<artifactId>spring-ai</artifactId>
<version>0.2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>spring-ai-neo4j-store</artifactId>
<packaging>jar</packaging>
<name>Spring AI Vector Store - neo4j</name>
<description>Spring AI Neo4j Vector Store</description>
<url>https://github.com/spring-projects-experimental/spring-ai</url>

<scm>
<url>https://github.com/spring-projects-experimental/spring-ai</url>
<connection>git://github.com/spring-projects-experimental/spring-ai.git</connection>
<developerConnection>[email protected]:spring-projects-experimental/spring-ai.git</developerConnection>
</scm>

<properties>
<spring-ai.version>0.2.0-SNAPSHOT</spring-ai.version>
<!-- testing -->
<testcontainers.version>1.19.0</testcontainers.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.experimental.ai</groupId>
<artifactId>spring-ai-core</artifactId>
<version>${spring-ai.version}</version>
</dependency>

<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
</dependency>

<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher-dsl-schema-name-support</artifactId>
<version>2023.7.0</version>
</dependency>

<!-- TESTING -->
<dependency>
<groupId>org.springframework.experimental.ai</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
<version>${spring-ai.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>neo4j</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>


</dependencies>

</project>
Loading

0 comments on commit a6fba7a

Please sign in to comment.