Chroma as the host's IVectorCollectionStore.
This is the ADAPTER, and the one place allowed to know both sides: the
host's named-collection port and the vendor transport in
hive-chroma.client.
The port the host consumes is handed over at runtime (the :vector/port
host service; with no host, the published hive-spi.vector.ports one), so
the record is extended onto it at FACTORY time with clojure.core/extend,
keyed by the protocol's own method keys (hive-chroma.host/vector-port).
A standalone compile needs no host. This is the shape
hive-milvus.vector-store uses.
The vendor client is already record-oriented: add takes embedding records,
get and query return them, and query is documented as ordered by
increasing distance. So this adapter does NOT reshape payloads. It absorbs
the two things every call site was otherwise repeating by hand:
ws/deref-safe! with its own timeout. Reads were 15s and writes 30s at
the call sites; those are kept, so nothing's timeout changes.:num-results, :get-or-create).
The port speaks :n-results and :get-or-create?, and translating
between the two is exactly why an adapter exists rather than an alias.Chroma as the host's `IVectorCollectionStore`. This is the ADAPTER, and the one place allowed to know both sides: the host's named-collection port and the vendor transport in `hive-chroma.client`. The port the host consumes is handed over at runtime (the `:vector/port` host service; with no host, the published `hive-spi.vector.ports` one), so the record is extended onto it at FACTORY time with `clojure.core/extend`, keyed by the protocol's own method keys (`hive-chroma.host/vector-port`). A standalone compile needs no host. This is the shape hive-milvus.vector-store uses. The vendor client is already record-oriented: `add` takes embedding records, `get` and `query` return them, and `query` is documented as ordered by increasing distance. So this adapter does NOT reshape payloads. It absorbs the two things every call site was otherwise repeating by hand: - the client returns FUTURES, so each caller wrapped itself in `ws/deref-safe!` with its own timeout. Reads were 15s and writes 30s at the call sites; those are kept, so nothing's timeout changes. - the client's option names are its own (`:num-results`, `:get-or-create`). The port speaks `:n-results` and `:get-or-create?`, and translating between the two is exactly why an adapter exists rather than an alias.
(chroma-vector-store)(chroma-vector-store transport)(chroma-vector-store transport proto)A store over the active Chroma transport, or over TRANSPORT when given. With PROTO the record is extended onto that protocol (tests pass the published hive-spi port); without it, onto the host's port. A runtime with no port at all throws with a reason.
A store over the active Chroma transport, or over TRANSPORT when given. With PROTO the record is extended onto that protocol (tests pass the published hive-spi port); without it, onto the host's port. A runtime with no port at all throws with a reason.
(impl-map sig-keys)Pure: the extend map for a protocol whose method keys are sig-keys.
Each key, :-get-collection or :get-collection, maps to the impl of that
method name; a key with no impl is absent.
Pure: the `extend` map for a protocol whose method keys are `sig-keys`. Each key, `:-get-collection` or `:get-collection`, maps to the impl of that method name; a key with no impl is absent.
(install! proto)Extend the record onto PROTO, keyed by the protocol's OWN method keys so a renamed port method cannot silently go unimplemented. Throws when a port method has no implementation here. Returns PROTO.
Extend the record onto PROTO, keyed by the protocol's OWN method keys so a renamed port method cannot silently go unimplemented. Throws when a port method has no implementation here. Returns PROTO.
A ChromaVectorStore. Generates one over the soft vendor transport.
A ChromaVectorStore. Generates one over the soft vendor transport.
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 |