{"id":15010333,"url":"https://github.com/constacts/milvus-clj","last_synced_at":"2025-04-09T18:34:00.878Z","repository":{"id":232920544,"uuid":"784641312","full_name":"constacts/milvus-clj","owner":"constacts","description":"Clojure libraray for Milvus","archived":false,"fork":false,"pushed_at":"2024-05-29T07:43:29.000Z","size":39,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-29T19:05:53.548Z","etag":null,"topics":["clojure","llm","milvus","rag"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/constacts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-04-10T08:56:11.000Z","updated_at":"2024-07-22T11:20:20.423Z","dependencies_parsed_at":null,"dependency_job_id":"cdad56e0-ff1e-48ae-9894-998351c046c1","html_url":"https://github.com/constacts/milvus-clj","commit_stats":null,"previous_names":["constacts/milvus-clj"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constacts%2Fmilvus-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constacts%2Fmilvus-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constacts%2Fmilvus-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constacts%2Fmilvus-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/constacts","download_url":"https://codeload.github.com/constacts/milvus-clj/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248088196,"owners_count":21045664,"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":["clojure","llm","milvus","rag"],"created_at":"2024-09-24T19:33:35.730Z","updated_at":"2025-04-09T18:34:00.860Z","avatar_url":"https://github.com/constacts.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/v/com.constacts/milvus-clj.svg)](https://clojars.org/com.constacts/milvus-clj)\n\n# milvus-clj\n\nClojure library for [Milvus](https://github.com/milvus-io/milvus).\n\n## Clojure CLI/deps.edn\n\n```\ncom.constacts/milvus-clj {:mvn/version \"0.2.10\"}\n```\n\n## Usage\n\n```clojure\n(require '[milvus-clj.core :as milvus])\n```\n\n#### Create Client\n\n```clojure\n(def client (milvus/client {:host \"localhost\" :port 19530 :database \"mydb\"}))\n```\n\n### Create Collection\n\n```clojure\n(milvus/create-collection client {:collection-name \"mycoll\"\n                                  :description \"a collection for search\"\n                                  :field-types [{:primary-key? true\n                                                 :auto-id? false\n                                                 :data-type :int64\n                                                 :name \"uid\"\n                                                 :description \"unique id\"}\n                                                {:data-type :float-vector\n                                                 :name \"embedding\"\n                                                 :description \"embeddings\"\n                                                 :dimension 3}]})\n```\n\n\n### Create Index\n\n```clojure\n(milvus/create-index client {:collection-name \"mycoll\"\n                             :field-name \"embedding\"\n                             :index-type :flat\n                             :index-name \"embedding_index\"\n                             :metric-type :l2})\n```\n\n### Load Collection\n\n```clojure\n(milvus/load-collection client {:collection-name \"mycoll\"})\n```\n\n### Insert \n\n```clojure\n(milvus/insert client {:collection-name \"mycoll\"\n                       :fields [{:name \"uid\" :values [1 2]}\n                                {:name \"embedding\" :values [(map float [0.1 0.2 0.3])\n                                                            (map float [0.4 0.5 0.6])]}]}\n\n;; or\n\n(milvus/insert client {:collection-name \"mycoll\"\n                       :rows [{:uid 1\n                               :embedding (map float [0.1 0.2 0.3])} \n                              {:uid 2\n                               :embedding (map float [0.4 0.5 0.6])}]})\n\n;; for json type\n\n(milvus/insert client {:collection-name \"mycoll\"\n                       :rows [{:uid 1\n                               :etc {:filename \"README.md\"}}]})\n\n```\n\n### Delete\n\n```clojure\n(milvus/delete client {:collection-name \"mycoll\"\n                       :expr \"uid == 1\"})\n```\n\n### Search\n\n```clojure\n(milvus/search client {:collection-name \"mycoll\"\n                       :metric-type :l2\n                       :vectors [(map float [0.3 0.4 0.5])\n                                 (map float [0.1 0.2 0.3])]\n                       :vector-field-name \"embedding\"\n                       :out-fields [\"uid\" \"embedding\"]\n                       :top-k 2})\n```\n\n### Hybrid Search\n\n```clojure\n(milvus/hybrid-search client {:collection-name \"mycoll\"\n                              :search-requests [{:vector-field-name \"dense_vector\"\n                                                  :metric-type :l2\n                                                  :float-vectors [(gen-float-vector 10)]\n                                                  :top-k 10}\n                                                {:vector-field-name \"sparse_vector\"\n                                                  :metric-type :ip\n                                                  :sparse-float-vectors [(gen-sparse)]\n                                                  :top-k 10}]\n                              :out-fields [\"pk\" \"dense_vector\" \"sparse_vector\"]\n                              :ranker {:type :weighted\n                                        :weights [0.7 0.3]}\n                              :top-k 5}))\n```\n\n### Query\n\n```clojure\n(milvus/query client {:collection-name \"mycoll\"\n                      :expr \"uid == 2\"\n                      :out-fields [\"uid\" \"embedding\"]})\n```\n\n### Drop Index\n\n```clojure\n(milvus/drop-index client {:collection-name \"mycoll\"\n                           :index-name \"embedding_index\"})\n```\n\n### Drop Collection\n\n```clojure\n(milvus/drop-collection client \"mycoll\")\n```\n\n### Release Collection\n\n\n```clojure\n(milvus/release-collection client {:collection-name \"mycoll\"})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstacts%2Fmilvus-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstacts%2Fmilvus-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstacts%2Fmilvus-clj/lists"}