CLI

A redis-cli for your cognition cache — inspect what's cached (understanding, provenance, raw evidence) and manage it from the terminal.

Coalent ships a coalent command to inspect and manage a persistent cache from your terminal — the same ergonomics as redis-cli, for understanding.

It operates on a SQLite store — the same file you pass to SemanticCache(store=SQLiteCognitionStore("coalent.db")). Point it with --db (or $COALENT_DB, default coalent.db):

coalent --db coalent.db ls

Commands

ls

List cached cognition units — status, hits, age, number of sources, id, and the query.

coalent ls
STATUS  HITS  AGE SRC  ID                  QUERY
fresh      6   2m   2  cog:c95a9d2897e0af  what is our leave policy?
dirty      1  12m   1  cog:7f1a0b9c3d2e4f  remote work rules

show

Inspect one unit in full — its understanding, provenance (artifact id, version, content hash), and raw evidence.

coalent show cog:c95a9d2897e0af
coalent show cog:c95a9d2897e0af --full    # untruncated raw evidence
coalent show cog:c95a9d2897e0af --json    # the whole unit as JSON
id:        cog:c95a9d2897e0af
namespace: (default)
query:     what is our leave policy?
status:    fresh    hits: 6    age: 2m

understanding
  { "summary": "...", "claims": [...], "facts": {...} }

provenance (1 span(s))
  - confluence:98231  @7  #*  fa9fc5d820

raw evidence (1 chunk(s))
  -- confluence:98231  @7
     Leave policy: 21 days of annual leave per year.

invalidate

Dirty every unit that used a source artifact (manual invalidation by artifact_id).

coalent invalidate confluence:98231

dirty

Mark one specific unit stale (it rebuilds on its next read).

coalent dirty cog:c95a9d2897e0af

evict

Remove one unit from the cache.

coalent evict cog:c95a9d2897e0af

purge

Remove all units. Requires --yes to confirm.

coalent purge --yes

stats

coalent stats
units:             3
  fresh:           2
  dirty:           1
tracked artifacts: 5

Next