Skip to content
CAI
Software that uses CAICheck a score

redis/redis-rb

61.8

Adequate · 14 November 2026

17.7k

lines of production code

Ruby

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Added IRB console script for Redis interaction

A new executable script at bin/console has been added to the project. This script sets up the Ruby load path to include the local library, requires the 'redis' gem, and launches an IRB session, allowing users to interactively test and debug Redis connections using the application's codebase.

bin · high confidence

Added RESP2 vs RESP3 performance benchmarking tool

A new benchmark script (bench/resp\_comparison.rb) has been added to compare the performance of Redis RESP2 and RESP3 protocols. The tool measures throughput (RPS) and CPU usage across various workload complexities—including simple GETs, hash flattening (HGETALL), score pairing (ZRANGE WITHSCORES), and stream entry parsing (XRANGE)—under both single-threaded and multi-threaded scenarios, allowing users to evaluate protocol efficiency for their specific use cases.

bench · high confidence

Added Redis clustering library entry point

A new file, cluster/lib/redis-clustering.rb, has been added to the codebase. This file serves as a simple entry point that requires the 'redis/cluster' library, enabling users to access Redis clustering functionality through this specific path.

cluster/lib · high confidence

Added cluster console script for interactive Redis Cluster sessions

A new executable script \cluster/bin/console\ has been added to the project. This script sets up an interactive Ruby IRB environment with the \redis/cluster\ library loaded, allowing users to manually interact with a Redis Cluster instance for debugging or exploration purposes.

cluster/bin · high confidence

Added sentinel example with automated start script and configuration

The sentinel example now includes a new sentinel.conf configuration file defining two monitored masters and a start script that automatically launches a full environment (two masters, four slaves, and two sentinels) and simulates a master failure after 30 seconds to demonstrate sentinel behavior.

examples/sentinel · high confidence

Added support for RedisJSON and RediSearch modules

This change introduces client-side support for the RedisJSON and RediSearch modules. The new \lib/redis/commands/modules/json.rb\ file implements JSON CRUD operations (including \JSON.SET\, \JSON.GET\, \JSON.MSET\, and \JSON.MGET\) with automatic serialization and deserialization of Ruby objects to/from JSON text, along with protocol-independent reply normalization for RESP2 and RESP3. Additionally, \lib/redis/commands/modules/search.rb\ initializes the RediSearch command interface by requiring the necessary sub-components for index definitions, schemas, queries, and aggregation.

lib/redis/commands/modules · high confidence

Cluster client now supports transactions and keyspace notifications

The cluster client now supports transactions and keyspace notifications. Transactions are implemented via a new TransactionAdapter that wraps the underlying RedisClient::Cluster transaction, ensuring compatibility with the standalone client's API while handling cluster-specific constraints like node routing and optimistic locking. Keyspace notifications are supported through a new KeyspaceNotifications manager that fans out subscriptions to all cluster primaries, preserving per-node ordering and handling topology changes reactively. The client also includes error mapping for cluster-specific errors and supports the RESP3 protocol.

cluster/lib/redis/cluster · high confidence

Introduce Redis Cluster client with transaction, HIMPORT, and keyspace notification support

This change adds the \Redis::Cluster\ client class, enabling users to connect to and operate on Redis Cluster deployments. The new client supports optimistic locking via a block-based \watch\ API, implements the \HIMPORT\ command family with automatic fieldset recovery and routing overrides for API parity, and provides a \keyspace\_notifications\ manager that subscribes to events on all primary nodes. It also includes specific error classes for cluster-specific scenarios (such as \NodeMightBeDown\ and \CommandErrorCollection\) and allows client identification via \CLIENT SETINFO\.

cluster/lib/redis · high confidence

Introduces a fluent builder API for the Redis Query Engine (RediSearch)

Adds a new set of classes in the \lib/redis/commands/modules/search\ directory to provide a structured, object-oriented interface for RediSearch commands. This includes \Index\ for managing index creation and document operations, \Query\ and \AggregateRequest\ for building \FT.SEARCH\ and \FT.AGGREGATE\ requests with a fluent builder pattern, and \Field\ subclasses for defining schemas. The implementation also introduces support for the Query Engine's dialect 2 (the new default), hybrid vector-text search via \HybridQuery\, and explicit handling of index definitions and result parsing. Also in this area: 1 commit (0 fixes) modifying lib/redis, lib/redis/commands/modules/search; Support for Ruby Ractors; Support for SQ8 vector compression in Search fields.

