Liking cljdoc? Tell your friends :D

milvus-clj

Clojars Project cljdoc release License: MIT

A transport-abstract Clojure client for Milvus. The caller picks gRPC or HTTP/REST; the protocols, the query surface and the error taxonomy are the same either way.

Coordinates

;; deps.edn
io.github.hive-agi/milvus-clj {:mvn/version "0.2.5"}

Usage

(require '[milvus-clj.client :as client])

(client/with-client [c {:transport :grpc
                        :host "milvus.prod" :port 19530
                        :token "root:pw"}]
  (client/-query c "memories" {:vector [0.1 0.2 …] :limit 10}))

(client/with-client [c {:transport :http
                        :host "milvus.prod" :port 9091
                        :token "root:pw"}]
  (client/-query c "memories" {:vector [0.1 0.2 …] :limit 10}))

with-client scopes an ephemeral client; client/make builds one directly and dispatches on :transport. client/probe! checks reachability and client/classify-error maps a transport failure onto a stable keyword, so callers do not pattern-match on driver exception classes.

Layout

NamespaceProvides
milvus-clj.clientIMilvusCore / IMilvusAdmin / IMilvusExtras protocols, make, with-client, classify-error
milvus-clj.transport.grpcgRPC transport over io.milvus/milvus-sdk-java
milvus-clj.transport.httpHTTP/REST transport for the Milvus v2.5.x API, via java.net.http.HttpClient
milvus-clj.schemaFieldType and CollectionSchema construction
milvus-clj.indexIndex creation and management
milvus-clj.configTyped config through hive-di defconfig — env resolution returning a Result
milvus-clj.apiLegacy flat API over a singleton client, kept so existing callers need not migrate at once

The protocols are split by interface-segregation: a transport implements the core data plane and opts into admin/extras. Adding a third transport is a new file under milvus-clj.transport.* plus one case arm in make — nothing else changes.

Config

milvus-clj.config declares MilvusClientConfig via hive-di's defconfig, generating the field registry, a closed Malli schema, and a resolver that returns a Result. Resolution order per env-sourced field: explicit override → environment variable → blank-to-nil → typed default → coercion.

License

MIT.

Can you improve this documentation? These fine people already did:
Pedro Gomes Branquinho & buddhilw
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close