Crowkis command reference: every command by purpose
The Crowkis command reference, grouped by purpose: cache, freshness, trust, memory, reasoning, documents, prompts, cost and operations, with syntax.
The Crowkis command reference covers two families on one RESP3 wire: the standard key-value commands your existing clients already send, and the Crowkis-native C* commands that add the semantic cache, agent memory, document search, guardrails and cost controls. This page groups every native command by what it is for, with its syntax and when to use it.
In plain words. If a client can send GET and SET over RESP3, it can send every command on this page. There is no separate client to install, and the syntax below is the whole interface.
How do you connect and run a command?
Start the server, then connect with any RESP3 client.
crowkis server --port 6383 --data ./crowkis.data| Port | Purpose |
|---|---|
| 6383 | cache protocol, where every command on this page is sent |
| 6384 | dashboard and management HTTP, loopback only by default |
| 6385 | gRPC |
| 6386 | health probes, /livez and /readyz |
The last three ports are derived from the cache port as +1, +2 and +3, so --port N moves all four together. These are the ports since version 0.5.2. Earlier images listen on 6379, which is what the public quickstart still shows, along with the bundled REPL, crowkis cli. The official image is on Docker Hub, and the five-minute deploy walks through a first run.
Three things to know before the first command:
- Auth. Set
CROWKIS_AUTH_TOKENbefore you expose the cache port. With no token, a connection from a non-loopback address is refused with-DENIEDon every command exceptQUIT. - Options are keywords.
TENANT,MODEL,MODEL_VERSION,EX,THRESHOLD,WITHCONFIDENCE,WITHROUTE,IMAGE,INTENT,MATCH,COUNT,RPMandTPMare argument keywords, not commands. They follow the positional arguments. - A miss is null.
CGET,CSTALE,CREUSEandCTOOLGETreturn null when there is nothing to serve. Treat null as "call the model".
The binary has a few subcommands besides server: crowkis doctor checks an install, crowkis init writes a config file with only the keys the server accepts, and crowkis mcp runs the MCP server.
Cache: store and look up answers
CSET query response [EX secs] [TENANT t] [MODEL m] [MODEL_VERSION v] [IMAGE b64]
CGET query [THRESHOLD f] [TENANT t] [MODEL m] [MODEL_VERSION v] [WITHCONFIDENCE] [WITHROUTE] [IMAGE b64]
CSIM query1 query2
CSTALE query [TENANT t]
CIMGGET query IMAGE b64
CSCAN cursor [MATCH p] [COUNT n] [INTENT class]
CVECCOUNT| Command | Use it when |
|---|---|
CSET | You have a fresh model answer to store. Every write passes the five-stage anti-poisoning pipeline, and incoherent pairs are rejected |
CGET | Before every model call. It hits on an exact, vector, structural or dual match |
CGET ... WITHCONFIDENCE | You want the trust signals behind a hit, to apply your own rule |
CGET ... WITHROUTE | You want a routing hint from the confidence score: cache, cheap or expensive |
CSIM | You are calibrating a threshold and need the similarity of two queries |
CSTALE | An expired answer plus a background refresh beats a cold miss. It returns the answer with a stale flag and the remaining TTL |
CIMGGET | The question includes an image |
CSCAN | You need to walk entries by cursor, optionally filtered by intent class |
CVECCOUNT | You want the live count of entries in the vector index |
CSTALE follows the idea HTTP caches call stale-while-revalidate, defined in RFC 5861. Large cached responses can also be streamed in chunks through CROWKIS.STREAM. How matching works is in what a semantic cache is, and the scoring in a cache hit is not a correct answer.
Freshness: remove what is no longer true
CSOURCE LINK|PURGE|LIST source_id [query] [TENANT t]
CINVALIDATE instruction [TENANT t] [THRESHOLD f] [LIMIT n] [COMMIT]
CNOTICE ADD text [EX seconds] [PREVIEW] [TENANT t]
CNOTICE LIST [TENANT t]
CNOTICE CLEAR id [TENANT t]
CDECISION query [TENANT t]
CFLUSH [TENANT t]
CDEDUP
CWHYEVICT query [TENANT t]| Command | Use it when |
|---|---|
CSOURCE LINK | You cache an answer built from a document and want to remember which one |
CSOURCE PURGE | That document changed. Every linked answer is removed |
CINVALIDATE | You can describe what is outdated in plain English. It previews by default and purges only with COMMIT |
CNOTICE ADD | Something changed right now, such as "we close at 3pm today". It checks up to 32 nearby cached answers |
CNOTICE LIST, CLEAR | You need to see or end the active notices. A tenant can hold 8, of 512 bytes each |
CDECISION | The decision engine is on and you want its verdict on one exact question. Read-only |
CFLUSH | You want to clear the whole semantic cache, or one tenant with TENANT |
CDEDUP | You want to fold near-duplicate entries on demand. It reports clusters and memory reclaimed |
CWHYEVICT | You want an entry's retention score, pin status and component weights |
Two honest notes. CNOTICE ADD with PREVIEW reports matches without removing anything, and EX on a notice needs the opt-in decision engine. And there is no eviction scheduler over cache entries: they leave by TTL expiry or explicit delete, so CWHYEVICT explains a score, not a pending removal. See cache invalidation and freshness and cache eviction for LLM answers.
Trust: pins, flags, guardrails and personal data
CPIN query answer [BY who] [TENANT t]
CPINGET query [TENANT t] [THRESHOLD f]
CPINLIST [TENANT t]
CUNPIN query [TENANT t]
CFLAG query bad_answer [REASON r] [TENANT t]
CCHECKBAD query [TENANT t] [THRESHOLD f]
CGUARD <text>
COUTCHECK <text> [JSON]
CPII REPORT [TENANT t]
CPII ERASE id (TENANT t|ALL) [COMMIT]| Command | Use it when |
|---|---|
CPIN | One approved wording must be served verbatim for any phrasing, with a record of who approved it |
CPINGET | Before generation, to check for a pinned answer. It returns the answer and who pinned it |
CPINLIST, CUNPIN | You audit the pinned answers, or remove one |
CFLAG | An answer turned out wrong. It goes into a negative cache that CGET never reads |
CCHECKBAD | Before serving, to see whether a question matches a flagged answer. It returns the query, the bad answer and the reason |
CGUARD | You scan input for prompt injection, jailbreaks and code injection. The reply is a verdict, a category and the match |
COUTCHECK | You scan output for leaked personal data and toxicity, with JSON validation if you add JSON |
CPII REPORT | You need the scrub report for a tenant |
CPII ERASE | Someone asks to be erased. It previews unless you add COMMIT, and it covers pinned answers |
Background: cache poisoning, guardrails at the cache layer and PII scrubbing and erasure.
Agent memory and sessions
CMEMSET agent fact [USER u] [EX secs]
CMEMGET agent query [USER u] [K n]
CMEMEXTRACT agent "<conversation>" [USER u] [EX secs]
CMEMHISTORY agent query [USER u] [K n]
CMEMASOF agent query unix_ms [USER u] [K n]
CMEMFORGET agent [query] [USER u] [THRESHOLD f]
CMEMLINK agent subject relation object [USER u]
CMEMGRAPH agent entity [USER u] [DEPTH d]
CSESSION ADD s role text [EX secs]
CSESSION RECENT s [N n]
CSESSION SEARCH s query [K n]| Command | Use it when |
|---|---|
CMEMSET | The agent learns a durable fact about a user. A contradicting fact retires the old one |
CMEMGET | The agent needs the top facts for a question, ranked by relevance blended with recency |
CMEMEXTRACT | You have a chunk of conversation and want the durable facts pulled out without a model call |
CMEMHISTORY | You need retired versions too, each marked current or superseded |
CMEMASOF | You need what memory believed at a given instant, in Unix milliseconds |
CMEMFORGET | A user's facts must go: those matching a query, or all of them |
CMEMLINK, CMEMGRAPH | You store relationships as edges and walk them to a depth |
CSESSION | You keep a conversation buffer: ADD a turn, read the RECENT ones, or SEARCH all of them by meaning |
Every CMEM* command also takes an optional TOPIC <t>, which files a fact in a room and limits recall to it. The full model is in long-term memory for AI agents.
Reasoning and tool results
CTHINK query cot-trace [TENANT t] [MODEL m] [MODEL_VERSION v]
CREUSE query [TENANT t] [MODEL m] [MODEL_VERSION v]
CTOOLSET tool args result [EX secs] [TENANT t]
CTOOLGET tool args [TENANT t]| Command | Use it when |
|---|---|
CTHINK | The model wrote out a derivation with at least two steps and the same question will return with other values |
CREUSE | The same question arrives with different values. It does not fire on a rephrasing |
CTOOLSET | A tool call is deterministic and repeated. The key is the tool plus its exact arguments |
CTOOLGET | Before running a tool, to check for a stored result with those exact arguments |
Details: caching chain-of-thought reasoning and agent unit economics.
Documents and embeddings
CDOC ADD <id> <text> [TENANT t] [EX s] [CHUNK n] [OVERLAP m] [META k=v ...]
CDOC SEARCH <query> [TENANT t] [K n] [FILTER k=v ...] [RERANK]
CEMBED text| Command | Use it when |
|---|---|
CDOC ADD | You add a document for retrieval. CHUNK and OVERLAP split it, and META tags it |
CDOC SEARCH | You retrieve passages by meaning. FILTER narrows by metadata and RERANK re-scores with the local cross-encoder |
CEMBED | You want the raw vector for a text from the bundled model, with no outside API |
Guides: self-hosted RAG with CDOC and local offline embeddings.
Prompts and evals
CPROMPT SET <name> <template>
CPROMPT GET <name> [version]
CPROMPT LIST
CPROMPT VERSIONS <name>
CPROMPT ROLLBACK <name> <version>
CPROMPT RENDER <name> [version] [VARS k=v ...]
CPROMPT DEL <name>
CPROMPT ABSET <name> [<v> <w> ...]
CPROMPT AB <name> [SUBJECT id]
CEVAL <evaluator> <input> <output> [EXPECT t] [THRESHOLD f]
CEVAL SUITE <input> <output> [EXPECT t]| Command | Use it when |
|---|---|
CPROMPT SET, GET, VERSIONS | You manage prompts as named templates that gain a version on every write |
CPROMPT RENDER | You fill {{k}} placeholders and get the finished prompt |
CPROMPT ROLLBACK | A new version performs worse and you want the earlier one back |
CPROMPT ABSET, AB | You split traffic across versions by weight. Assignment is sticky per subject |
CEVAL | You score one output with one model-free evaluator |
CEVAL SUITE | You run the evaluators together and track the results on /metrics |
The evaluators are non_empty, json_valid, toxicity, pii_leak, injection_safe, answered, exact_match, contains and relevance. See online LLM evals without an LLM judge.
Cost and limits
CBUDGET GET|SET|RESET|ALERTS <tenant> [DAILY usd] [MONTHLY usd] [COST per-1k] [ALERT pct] [CIRCUIT pct]
CKEYLIMIT SET|GET|DEL tenant [RPM n] [TPM n]| Command | Use it when |
|---|---|
CBUDGET | You set or read a tenant's daily and monthly budget. The AI gateway enforces it, with a hard 402 block on upstream calls past the circuit breaker |
CKEYLIMIT | You cap a tenant's requests and tokens per minute on the CGET and CSET fast path. Enterprise only |
The gateway that enforces budgets is described in the OpenAI-compatible AI gateway.
Operations
CINFO [section]
CSAVE dest
CBGSAVE dest
CRELOAD| Command | Use it when |
|---|---|
CINFO | You want server state. Sections: server, cache, savings, security, db, license |
CSAVE | You need a .crowkbak snapshot that is on disk before the reply returns |
CBGSAVE | You want the snapshot in the background. It replies +BGSAVE-STARTED at once |
CRELOAD | You replaced the license file and want it loaded with no dropped connections |
Which standard commands work?
The drop-in surface covers what an application normally sends: strings (GET, SET with its expiry and condition options, MGET, MSET, APPEND), counters (INCR, DECR, INCRBY), hashes, lists, sets, sorted sets, streams, pub/sub, key and TTL commands (DEL, EXISTS, SCAN, EXPIRE, TTL, PERSIST), and the connection and server commands (HELLO, AUTH, PING, INFO, CONFIG). HELLO negotiates RESP2 or RESP3. Pub/sub fans out inside one instance, with no cross-node bus. The public commands documentation lists the standard commands by group.
One number to keep straight: a plain GET and a semantic CGET are not the same speed. CGET embeds the query first, and that embedding is the dominant cost of a cold semantic read.
Common questions
Do I need a special client to send Crowkis commands?
No. Any client that speaks RESP3 can send both families, and your existing clients connect unmodified. The Python and Node SDKs wrap the same commands in methods if you prefer that.
Which Crowkis commands are paid?
One. CKEYLIMIT is marked Enterprise. Every other command on this page is marked free and ships identically in both Docker images. A paid command is compiled out of the free binary and answers with an upgrade pointer, never a silent no-op.
Which commands delete data, and do they preview first?
CINVALIDATE and CPII ERASE preview by default and act only with COMMIT. CNOTICE ADD has a PREVIEW option. CFLUSH, CSOURCE PURGE, CUNPIN and CMEMFORGET act as soon as you send them, so scope them with TENANT or USER.
How do I scope a command to one tenant?
Add TENANT t to the command. Entries carry the tenant they were written under and lookups stay inside it. Tenant names keep their case, and a name containing : or ~ is rejected at the wire. The Community edition allows up to three tenants. The product overview is on the Crowkis page.