lib/redis/commands/modules/search · medium confidence · unverified

New Redis Search example scripts for aggregations, geospatial, hybrid, and vector similarity search

The examples/search directory now includes several new Ruby scripts demonstrating advanced Redis Search capabilities. search\_aggregations.rb shows how to use FT.AGGREGATE with reducers like COUNT, SUM, AVG, and GROUPBY operations. search\_geo.rb demonstrates geospatial queries using geo and geoshape fields for radius and polygon-based searches. search\_hybrid.rb introduces hybrid search (FT.HYBRID) combining lexical and vector similarity legs with fusion strategies like RRF and LINEAR. search\_vector\_similarity.rb covers vector similarity search with HNSW and FLAT algorithms, including KNN and hybrid vector-filter queries. search\_raw\_ft\commands.rb provides low-level examples using raw FT.\ commands as an alternative to the high-level Index API.

examples/search · high confidence

New and updated example scripts for Redis features

The examples directory now includes standalone scripts demonstrating basic operations, distributed Redis, lists, sets, and increment/decrement commands. New examples cover Pub/Sub with automatic reconnection, Sentinel failover simulation, and a consistency test for verifying write integrity. Additionally, examples for Keyspace and Subkey notifications are provided, including a version-aware script for Redis 8.8+ subkey support and a pool-integrated variant for multi-threaded environments.

examples · high confidence

Architecture

Repository restructured with modern tooling and documentation

The repository has been reorganized to support modern development workflows. A new \.rubocop.yml\ configuration enforces code style for Ruby 3.2+, and a \.ruby-version\ file sets the target runtime to 3.3.0. Development infrastructure is now containerized via \docker-compose.yml\ and managed through a \makefile\, allowing developers to easily spin up standalone, sentinel, cluster, and module test environments. Comprehensive documentation has been added, including \AGENTS.md\ for architectural guidance and a detailed \CHANGELOG.md\ outlining the 6.0.0 release features and breaking changes. The legacy \redis.rb\ script has been removed as the gem is now installed via standard RubyGems.

(repo-wide) · high confidence

Behavioural changes

Redis client now defaults to RESP3 with automatic fallback to RESP2

The Redis client now uses the RESP3 protocol by default for all connections, providing native types (maps, sets, doubles) and improved performance. If the server does not support RESP3 (e.g., Redis \< 6.0 or servers rejecting HELLO 3), the client automatically falls back to RESP2, ensuring compatibility with older Redis versions. This change is transparent to users, but may affect reply types in pipelines and transactions if not handled correctly.

lib/redis · high confidence

Redis client now uses redis-client as the underlying transport layer

The Redis library has been refactored to use the \redis-client\ gem for network communication, replacing the previous internal socket and protocol implementation. This change introduces support for the RESP3 protocol (negotiated via the \:protocol\ option, defaulting to 3), allows passing a \:driver\ option to select between \:ruby\ and \:hiredis\ backends, and adds new connection options such as \:username\ for ACL authentication, \:driver\_info\ for client identification, and \:himport\_auto\_prepare\ for automatic hash fieldset recovery. The public API remains largely compatible, but internal methods like \queue\ and \commit\ have been removed in favor of block-based pipelining, and the \Redis.current\ global accessor has been deprecated.

lib · high confidence

Refactored command API into modular files and added new Redis commands

The Redis command interface has been reorganized into distinct modules (such as Arrays, Bitmaps, Geo, Hashes, Lists, Pubsub, and Scripting) to improve maintainability. This change introduces support for new Redis commands including array operations (arset, arget, armset, armget, ardel, arinsert, arseek), list multi-move commands (LMOVEM, BLMOVEM), geospatial search (GEOSEARCH, GEOSEARCHSTORE), and Redis Functions management (FUNCTION LOAD, LIST, DELETE, STATS). It also adds new options to existing commands, such as NX/XX/GT/LT for expiration commands and WITHSCORE for sorted set ranking commands.

lib/redis/commands · high confidence

Unicorn example demonstrates safe Redis connection handling after forking

The Unicorn example now includes a configuration that disconnects the Redis client after the worker process forks. This prevents multiple worker processes from sharing a single file descriptor, which can lead to concurrency issues and protocol errors. The example also enforces frozen string literals for compatibility.

