ivicac / spring-ai-redis-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring AI Redis Demo


A Retrieval Augmented Generation demo using Spring AI and Redis Vector Search.

Pre-requisites

Docker

This demo requires Docker to build and run the application.

Azure OpenAI

Obtain your Azure OpenAI endpoint (e.g. https://demo-us-west.openai.azure.com/) and api-key from the Azure OpenAI Service section on Azure Portal.

The Spring AI project defines a configuration property named spring.ai.azure.openai.api-key that you should set to the value of the API Key obtained from Azure.

If your model deployment name is not the default gpt-35-turbo you can specify it using the configuration property named spring.ai.azure.openai.chat.options.model.

Exporting an environment variable is one way to set these configuration properties.

export SPRING_AI_AZURE_OPENAI_API_KEY=<INSERT KEY HERE>
export SPRING_AI_AZURE_OPENAI_ENDPOINT=<INSERT ENDPOINT URL HERE>
export SPRING_AI_AZURE_OPENAI_CHAT_OPTIONS_MODEL=<INSERT MODEL NAME HERE>

Run the demo

git clone https://github.com/{project-owner}/{project-name}.git
cd {project-name}
docker compose up

Once the Spring application is running (com…​..Application: Started Application in …​), point your browser to localhost:8080 and ask a question around beers:

spring ai redis screenshot

About


Languages

Language:JavaScript 41.7%Language:Java 41.3%Language:HTML 9.2%Language:CSS 5.0%Language:Smalltalk 1.7%Language:Dockerfile 1.2%