Milvus schema building: FieldType and CollectionSchema construction.
Converts idiomatic Clojure maps to Milvus Java SDK builder objects. Unlike Chroma (schemaless), Milvus requires explicit field definitions with types, dimensions, and constraints before data can be inserted.
Usage: (collection-schema [{:name "id" :type :varchar :primary? true :max-length 256} {:name "embedding" :type :float-vector :dimension 1536} {:name "content" :type :varchar :max-length 65535}] :description "Memory collection")
Milvus schema building: FieldType and CollectionSchema construction.
Converts idiomatic Clojure maps to Milvus Java SDK builder objects.
Unlike Chroma (schemaless), Milvus requires explicit field definitions
with types, dimensions, and constraints before data can be inserted.
Usage:
(collection-schema
[{:name "id" :type :varchar :primary? true :max-length 256}
{:name "embedding" :type :float-vector :dimension 1536}
{:name "content" :type :varchar :max-length 65535}]
:description "Memory collection")(->data-type dt)Resolve a keyword or DataType instance to a DataType enum value. Throws ex-info with valid keys on unknown type.
Resolve a keyword or DataType instance to a DataType enum value. Throws ex-info with valid keys on unknown type.
(collection-schema fields)Build a CollectionSchemaParam from a sequence of field definition maps.
Each field map is passed to field-type.
Note: description is set on CreateCollectionParam, not on the schema.
Example: (collection-schema [{:name "id" :type :varchar :primary? true :max-length 256} {:name "embedding" :type :float-vector :dimension 1536} {:name "content" :type :varchar :max-length 65535}])
Build a CollectionSchemaParam from a sequence of field definition maps.
Each field map is passed to `field-type`.
Note: description is set on CreateCollectionParam, not on the schema.
Example:
(collection-schema
[{:name "id" :type :varchar :primary? true :max-length 256}
{:name "embedding" :type :float-vector :dimension 1536}
{:name "content" :type :varchar :max-length 65535}])Mapping of keywords to Milvus DataType enum values.
Mapping of keywords to Milvus DataType enum values.
(field-type {:keys [name type primary? auto-id? max-length dimension
description]
:or {primary? false auto-id? false}})Build a Milvus FieldType from a Clojure map.
Required keys:
:name - field name (string or keyword)
:type - data type keyword (see data-types)
Optional keys: :primary? - is this the primary key? (default false) :auto-id? - auto-generate IDs? (default false) :max-length - max length for VarChar fields :dimension - vector dimension for FloatVector/BinaryVector :description - field description string
Example: (field-type {:name "embedding" :type :float-vector :dimension 1536})
Build a Milvus FieldType from a Clojure map.
Required keys:
:name - field name (string or keyword)
:type - data type keyword (see `data-types`)
Optional keys:
:primary? - is this the primary key? (default false)
:auto-id? - auto-generate IDs? (default false)
:max-length - max length for VarChar fields
:dimension - vector dimension for FloatVector/BinaryVector
:description - field description string
Example:
(field-type {:name "embedding" :type :float-vector :dimension 1536})Default schema fields for hive-mcp memory collections. Mirrors the metadata stored in Chroma, translated to Milvus field types.
Use with collection-schema:
(collection-schema memory-schema-fields)
Default schema fields for hive-mcp memory collections. Mirrors the metadata stored in Chroma, translated to Milvus field types. Use with `collection-schema`: (collection-schema memory-schema-fields)
(with-dimension dim)Return memory-schema-fields with the embedding dimension adjusted.
Example: (collection-schema (with-dimension 768))
Return memory-schema-fields with the embedding dimension adjusted. Example: (collection-schema (with-dimension 768))
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |