Entry <-> Milvus record conversion and filter expression builders.
Pure functions only — no side effects, no Milvus RPCs. Extracted from hive-milvus.store so the schema/translation layer can be understood (and tested) independently of the connection + resilience machinery.
Entry <-> Milvus record conversion and filter expression builders. Pure functions only — no side effects, no Milvus RPCs. Extracted from hive-milvus.store so the schema/translation layer can be understood (and tested) independently of the connection + resilience machinery.
(build-filter-expr {:keys [type project-id project-ids tags exclude-tags
include-expired?]})Build a Milvus boolean filter expression from query opts.
Build a Milvus boolean filter expression from query opts.
Runtime shape of a memory entry produced by record->entry (open map).
Runtime shape of a memory entry produced by record->entry (open map).
(entry->record entry collection-name)LEGACY FACADE — invokes the BOUNDARY embedder then builds the record. Throws if the embedder fails. Prefer the explicit two-step path:
(let [emb-res (embedder/embed-for-entry entry coll)] (if (r/ok? emb-res) (entry->record-pure entry coll (:ok emb-res)) (handle-err emb-res)))
so embedding failures stay railway-tracked instead of escaping as exceptions. This 2-arg arity is retained for back-compat with pre-CPPB-refactor call sites.
LEGACY FACADE — invokes the BOUNDARY embedder then builds the record.
Throws if the embedder fails. Prefer the explicit two-step path:
(let [emb-res (embedder/embed-for-entry entry coll)]
(if (r/ok? emb-res)
(entry->record-pure entry coll (:ok emb-res))
(handle-err emb-res)))
so embedding failures stay railway-tracked instead of escaping as
exceptions. This 2-arg arity is retained for back-compat with
pre-CPPB-refactor call sites.(entry->record-pure entry _collection-name embedding)PURE: Convert a memory entry + a precomputed embedding vector into a
Milvus insert record. Performs NO embedding lookup, NO provider
resolution, NO I/O — the caller is responsible for producing the
embedding via hive-milvus.embedder/embed-for-entry first.
Splits CPPB stages: this fn is PROMOTE only; the embedding side of
the record (BOUNDARY) lives in hive-milvus.embedder. Callers that
skip the embed step ship a record with an empty vector (suitable
for tests / id-only updates that intentionally don't re-vectorize).
PURE: Convert a memory entry + a precomputed embedding vector into a Milvus insert record. Performs NO embedding lookup, NO provider resolution, NO I/O — the caller is responsible for producing the embedding via `hive-milvus.embedder/embed-for-entry` first. Splits CPPB stages: this fn is PROMOTE only; the embedding side of the record (BOUNDARY) lives in `hive-milvus.embedder`. Callers that skip the embed step ship a record with an empty vector (suitable for tests / id-only updates that intentionally don't re-vectorize).
(feedback->field feedback)Map feedback keyword to entry field name.
Map feedback keyword to entry field name.
(helpfulness-map entry)Build helpfulness ratio map from entry counts.
Build helpfulness ratio map from entry counts.
(now-iso)Current ISO 8601 timestamp string.
Current ISO 8601 timestamp string.
(record->entry row)Convert a Milvus query result row to a memory entry map.
Convert a Milvus query result row to a memory entry map.
(staleness-probability entry)Calculate staleness probability from alpha/beta parameters.
Calculate staleness probability from alpha/beta parameters.
(str->tags s)Deserialize tags from JSON string.
Deserialize tags from JSON string.
(tags->str tags)Serialize tags to JSON string for Milvus VarChar field.
Serialize tags to JSON string for Milvus VarChar field.
(try-parse-json s)Parse JSON string to map/vec, return original on failure.
Parse JSON string to map/vec, return original on failure.
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 |