diff --git a/embeddingstores/neo4j-springai/.gitignore b/embeddingstores/neo4j-springai/.gitignore new file mode 100644 index 0000000..95d3088 --- /dev/null +++ b/embeddingstores/neo4j-springai/.gitignore @@ -0,0 +1,34 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ +/docker/neo4j_db/ diff --git a/embeddingstores/neo4j-springai/docker/docker-compose.yml b/embeddingstores/neo4j-springai/docker/docker-compose.yml index 6cef0a7..4385615 100644 --- a/embeddingstores/neo4j-springai/docker/docker-compose.yml +++ b/embeddingstores/neo4j-springai/docker/docker-compose.yml @@ -4,4 +4,15 @@ services: image: neo4j:latest ports: - 7474:7474 - - 7687:7687 \ No newline at end of file + - 7687:7687 + environment: + - NEO4J_AUTH=neo4j/password + - NEO4J_apoc_export_file_enabled=true + - NEO4J_apoc_import_file_enabled=true + - NEO4J_apoc_import_file_use__neo4j__config=true + - NEO4J_PLUGINS=["apoc", "graph-data-science"] + volumes: + - ./neo4j_db/data:/data + - ./neo4j_db/logs:/logs + - ./neo4j_db/import:/var/lib/neo4j/import + - ./neo4j_db/plugins:/plugins \ No newline at end of file diff --git a/embeddingstores/neo4j-springai/src/main/java/com/learning/ai/service/Neo4jVectorStoreService.java b/embeddingstores/neo4j-springai/src/main/java/com/learning/ai/service/Neo4jVectorStoreService.java index 991015b..542ead0 100644 --- a/embeddingstores/neo4j-springai/src/main/java/com/learning/ai/service/Neo4jVectorStoreService.java +++ b/embeddingstores/neo4j-springai/src/main/java/com/learning/ai/service/Neo4jVectorStoreService.java @@ -26,6 +26,7 @@ public void storeEmbeddings() { List documents = List.of(new Document("I like football."), new Document("The weather is good today.")); vectorStore.add(documents); + LOGGER.info("Added initial documents"); } public AIChatResponse queryEmbeddingStore(String question) { diff --git a/embeddingstores/neo4j-springai/src/test/java/com/learning/ai/TestNeo4jVectorEmbeddingStoreExample.java b/embeddingstores/neo4j-springai/src/test/java/com/learning/ai/TestNeo4jVectorEmbeddingStoreExample.java index b9c9382..624651f 100644 --- a/embeddingstores/neo4j-springai/src/test/java/com/learning/ai/TestNeo4jVectorEmbeddingStoreExample.java +++ b/embeddingstores/neo4j-springai/src/test/java/com/learning/ai/TestNeo4jVectorEmbeddingStoreExample.java @@ -13,9 +13,7 @@ public class TestNeo4jVectorEmbeddingStoreExample { @Bean @ServiceConnection Neo4jContainer neo4jContainer() { - return new Neo4jContainer<>(DockerImageName.parse("neo4j:5")) - .withoutAuthentication() - .withLabsPlugins("apoc"); + return new Neo4jContainer<>(DockerImageName.parse("neo4j:5")).withLabsPlugins("apoc"); } public static void main(String[] args) {