Core CRUD operations for Chroma memory entries.
Core CRUD operations for Chroma memory entries.
(collection-stats)Get statistics about the Chroma collection.
Get statistics about the Chroma collection.
(delete-all-entries!)Remove every entry from every collection a read could visit. Returns the number of entries removed. With no embedding provider configured no entry can have been written, so there is nothing to remove and this answers 0 rather than throwing.
Remove every entry from every collection a read could visit. Returns the number of entries removed. With no embedding provider configured no entry can have been written, so there is nothing to remove and this answers 0 rather than throwing.
(delete-entry! id)Delete a memory entry from the Chroma index. Tries all collections.
Delete a memory entry from the Chroma index. Tries all collections.
(embed-input entry doc-text)The text to embed for ENTRY: its transient :embed-text when the caller gave a string one (a sealing decorator whose :content is ciphertext), else DOC-TEXT, the document built from the stored content. A given :embed-text is never traded for the document, not even a blank one: indexing the ciphertext is what the :embed-text capability exists to prevent.
The text to embed for ENTRY: its transient :embed-text when the caller gave a string one (a sealing decorator whose :content is ciphertext), else DOC-TEXT, the document built from the stored content. A given :embed-text is never traded for the document, not even a blank one: indexing the ciphertext is what the :embed-text capability exists to prevent.
A memory entry read back from Chroma metadata (helpers/metadata->entry).
A memory entry read back from Chroma metadata (helpers/metadata->entry).
A memory entry to index. Only :content is read unconditionally; every other field is optional and dropped from metadata when nil.
A memory entry to index. Only :content is read unconditionally; every other field is optional and dropped from metadata when nil.
(find-duplicate type content-hash & {:keys [project-id]})Find entry with matching content-hash in the given type. Pushes content-hash into the Chroma metadata filter so large stores (>1000 entries per type) still dedupe correctly instead of silently falling off the query window.
Find entry with matching content-hash in the given type. Pushes content-hash into the Chroma metadata filter so large stores (>1000 entries per type) still dedupe correctly instead of silently falling off the query window.
(get-entry-by-id id)Get a memory entry by ID from Chroma. Searches default + large collections.
Get a memory entry by ID from Chroma. Searches default + large collections.
(index-memory-entries! entries)Index multiple memory entries in batch with full metadata. Uses the shared provider gate for the complete embed-batch call. Entries should have :id pre-set. A transient string :embed-text is embedded in place of the document and never persisted. Space-guarded: a default collection stamped with another embedding space than the global provider's refuses the batch (:embedding-space-mismatch) before anything is embedded or written.
Index multiple memory entries in batch with full metadata. Uses the shared provider gate for the complete embed-batch call. Entries should have :id pre-set. A transient string :embed-text is embedded in place of the document and never persisted. Space-guarded: a default collection stamped with another embedding space than the global provider's refuses the batch (:embedding-space-mismatch) before anything is embedded or written.
(index-memory-entry! entry)Index a memory entry in Chroma, returns entry ID.
A transient string :embed-text is embedded in place of the document built
from :content (see embed-input) and is never persisted, under any
spelling or depth (see strip-transient).
Index a memory entry in Chroma, returns entry ID. A transient string :embed-text is embedded in place of the document built from :content (see `embed-input`) and is never persisted, under any spelling or depth (see `strip-transient`).
(query-entries &
{:keys [type project-id project-ids tags exclude-tags limit
include-expired?]
:or {limit 100 include-expired? false}})Query memory entries from Chroma with filtering. :exclude-tags — seq of tags to exclude via $not_contains.
Query memory entries from Chroma with filtering. :exclude-tags — seq of tags to exclude via $not_contains.
(query-grounded-from disc-path)Query entries grounded from a specific disc path.
Query entries grounded from a specific disc path.
(read-collections type)Collections a read of TYPE must visit. With no embedder provider configured the type routing names no collection at all, yet writes still land in the default one, so an empty routing answer means the default collection, never nothing.
Collections a read of TYPE must visit. With no embedder provider configured the type routing names no collection at all, yet writes still land in the default one, so an empty routing answer means the default collection, never nothing.
(scan-ids {:keys [include-expired?]})Every entry id across every collection an entry can live in, each once.
Opts: :include-expired? (default false). Offset paging over a collection
that changes under it can skip a row, so two passes must agree on the id
set; after scan-attempts disagreeing pairs this throws rather than answer
a list that may be short. With no embedding provider configured nothing can
have been written, so the answer is empty.
Every entry id across every collection an entry can live in, each once. Opts: :include-expired? (default false). Offset paging over a collection that changes under it can skip a row, so two passes must agree on the id set; after `scan-attempts` disagreeing pairs this throws rather than answer a list that may be short. With no embedding provider configured nothing can have been written, so the answer is empty.
(staleness-updates opts)Entry field updates for staleness OPTS. The port names the fields :staleness-alpha, :staleness-beta, :staleness-source and :staleness-depth; the short :alpha, :beta, :source and :depth spellings are still accepted, and lose to the port names when both are given.
Entry field updates for staleness OPTS. The port names the fields :staleness-alpha, :staleness-beta, :staleness-source and :staleness-depth; the short :alpha, :beta, :source and :depth spellings are still accepted, and lose to the port names when both are given.
Staleness fields, under the port names or their short spellings.
Staleness fields, under the port names or their short spellings.
Entry updates carrying only the port-named staleness fields.
Entry updates carrying only the port-named staleness fields.
(strip-transient x)X without its transient embed-text keys, at every depth: dropped from X when X is a map and from every map nested in X, through maps, sequences and sets. :embed-text is embedding input only; persisting it under any spelling would store the plaintext a sealing decorator encrypted. A value with nothing to drop comes back identical, and a collection holding no collection is not walked, so an embedding vector is never rebuilt.
X without its transient embed-text keys, at every depth: dropped from X when X is a map and from every map nested in X, through maps, sequences and sets. :embed-text is embedding input only; persisting it under any spelling would store the plaintext a sealing decorator encrypted. A value with nothing to drop comes back identical, and a collection holding no collection is not walked, so an embedding vector is never rebuilt.
(update-entry! id updates)Update a memory entry in Chroma by ID. The merged entry is re-indexed, so it is always re-embedded: from a transient string :embed-text in UPDATES when given (also when UPDATES carries no :content), else from the document of the merged content. :embed-text is never persisted.
Update a memory entry in Chroma by ID. The merged entry is re-indexed, so it is always re-embedded: from a transient string :embed-text in UPDATES when given (also when UPDATES carries no :content), else from the document of the merged content. :embed-text is never persisted.
(update-staleness! entry-id opts)Update staleness fields for a Chroma entry.
Update staleness fields for a Chroma entry.
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 |