This kit provides a Spring backend service connected to OpenAI and Neo4j for powering GenAI projects. The Neo4j interface leverages Vector Indexes alongside a retrieval Cypher query to provide more accurate results.
- Maven or https://gradle.org/ for dependency management
- Spring AI
- An OpenAI API Key
- A running local or cloud Neo4j database
- Update the
application.properties
file with your Neo4j and OpenAI credentials
The application.properties
file contains read-only access credentials to a publicly hosted Neo4j instance with public EDGAR SEC data.
If you would like to load your own instance with a subset of this information. Copy, paste, and run the edgar_import.cypher in a Neo4j browser connected to your instance.
If you would like to load your own instance with a subset of this information. Add your own OpenAI key to the Cypher code in the edgar_import.cypher file and run it in your instance's Neo4j browser.
For more information on how this load script works, see this notebook.
./mvnw spring-boot:run
A Rest API should now be running on your local port 8080/api/chat.
After the server is running, a curl command can be triggered to test the endpoint:
curl "http://localhost:8080/api/chat?question=How%20many%20forms%20are%20there%3F"
Please provide feedback and report bugs as GitHub issues
Want to improve this kit? See the contributing guide
At Neo4j GraphAcademy, we offer a wide range of courses completely free of charge, including several related to LLMs with Neo4j.