Liking cljdoc? Tell your friends :D

hive-milvus.store.space

Embedding-space provenance of a Milvus collection.

A dimension match says only that two vectors have the same width. A collection also keeps the full space it was created in: provider, model, exact digest, dimension, metric, normalization, and the query-template and document-serializer revisions. That space lives in the collection's own properties (string -> string) and is checked whenever an existing collection is opened, so vectors of two spaces never share a collection.

The value layer (stamp, admit) is hive-spi.embeddings.space. This namespace converts its flat scalar stamp to and from Milvus properties, and reads and writes those properties over the Milvus v2 REST API. The REST API is served on the same port as gRPC, so this works for both transports. milvus-clj 0.3.1 neither sends nor returns collection properties.

stamp->properties stamp as a Milvus string property map properties->stamp Milvus properties (map or [{key value}]) as a stamp read-stamp IO: the stamp of an existing collection write-stamp! IO: stamp an existing collection with a space admit! guard: stamped ok, legacy warns, other space throws

Embedding-space provenance of a Milvus collection.

A dimension match says only that two vectors have the same width. A
collection also keeps the full space it was created in: provider, model,
exact digest, dimension, metric, normalization, and the query-template and
document-serializer revisions. That space lives in the collection's own
properties (string -> string) and is checked whenever an existing
collection is opened, so vectors of two spaces never share a collection.

The value layer (stamp, admit) is hive-spi.embeddings.space. This
namespace converts its flat scalar stamp to and from Milvus properties,
and reads and writes those properties over the Milvus v2 REST API. The
REST API is served on the same port as gRPC, so this works for both
transports. milvus-clj 0.3.1 neither sends nor returns collection
properties.

  stamp->properties     stamp as a Milvus string property map
  properties->stamp     Milvus properties (map or [{key value}]) as a stamp
  read-stamp            IO: the stamp of an existing collection
  write-stamp!          IO: stamp an existing collection with a space
  admit!                guard: stamped ok, legacy warns, other space throws
raw docstring

admit!clj

(admit! collection-name space md)

Guard collection COLLECTION-NAME, whose stamp is MD, for vectors of SPACE.

stamped, same space => the hive-spi Admission, :verdict :stamped no stamp => :verdict :legacy, warned once per collection stamped, other space => throws ex-info :embedding-space-mismatch naming both spaces, the differing keys, the collection and the remedy #{:isolate :re-embed}

Guard collection COLLECTION-NAME, whose stamp is MD, for vectors of SPACE.

stamped, same space  => the hive-spi Admission, :verdict :stamped
no stamp             => :verdict :legacy, warned once per collection
stamped, other space => throws ex-info :embedding-space-mismatch naming
                        both spaces, the differing keys, the collection
                        and the remedy #{:isolate :re-embed}
sourceraw docstring

guard-existing!clj

(guard-existing! collection-name space)

Admit the existing COLLECTION-NAME for vectors of SPACE: read its stamp and admit! it. A stamp that cannot be read is logged and the collection admitted unverified (nil); a mismatch throws.

Admit the existing COLLECTION-NAME for vectors of SPACE: read its stamp
and `admit!` it. A stamp that cannot be read is logged and the collection
admitted unverified (nil); a mismatch throws.
sourceraw docstring

metricclj

Metric of every collection hive-milvus creates: milvus-clj's default-memory-index scores the embedding field with COSINE.

Metric of every collection hive-milvus creates: milvus-clj's
default-memory-index scores the embedding field with COSINE.
sourceraw docstring

properties->stampclj

(properties->stamp props)

The keyword-keyed stamp held in Milvus PROPS: only the :embed-* keys, the dimension read back as a long. Absent or empty PROPS answer {}.

The keyword-keyed stamp held in Milvus PROPS: only the :embed-* keys, the
dimension read back as a long. Absent or empty PROPS answer {}.
sourceraw docstring

read-stampclj

(read-stamp collection-name)

Boundary: IO. The stamp of the existing collection COLLECTION-NAME ({} when it carries none). Throws what the request throws.

Boundary: IO. The stamp of the existing collection COLLECTION-NAME ({}
when it carries none). Throws what the request throws.
sourceraw docstring

request!clj

(request! path body)

Boundary: one checked Milvus v2 REST call (PATH, BODY) under the configured connection. Tests redefine it.

Boundary: one checked Milvus v2 REST call (PATH, BODY) under the
configured connection. Tests redefine it.
sourceraw docstring

reset-legacy-warnings!clj

(reset-legacy-warnings!)

Test helper: forget which legacy collections were already warned about.

Test helper: forget which legacy collections were already warned about.
sourceraw docstring

space-for-collectionclj

(space-for-collection space)

SPACE with the metric hive-milvus collections score with, or nil.

SPACE with the metric hive-milvus collections score with, or nil.
sourceraw docstring

stamp->propertiesclj

(stamp->properties space)

The Milvus collection properties that stamp a collection with SPACE: every hive-spi stamp key by name, every value as a string.

The Milvus collection properties that stamp a collection with SPACE:
every hive-spi stamp key by name, every value as a string.
sourceraw docstring

stamp-new!clj

(stamp-new! collection-name space)

Stamp the just-created COLLECTION-NAME with SPACE. A failed stamp is logged, not thrown: the collection exists and holds no vectors yet, and it reads back as legacy until a later open stamps nothing over it.

Stamp the just-created COLLECTION-NAME with SPACE. A failed stamp is
logged, not thrown: the collection exists and holds no vectors yet, and
it reads back as legacy until a later open stamps nothing over it.
sourceraw docstring

write-stamp!clj

(write-stamp! collection-name space)

Boundary: IO. Stamp COLLECTION-NAME with SPACE in its properties.

Boundary: IO. Stamp COLLECTION-NAME with SPACE in its properties.
sourceraw docstring

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