{"id":26800411,"url":"https://github.com/thecodemonkey/similaritysearch","last_synced_at":"2025-03-29T20:17:04.817Z","repository":{"id":283526454,"uuid":"946164194","full_name":"thecodemonkey/SimilaritySearch","owner":"thecodemonkey","description":"This project is part of a tutorial demonstrating how to use Kotlin or Java with Spring-AI to generate embeddings and perform simple similarity searches.","archived":false,"fork":false,"pushed_at":"2025-03-21T13:40:15.000Z","size":547,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T20:17:01.077Z","etag":null,"topics":["ai","embeddings","spring","tutorial","vector-database"],"latest_commit_sha":null,"homepage":"https://simsearch.thecodemonkey.de/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodemonkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-03-10T17:57:34.000Z","updated_at":"2025-03-21T13:40:18.000Z","dependencies_parsed_at":"2025-03-20T18:35:39.099Z","dependency_job_id":null,"html_url":"https://github.com/thecodemonkey/SimilaritySearch","commit_stats":null,"previous_names":["thecodemonkey/similaritysearch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey%2FSimilaritySearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey%2FSimilaritySearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey%2FSimilaritySearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodemonkey%2FSimilaritySearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodemonkey","download_url":"https://codeload.github.com/thecodemonkey/SimilaritySearch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246237437,"owners_count":20745348,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["ai","embeddings","spring","tutorial","vector-database"],"created_at":"2025-03-29T20:17:03.982Z","updated_at":"2025-03-29T20:17:04.809Z","avatar_url":"https://github.com/thecodemonkey.png","language":"JavaScript","readme":"# Similarity Search with Spring AI\n\n\u003ca href=\"https://simsearch.thecodemonkey.de\" target=\"_blank\"\u003eDemo\u003c/a\u003e\n\n\n## Table of Contents\n\u003c!-- TOC --\u003e\n* [Similarity Search with Spring AI](#similarity-search-with-spring-ai)\n  * [Table of Contents](#table-of-contents)\n  * [Introduction](#introduction)\n  * [Project structure](#project-structure)\n  * [Requirements](#requirements)\n  * [Quick Start](#quick-start)\n    * [Clone Project](#clone-project)\n    * [Build \u0026 Run](#build--run)\n    * [run applicaiton](#run-applicaiton)\n    * [run in docker](#run-in-docker)\n    * [use the UI](#use-the-ui)\n  * [Troubleshooting](#troubleshooting)\n    * [Memory Usage](#memory-usage)\n    * [Windows WSL2](#windows-wsl2)\n\u003c!-- TOC --\u003e\n\n\n## Introduction\nThis project is part of a tutorial demonstrating how to use Kotlin or Java with Spring-AI to generate embeddings and perform simple similarity searches.\nIt provides a minimal implementation approach. This sample project contains both a Kotlin and a Java implementation. I like to use Kotlin because the syntax is much leaner and more precise than the classic Java. But it's up to you which one you prefer.\n\n## Project structure\n\n    root\n     |\n     |-- src\n           |-- java                         # java source code\n           |-- kotlin                       # kotlin source code                   \n           |-- resources           \n                      |-- data              # raw and vecorized data\n                      |-- model             # optional local model\n                      |-- static            # frontend implementation of PoC\n                      |-- application.yml   \n\n\n\n## Requirements\n\n- jdk 21\n- gradle (current version)\n- min 2GB free ram\n\n\n## Quick Start\n\n### Clone Project\n```sh\ngit clone https://github.com/thecodemonkey/SimilaritySearch.git\ncd SimilaritySearch\n```\n\n### Build \u0026 Run\nUsing Gradle:\n```sh\n./gradlew build\n```\n\n### run applicaiton\nOnce the application is running, the API is available at `http://localhost:7070`. I have explicitly used a different port to avoid collisions with applications that are already running. The configuration can be found in **application.yml/server.port**\n\nExample request:\n```sh\n./gradlew bootRun\ncurl http://localhost:7070/embeddings?text=give%20me%20love%20songs\n```\n\n### run in docker\nThe application can also be started in Docker. The already generated image from the GitLab Container Registry can be used, or the local project can be rebuilt as a Docker image and run locally.\n\nrun from ghcr.io:\n\n    docker run -p 7070:7070 ghcr.io/thecodemonkey/similaritysearch:main\n    \n    # arm\n\n    docker run --platform linux/amd64 -p 80:7070 ghcr.io/thecodemonkey/similaritysearch:main\n\n\n### use the UI\n\nopen the URL http://localhost:7070/ in your browser to see and use the ui.\nuse the input field for the search. You can use the microphone icon for the voice function. \nNote which language is selected. You can currently select German or English.\n\n\n\n## Troubleshooting\n\n### Memory Usage\nThe application requires slightly more memory than usual. If you get an error message with “out of memory” or something with “java heap size” then you should increase the JAVA memory.\n\n    java JAVA_OPTS=\"-Xmx1024m\" -jar similarity-search.jar\n\n### Windows WSL2\n\nIf you are working with WSL under windows, note that wsl has its own IP, which changes with every restart. This is how you can determine the IP from the WSL console\n\ninside wsl terminal: \n    \n    ip addr show eth0\n\ngrab the specific ip and open in browser on your host machine:\n    \n    curl http://172.20.45.2:7070\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodemonkey%2Fsimilaritysearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodemonkey%2Fsimilaritysearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodemonkey%2Fsimilaritysearch/lists"}