This is a GenAI graph search Spring AI application written in Kotlin.
I use Customer 360 use case to prepare the sample graph data and schema.
The demo default use Ollama gemma2:9b
model which minimally need ~6GB GPU VRAM to run.
In docker-compose.yml
, there is a default NEO4J_AUTH
environment variable.
docker-compose up -d
Open IntelliJ IDEA and open build.gradle.kts
and click sync. This will automatically
download the project dependencies into your machine and be shared to Kotlin Notebook.
Or run CLI
./gradlew build
In IntelliJ IDEA, go to Settings > Plugins, Search Kotlin Notebook plugin. Install and restart.
Open notebooks/neo4j.ipynb
.
Click the play button to run notebook piece by piece. It should be able to connect and insert sample graph data.
brew install ollama
ollama pull gemma2:9b
Use intelliJ IDEA to run Spring Boot or using the following CLI.
./gradlew bootRun
Open app.http
, click the play button on the left to trigger
http request to Spring Boot
Trace the output with prefix [DEMO
If you computer doesn't have GPU or insufficient of GPU VRAM. You can use switch to other cloud LLMs provider that supported by Spring AI.
Open build.gradle.kts
, you can see the current dependency is using ollama
org.springframework.ai:spring-ai-xxxxxxxxxx-spring-boot-starter
Update your preferred LLM provider.
Open src/main/kotlin/configs/MoodelConfiguration
, change the Ollama specific sources code to the new provider.
Open src/main/resources/application.properties
, add configuration according to Spring AI documentation.