Skip to main content
Cache-Pot supports the same core data types as Redis — strings, hashes, lists, sets, and sorted sets — plus a native vector collection type built for embedding-based search. Every key in the keyspace holds exactly one type, and you use that type’s dedicated commands to interact with it. All types support expiry via EXPIRE and PEXPIRE, and you can always check what type a key holds with the TYPE command.

Strings

Binary-safe values up to 512 MB. Strings are the most fundamental type and double as integers when the stored value is a valid integer — commands like INCR and INCRBY operate atomically on the numeric representation. Key commands: SET, GET, INCR, DECR, INCRBY, DECRBY, APPEND, STRLEN, GETRANGE, SETRANGE, GETSET, MGET, MSET
SET counter 0
INCR counter         # (integer) 1
APPEND greeting "Hello"
GET greeting         # "Hello"

Hashes

Field-value maps stored under a single key — ideal for representing objects like users, sessions, or configuration records. Each field is itself a string value. Key commands: HSET, HGET, HGETALL, HDEL, HLEN, HKEYS, HVALS, HEXISTS, HMGET
HSET user:1 name Alice age 30
HGET user:1 name     # "Alice"
HGETALL user:1       # 1) "name" 2) "Alice" 3) "age" 4) "30"

Lists

Ordered sequences of strings where you can push and pop from either end. Use lists for queues, stacks, timelines, and any workload that needs ordered insertion. Key commands: LPUSH, RPUSH, LPOP, RPOP, LRANGE, LLEN, LINDEX
RPUSH queue task1 task2 task3
LPOP queue           # "task1"
LRANGE queue 0 -1    # 1) "task2" 2) "task3"

Sets

Unordered collections of unique string members. Sets enforce uniqueness automatically — adding an already-present member is a no-op. Use sets for tags, unique visitors, or membership checks. Key commands: SADD, SMEMBERS, SISMEMBER, SREM, SCARD
SADD tags go redis ai
SISMEMBER tags go    # (integer) 1
SMEMBERS tags        # 1) "go" 2) "redis" 3) "ai"

Sorted Sets

Members paired with a floating-point score. Cache-Pot keeps members ordered by score at all times, making sorted sets perfect for leaderboards, priority queues, and time-series data (using timestamps as scores). Key commands: ZADD, ZRANGE, ZRANGEBYSCORE, ZSCORE, ZREM, ZCARD
ZADD leaderboard 100 alice 200 bob 150 carol
ZRANGE leaderboard 0 -1 WITHSCORES
# 1) "alice" 2) "100" 3) "carol" 4) "150" 5) "bob" 6) "200"

Vector Collections

Float32 vector arrays with cosine similarity search — Cache-Pot’s native AI-oriented type. A collection is a named group of vectors that all share the same dimension. The dimension is fixed the moment you insert the first vector; subsequent inserts must match it exactly. Each vector entry has three parts: a string ID, the float32 array, and an optional META string for storing arbitrary text (such as the source document or a serialised JSON payload). Key commands: VSET, VSEARCH, VDEL, VCARD, VDIM
VSET embeddings doc1 0.1 0.2 0.3 META "intro to AI"
VSET embeddings doc2 0.9 0.8 0.7 META "advanced AI"
VSEARCH embeddings 0.1 0.2 0.3 TOPK 5
# 1) "doc1" 2) "intro to AI"
All vectors in a collection must have the same dimension. If you attempt a VSET with a different number of floats than the first insertion, Cache-Pot returns an error. Plan your embedding dimensions before populating a collection.

Inspecting key types

Use TYPE to check any key’s type at any time:
TYPE counter        # string
TYPE user:1         # hash
TYPE queue          # list
TYPE tags           # set
TYPE leaderboard    # zset
TYPE embeddings     # vector
TYPE missing-key    # none

Key expiry

Every data type supports automatic expiry. Set a time-to-live with EXPIRE (seconds) or PEXPIRE (milliseconds), and Cache-Pot deletes the key once the TTL elapses:
SET session "xyz" EX 3600          # string: built-in expiry
HSET user:tmp email "t@x.com"
EXPIRE user:tmp 600                # any type: set TTL separately
TTL user:tmp                       # seconds remaining
PERSIST user:tmp                   # remove TTL entirely
Use SCAN with the TYPE filter instead of KEYS on large keyspaces — SCAN is non-blocking and cursor-based, so it doesn’t stall the server while iterating millions of keys.