{"id":25897484,"url":"https://github.com/sshaaf/gpt-java-chatbot","last_synced_at":"2026-06-08T11:02:17.495Z","repository":{"id":279131891,"uuid":"937786949","full_name":"sshaaf/gpt-java-chatbot","owner":"sshaaf","description":"This is a chat bot application demonstrating the use of Elastic Vector search capabilities together with Quarkus a blazing fast Java framework.","archived":false,"fork":false,"pushed_at":"2025-06-04T14:32:07.000Z","size":2176,"stargazers_count":5,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T16:57:12.034Z","etag":null,"topics":["chat-bot","elasticsearch","java","llm","quarkus","vector"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sshaaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-23T22:09:04.000Z","updated_at":"2025-12-09T08:58:23.000Z","dependencies_parsed_at":"2025-03-17T17:34:53.632Z","dependency_job_id":"96eecd7c-1472-4e41-bda3-c6e5f6eb6f2d","html_url":"https://github.com/sshaaf/gpt-java-chatbot","commit_stats":null,"previous_names":["sshaaf/gpt-websocket-java-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sshaaf/gpt-java-chatbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaaf%2Fgpt-java-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaaf%2Fgpt-java-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaaf%2Fgpt-java-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaaf%2Fgpt-java-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sshaaf","download_url":"https://codeload.github.com/sshaaf/gpt-java-chatbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sshaaf%2Fgpt-java-chatbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34059157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat-bot","elasticsearch","java","llm","quarkus","vector"],"created_at":"2025-03-02T23:27:56.775Z","updated_at":"2026-06-08T11:02:17.483Z","avatar_url":"https://github.com/sshaaf.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003e - This is a human generated `README` with likely errors. \n\u003e - This `README` file was not generated by an LLM. \n\u003e - Although images in this README were generated using \u003cnapkin.ai\u003e \n\n# A Java/Quarkus Chatbot using Elastic Search\n![UI](./images/ui.jpeg)\n\nThis is a chat bot application demonstrating the use of Elastic Vector search capabilities together with Quarkus a blazing fast Java framework.\n\nThe Quarkus application ingests documents from storage, for which we use minio. It then stores the embeddings to Elastic search. Everytime a user makes a request asking a question, a similarity search is done on the Elastic Vector store. This way additional context is provided to the LLM. \n\nThe project can be used in developement environment i.e. is the local developer machine or in production environment which in this case is the OpenShift platform.\n\n![Environments](./images/high-level-arch.svg)\n\n## Development Environment Components\n\n### Quarkus Java Application\nServes as the core application that processes ingested files and creates embeddings using the AllMiniLmL6V2EmbeddingModel from LangChain4J. Hosts the chatbot interface for user interaction.\n\n### Elastic Search\nUtilized for vector storage, allowing efficient searching and retrieval of embeddings.\nOperated via `start-local` for local development.\n\n\n### Minio\nActs as the object storage solution for storing the actual files ingested by the Quarkus application. Runs in a containerized environment for easy management. The docker file also has an intializer service that creates a bucket and loads the documents into it from the `.documents` dir. \n\n\n### LLM\nA language model used for generating embeddings and enhancing the chatbot's capabilities. We use the Granite model. However if you wish its also possible to use OpenAI. see the `application.properties` file for more details. Comment the model URL and uncomment the OPENAI_API_KEY in that case. \n\n### Podman Desktop\nThe container management tool used to orchestrate the development environment, facilitating the deployment of the above components. We can use the Podman desktop AI extension to host the granite model. \n\n\n### How to run the dev environment\nThere are two ways to do this. The default docker compose-file resides in `deploy/`. however its experimental and does not have all the features enabled. especially Kibana. The second option is to use the official elastic cli which has all essentials loaded \n\n```bash\ncurl -fsSL https://elastic.co/start-local | sh\ncd elastic-start-local\nsh start.sh\n```\n \nAfter that run the docker-compose file to get the minio service started as well.\n\n```bash\ndocker-compose -f deploy/docker-compose.yml up\n```\n\nThis will bring up the local minio environment as well. \n\nonce the services are started. head over to another terminal and run\n```shell script\n./mvnw compile quarkus:dev\n```\n\nnow browse to `http://localhost:8080` and that should bring up the Chatbot. \n\nThere are a bunch of personalities with skills etc in the `document/` directory. you can ask questions like. \n```\nWho is AI Alex? \nor \nWhat happend when Spring boot Sally and ThreadLocal Theo went to dinner?\n``` \n\n## Production Environment Components\n\n### Quarkus Java Application\nSimilar to the development environment, it processes files and serves the chatbot interface.\n\n\n### OpenShift\nThe platform for deploying the Quarkus application in a production setting, providing scalability and management features.\n\n### OpenShift Image Registry\nUsed for storing and managing container images of the Quarkus application and other components. We use the Quarkus OpenShift extension to deploy to OpenShift.\n\n\n### LLM\nContinues to provide embedding generation and support for the chatbot in the production environment. We can use Granite-3B or OpenAI\n\n\n### Elastic Search and Kibana\nDeployed via operators for efficient management and monitoring of the search capabilities and data visualization.\n\n### Minio Storage\nMaintains the same role as in development, providing object storage for files in a production-ready manner.\n\nThe final deployed application should look something like below.\n\n### To deploy\ncreate a namespace/project called `elastic-vector`. The following guidelines assume that everything is deployed in this namespace.\n\nEnsure the Elastic Operator is installed in OpenShift. the CR yaml files are in `deploy/openshift`\n\nI have used the default Elastic and Kibana CRs. \nAn example for each of them is in the deploy/openshift directory\n- elastic-v9.yaml\n- kibana-v9.yaml\n\nGet the secret for logging into kibana and for application use later in this section\n\n```bash\noc get secret elasticsearch-sample-es-elastic-user -n elastic-vector -o jsonpath='{.data}' | jq -r '.elastic | @base64d'\n```\n\nNext step is to instll minio\n\nTo deploy minio use the following yaml [minio.yaml](deploy/openshift/minio.yaml)  \n\nNow lets get the access details\n```bash\noc get secret minio-root-user -o jsonpath='{.data}' -n elastic-vector | jq\n\n# Get the console url:\noc get route minio-console\n```\nCreate a new bucket `elastic-bucket` and upload the file you would like to use for RAG. \n\n\nWe also need to add these values to the app-secret which will be mounted by the running application container. \n\n```\nkubectl create secret generic app-credentials --from-literal=quarkus.elasticsearch.password=ELASTIC_PASSWORD \\\n       --from-literal=minio.access-key=\u003cMINIO_ROOT_PASSWORD\u003e \\\n       --from-literal=minio.secret-key= \u003cMINIO_ROOT_USER\u003e\\\n       --from-literal=quarkus.langchain4j.openai.api-key=YOUR OpenAI key\n```\n\nSo far so good. Lets setup the final piece before setting up the deployment.yaml i.e. ConfigMap\nWe need the config map to specify the application settings. \n\nThe default configmap should work with OpenAI, if the key was provided in the `app-credentials` \n\n```yaml\n  # assuming namespace for elastic is 'elastic-vector'\n  quarkus.elasticsearch.hosts: 'elasticsearch-sample-es-internal-http.elastic-vector.svc.cluster.local:9200'\n  quarkus.elasticsearch.ssl: 'true'\n  quarkus.elasticsearch.username: elastic\n  quarkus.langchain4j.timeout: 60s\n  quarkus.elasticsearch.protocol: https\n  quarkus.kubernetes-client.trust-certs: 'true'\n  quarkus.kubernetes-config.secrets: app-credentials\n  minio.endpoint: 'http://minio.elastic-vector.svc.cluster.local:9000'\n  quarkus.http.port: '8080'\n  quarkus.openshift.env.secrets: app-credentials\n  quarkus.kubernetes-config.secrets.enabled: 'true'\n  minio.bucket-name: elastic-bucket\n  quarkus.websockets-next.server.auto-ping-interval: 1m\n  quarkus.openshift.route.tls.termination: edge\n```\n\nIncase you are running this on OpenShift AI cluster and have your own Model hosted. Add the following properties to the [app-configmap.yaml](deploy/openshift/app-configmap.yaml) file.\n\n```yaml\n  quarkus.langchain4j.openai.chat-model.model-name: MODEL_NAME\n  quarkus.langchain4j.openai.base-url: \u003e-\n    http://MODEL_SERVICE_ENDPOINT/v1\n```\n\n\nUnder deploy/OpenShift there are additional application deployment files that need to be executed in the following order\n- app-configmap.yaml\n- app-secret.yaml\n- deployment.yaml\n\n```bash\noc apply -f deploy/openshift/app-configmap.yaml\noc apply -f deploy/openshift/deployment.yaml\n```\n\nYay! Application should now be deployed and accessible via route. :) \n\n    \u003e Note: Incase adding more documents for rag into the elastic-bucket, delete the pod, and it will ingest the new documents. \n\nIf deploying via the source using the Quarkus OpenShift extension as follows\n\n```bash\nmvn clean compile package -Dquarkus.kubernetes.deploy=true -DskipTests\n```\n\n![Environments](./images/Elastic+Redhat+Quarkus.jpeg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshaaf%2Fgpt-java-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsshaaf%2Fgpt-java-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsshaaf%2Fgpt-java-chatbot/lists"}