Retrieval-augmented generation (RAG) is a method that improves the precision and dependability of generative AI models by incorporating information obtained from external sources.
This file contains instructions to build, configure and install RAG API to demonstrate RAG usecase.
Refer article here, https://vineetaparodkar.hashnode.dev/retrieval-augmentation-generation-using-spring-ai
-
Keystore (Refer Appendix section)
- Clone the repository and checkout to main branch
- Update Application properties.
a. Update application properties from resources folder here, api/src/main/resources
.
-
Create a project deployment folder.
-
Copy below files from
api/src/main/resources
to project deployment folder.api/src/main/resources/application.yaml
c. Execute following command from project root directory to create project service jar.
./gradlew build -x test
d. New jar will be created here rag-with-spring-ai/build/libs/rag-0.0.1-SNAPSHOT.jar
. Copy this same jar in project deployment folder.
e. Execute below command to start RAG API.
- Navigate to project deployment folder and execute below command.
java -jar rag-0.0.1-SNAPSHOT.jar
-
Use below URL to access Swagger UI.
https://<servername>:<port>/rag/api-docs/swagger-ui/index.html
-
Use below command to generate keystore.
openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -name tomcat -CAfile chain.pem -caname root
-
Check if the SSL certificate chain from your origin server is complete.To check use this.
https://www.ssllabs.com/ssltest/