Skip to content

Commit

Permalink
feat : adds Spring Boot application for using a Neo4j vector embeddin…
Browse files Browse the repository at this point in the history
…g store (#31)

* feat : adds neo4j sample

* adds workflow

* feat : convert get to post endpoint

* feat : exception Handling

* feat : starts container without authentication

* fix grammar

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
rajadilipkolli and coderabbitai[bot] authored Apr 1, 2024
1 parent cb29e84 commit 18cd1dd
Show file tree
Hide file tree
Showing 20 changed files with 1,016 additions and 10 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/embeddingstore-neo4j-springai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: neo4j-springai CI Build

on:
push:
paths:
- "embeddingstores/neo4j-springai/**"
branches: [main]
pull_request:
paths:
- "embeddingstores/neo4j-springai/**"
types:
- opened
- synchronize
- reopened

jobs:
build:
name: Run Unit & Integration Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: embeddingstores/neo4j-springai
strategy:
matrix:
distribution: [ 'temurin' ]
java: [ '21' ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK ${{ matrix.java }}
uses: actions/[email protected]
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: 'maven'
- name: Build and analyze
run: ./mvnw clean verify
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@

AI implementations using java, stores and either of Langchain4j or springai framework

| **_Module Name_** | **_Description_** |
|----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [opensearch langchain4j](./ai-opensearch-langchain4j) | Embeddings implementation using langchain4j and opensearch store |
| [chatmodel springai](./chatmodel-springai) | AI chat playground using springai |
| [pgvector lanchain4j](./pgvector-langchain4j) | Embeddings implementation using langchain4j and pgvector |
| [pgvector springai](./pgvector-springai) | Embeddings implementation using springai and pgvector |
| [playground](./playground) | AI playground using Langchain4j |
| [rag langchain4j AllMiniLmL6V2](./rag-langchain4j-AllMiniLmL6V2-llm) | RAG Implementation using Langchain4j, PGVector store and openai LLM |
| [rag springai ollama llm](./rag-springai-ollama-llm) | RAG Implementation using springai, Redis store, PDF document reader and ollama LLM with llama2 model |
| [rag springai openai llm](./rag-springai-openai-llm) | RAG Implementation using springai, PGVector store, Tika document reader and openai LLM |
| **_Module Name_** | **_Description_** |
|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [playground](./playground) | AI playground using Langchain4j |
| [chatmodel springai](./chatmodel-springai) | AI chat playground using springai |
| [pgvector lanchain4j](./pgvector-langchain4j) | Embeddings implementation using langchain4j and pgvector |
| [pgvector springai](./pgvector-springai) | Embeddings implementation using springai and pgvector |
| [neo4j embedding Store using spring ai](./embeddingstores/neo4j-springai) | Embedding store implementation using springai and neo4j |
| [opensearch langchain4j](./ai-opensearch-langchain4j) | Embeddings implementation using langchain4j and opensearch store |
| [rag langchain4j AllMiniLmL6V2](./rag-langchain4j-AllMiniLmL6V2-llm) | RAG Implementation using Langchain4j, PGVector store and openai LLM |
| [rag springai ollama llm](./rag-springai-ollama-llm) | RAG Implementation using springai, Redis store, PDF document reader and ollama LLM with llama2 model |
| [rag springai openai llm](./rag-springai-openai-llm) | RAG Implementation using springai, PGVector store, Tika document reader and openai LLM |

### Credits
Thanks to langchain4j for providing an openAI compatible API for learning and demo purposes.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
25 changes: 25 additions & 0 deletions embeddingstores/neo4j-springai/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# neo4j-springai

### Run tests

```shell
./mvnw clean verify
```

### Run locally

```shell
docker-compose -f docker/docker-compose.yml up -d
./mvnw spring-boot:run -Dspring-boot.run.profiles=local
```
### Using Testcontainers at Development Time
You can run `TestApplication.java` from your IDE directly.
You can also run the application using Maven as follows:

```shell
./mvnw spotless:apply spring-boot:test-run
```

### Useful Links
* Swagger UI: http://localhost:8080/swagger-ui.html
* Actuator Endpoint: http://localhost:8080/actuator
7 changes: 7 additions & 0 deletions embeddingstores/neo4j-springai/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:
neo4j:
container_name: neo4j
image: neo4j:latest
ports:
- 7474:7474
- 7687:7687
Loading

0 comments on commit 18cd1dd

Please sign in to comment.