examples/unicorn · high confidence

Test coverage

Added Redis Sentinel configuration files for test infrastructure; Added SSL test fixtures and certificate generation script; Added comprehensive test suite for Redis cluster client; Added distributed test coverage for Redis commands and internals; Added placeholder for test/db directory; Added sentinel test suite; Added test infrastructure for mocking Redis connections; Added tests for JSON module commands and Search module schema/DSL; Added tests for the add-new-command skill and its spec resolver; Comprehensive lint test suite for Redis data types and commands; Expanded test coverage for Redis commands and client internals; Refactor test infrastructure to use Minitest and RESP3.

Dependencies

Update gem dependencies and require Ruby 3.2+

The redis and redis-clustering gems now require Ruby 3.2.0 or later. The core redis gem pins its runtime dependency on redis-client to version 0.30.1, and the redis-clustering gem depends on redis-cluster-client version 0.17.0. Development dependencies have been organized into Gemfiles, including minitest, rake, rubocop (\~\> 1.88.0), mocha, and hiredis-client.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 62 → 62 (-0.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 65 → 62 (-3.2)
  • Architecture 90 → 90 (+0.0)
  • Maturity 63 → 64 (+1.1)
  • Readiness 55 → 55 (+0.0)
  • Security 85 → 84 (-1.6)

Resolved (6)

  • Duplicated block (13 lines × 2) (examples/search/search_vector_similarity.rb)
  • Duplicated block (15 lines × 2) (examples/search/search_aggregations.rb)
  • Duplicated block (40–42 lines × 2) (examples/search/search_quickstart.rb)
  • Low cohesion: Redis (LCOM4 151) (lib/redis.rb)
  • Off-boarding risk: anonymized user #1
  • Orphaned file (lib/redis/commands/bitmaps.rb)

New (23)

  • Duplicated block (6 lines × 5) (lib/redis/commands/hashes.rb)
  • Duplicated block (7 lines × 2) (lib/redis/commands/hashes.rb)
  • Duplicated block (8 lines × 2) (lib/redis/commands/hashes.rb)
  • Edited copies of one member (3 members, 14+ corresponding lines) (lib/redis/commands/hashes.rb)
  • Edited copy of a member (1 corresponding lines) (lib/redis/commands/modules/search/index.rb)
  • Edited copy of a member (12 corresponding lines) (lib/redis/commands/geo.rb)
  • Edited copy of a member (12 corresponding lines) (lib/redis/commands/streams.rb)
  • Edited copy of a member (13 corresponding lines) (lib/redis/commands/sorted_sets.rb)
  • Edited copy of a member (15 corresponding lines) (lib/redis/commands/modules/search/field.rb)
  • Edited copy of a member (20 corresponding lines) (lib/redis/commands/sorted_sets.rb)
  • Edited copy of a member (3 corresponding lines) (lib/redis/commands/sorted_sets.rb)
  • Edited copy of a member (3 corresponding lines) (lib/redis/commands/sorted_sets.rb)
  • Edited copy of a member (4 corresponding lines) (lib/redis/commands/sets.rb)
  • Edited copy of a member (5 corresponding lines) (lib/redis.rb)
  • Edited copy of a member (6 corresponding lines) (lib/redis/commands/hashes.rb)
  • Edited copy of a member (7 corresponding lines) (lib/redis/commands/modules/json.rb)
  • Edited copy of a member (8 corresponding lines) (lib/redis/commands/hashes.rb)
  • Edited copy of a member (8 corresponding lines) (lib/redis/commands/modules/search/aggregation.rb)
  • Edited copy of a member (8 corresponding lines) (lib/redis/commands/scripting.rb)
  • Low cohesion: Redis (LCOM4 166) (lib/redis.rb)
  • …and 3 more

Changes since last survey

  • 5 commits — 5 feature/other, 0 fixes

By area

  • lib/redis — 4 commits
  • (root) — 1 commit

Notable commits

  • change: Add support for Set Expiration commands (#1405)
  • change: Added CONTRIBUTORS.md (#1410)
  • change: Added support for BITRANGEINTARRAY command (#1409)
  • change: Added support for HOTKEYS commands (#1408)
  • change: Added support for ZMOVE, BZMOVE, ZMOVEMEMBER commands (#1411)

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

redis/redis-rb was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 3c95432bae5b697227e766baa6cd50b89b30d444 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.