Datahike-backed IMemoryStore + IMemoryStoreTemporal for hive-proximum.
Bitemporal design:
Protocol extension uses extend (function, not macro) over the
hive-spi.memory.ports protocols; no dependency on hive-mcp.
Seal readiness: store-status declares :capabilities [:embed-text] and the
transient :embed-text is never persisted (strip-transient);
IMemoryStoreScan's scan-ids enumerates every live id from one immutable
db snapshot.
Backend: Datahike 0.8.1667 (matches hive-mcp/hive-knowledge)
Datahike-backed IMemoryStore + IMemoryStoreTemporal for hive-proximum. Bitemporal design: - Every write is a new Datahike transaction (immutable fact log) - Updates add new facts; old values preserved in history - Deletes set :entry/deleted? true (tombstone, never hard-delete) - Temporal queries use d/as-of and d/history for time-travel Protocol extension uses `extend` (function, not macro) over the hive-spi.memory.ports protocols; no dependency on hive-mcp. Seal readiness: store-status declares :capabilities [:embed-text] and the transient :embed-text is never persisted (`strip-transient`); IMemoryStoreScan's scan-ids enumerates every live id from one immutable db snapshot. Backend: Datahike 0.8.1667 (matches hive-mcp/hive-knowledge)
What callers may rely on beyond the IMemoryStore port, declared under :capabilities in store-status (the hive-spi.memory.decorate contract).
:embed-text an entry's transient :embed-text is never persisted, under
any spelling or depth (strip-transient). This store does
not embed (supports-semantic-search? is false), so there is
no index the ciphertext of a sealing decorator could reach;
the text it hands over is dropped.
What callers may rely on beyond the IMemoryStore port, declared under
:capabilities in store-status (the hive-spi.memory.decorate contract).
:embed-text an entry's transient :embed-text is never persisted, under
any spelling or depth (`strip-transient`). This store does
not embed (supports-semantic-search? is false), so there is
no index the ciphertext of a sealing decorator could reach;
the text it hands over is dropped.(create-store)(create-store opts)Create a ProximumStore instance. Does NOT connect immediately (lazy). Options: :backend - :memory (default) or :file :path - file path for :file backend (default: data/proximum/datahike) :config - raw Datahike config map (overrides :backend/:path)
Create a ProximumStore instance. Does NOT connect immediately (lazy). Options: :backend - :memory (default) or :file :path - file path for :file backend (default: data/proximum/datahike) :config - raw Datahike config map (overrides :backend/:path)
(create-stub-store)Create a ProximumStore. Replaces the old stub. Uses in-memory Datahike backend by default.
Create a ProximumStore. Replaces the old stub. Uses in-memory Datahike backend by default.
(ensure-conn! {:keys [conn-atom cfg]})Ensure Datahike connection is established. Returns conn.
Ensure Datahike connection is established. Returns conn.
(entity->map e)Convert Datahike entity map to clean entry map.
:entry/content is stored as a JSON-encoded string by add-entry! /
update-entry! (see entry->tx-data). Parse it back to a Clojure map
on read so callers (e.g. kanban transitions) see structured content
without round-tripping through json/read-str. Non-JSON content
(legacy plain strings) is returned as-is.
Convert Datahike entity map to clean entry map. `:entry/content` is stored as a JSON-encoded string by `add-entry!` / `update-entry!` (see `entry->tx-data`). Parse it back to a Clojure map on read so callers (e.g. kanban transitions) see structured content without round-tripping through `json/read-str`. Non-JSON content (legacy plain strings) is returned as-is.
(entry->tx-data raw-entry)Convert entry map to Datahike transaction data.
:entry/content is canonically JSON-encoded so entity->map on read
can deserialize back to a Clojure map. Pre-encoded strings (e.g. JSON
produced by memory-kanban) pass through untouched.
The transient :embed-text is stripped first, at every depth
(strip-transient), so it never reaches the fact log. The expiry is
taken from :expires-at, or from the port's ISO-8601 :expires string.
Convert entry map to Datahike transaction data. `:entry/content` is canonically JSON-encoded so `entity->map` on read can deserialize back to a Clojure map. Pre-encoded strings (e.g. JSON produced by `memory-kanban`) pass through untouched. The transient :embed-text is stripped first, at every depth (`strip-transient`), so it never reaches the fact log. The expiry is taken from :expires-at, or from the port's ISO-8601 :expires string.
(extend-store-protocols!)Extend ProximumStore with IMemoryStore, IMemoryStoreScan and
IMemoryStoreTemporal, the hive-spi.memory.ports protocols (hive-mcp's
hive-mcp.protocols.memory re-exports the same protocol values).
Uses extend (function).
Safe to call multiple times (idempotent via atom guard).
Extend ProximumStore with IMemoryStore, IMemoryStoreScan and IMemoryStoreTemporal, the hive-spi.memory.ports protocols (hive-mcp's hive-mcp.protocols.memory re-exports the same protocol values). Uses `extend` (function). Safe to call multiple times (idempotent via atom guard).
(make-datahike-config)(make-datahike-config {:keys [backend path]
:or {backend :memory path "data/proximum/datahike"}})Build Datahike config map. Supports :memory and :file backends.
Build Datahike config map. Supports :memory and :file backends.
(pull-entry db id)Pull an entry from db, return nil if deleted or not found.
Pull an entry from db, return nil if deleted or not found.
(pull-entry-raw db id)Pull an entry from db, including deleted entries.
Pull an entry from db, including deleted entries.
(scan-ids store {:keys [include-expired?]})Every live (not tombstoned) entry id in STORE, each once. Opts: :include-expired? (default false) also lists entries whose expiry has passed. One Datahike db value is an immutable snapshot, so a single read is the whole store; a failure to read it throws, it never answers short.
Every live (not tombstoned) entry id in STORE, each once. Opts: :include-expired? (default false) also lists entries whose expiry has passed. One Datahike db value is an immutable snapshot, so a single read is the whole store; a failure to read it throws, it never answers short.
(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 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.
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 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.
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 |