A Redis-compatible in-memory cache written in Rust. It speaks RESP2, runs on Tokio’s current_thread runtime, and treats Redis 7.2.4 as the compatibility oracle. Valkey is the only permitted secondary reference.
Engram is a cache server, not a Redis replacement. Replication, pub/sub, Lua, cluster, streams, and RESP3 are out of scope for now.
Implemented against Redis 7.2.4:
- Strings with expiry (
SEToptions,GETEX/GETDEL,MSET, ranges,INCR) - Hashes, lists/queues, sets, and non-lexicographic sorted sets
- Blocking list/zset pops with FIFO waiter order
KEYS/SCAN(cursors are opaque; they need not match Redis)MULTI/EXEC/DISCARD/WATCH/UNWATCH- RDB v11 persistence (
SAVE;BGSAVEis currently synchronous)
SELECT accepts database 0 only. Lexicographic zset commands are not implemented.
Requires Rust 1.85+.
cargo build --offline
target/debug/engram --bind 127.0.0.1 --port 6379
--dir and --dbfilename select the RDB file (default ./dump.rdb). On startup Engram loads that file if it exists.
The differential harness compares Engram to a local Redis 7.2.4 build. Clone and compile it once:
git clone --branch 7.2.4 --depth 1 https://github.com/redis/redis.git redis-reference
make -C redis-reference
make verify
make verify runs unit tests, then redis-compare: it starts Engram and redis-reference/src/redis-server, sends identical commands to both, and fails on any deterministic RESP2 difference. The harness also covers blocking pops, transactions, redis-benchmark, and bidirectional RDB v11 load/save.
crates/engram/ server
crates/redis-compare/ live differential verifier
redis-reference/ is a local Redis 7.2.4 checkout used only for verification. It is not part of this repository.
MIT. See LICENSE.