go-redis
The official Redis client library for Go. go-redis (formerly go-redis/redis) provides a type-safe API for all Redis commands, connection pooling, Redis Cluster and Sentinel support, pipelining, transactions (MULTI/EXEC), Pub/Sub, and Redis Streams. The de-facto standard Go Redis client used in production systems.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
TLS/SSL supported. Redis AUTH command for password auth. ACL support in Redis 6+. In-memory data — ensure Redis is not publicly exposed.
⚡ Reliability
Best When
You need a fast, full-featured Go Redis client with type-safe commands, connection pooling, and support for all Redis data types for agent caching, queuing, or pub/sub.
Avoid When
You're using Valkey or KeyDB — check compatibility, as go-redis targets Redis; some Valkey/KeyDB-specific commands may need additional handling.
Use Cases
- • Cache agent computation results in Redis with TTL expiration — store LLM outputs, API responses, and embeddings for repeated queries
- • Implement distributed locks for coordinating agent parallel workflows using Redis SET NX EX atomically
- • Use Redis Pub/Sub for agent event broadcasting — publish agent status updates, subscribe to task queues without polling
- • Build agent rate limiting using Redis atomic operations — INCR + EXPIRE for sliding window rate limiters across distributed agent instances
- • Stream agent workflow events using Redis Streams (XADD, XREAD) for durable, ordered event processing with consumer groups
Not For
- • Persistent primary data storage — Redis is in-memory; use PostgreSQL or MongoDB for data that must survive server restarts without RDB/AOF
- • Complex SQL queries or relational data — Redis is a key-value store; use a relational database for complex query requirements
- • Large dataset storage — Redis stores data in RAM; cost-prohibitive for datasets larger than available memory
Interface
Authentication
Library — no external auth. Redis credentials (password, username) in redis.Options. TLS support for Redis TLS connections.
Pricing
BSD-licensed open source maintained by Redis Ltd (formerly Redislabs).
Agent Metadata
Known Gotchas
- ⚠ redis.Nil is returned when a key doesn't exist — agent code must check 'if err == redis.Nil' to distinguish missing key from actual error; other nil checks don't work
- ⚠ Connection pool exhaustion returns 'redis: connection pool timeout' — configure PoolSize based on agent concurrency requirements; default is 10 connections per CPU core
- ⚠ Pub/Sub Subscribe() blocks until a message arrives — run subscriber in a goroutine; the Receive() call blocks the current goroutine until a message or error arrives
- ⚠ Pipelining (client.Pipeline()) buffers commands but doesn't guarantee atomicity — use MULTI/EXEC transaction for atomic agent operations on Redis state
- ⚠ go-redis v9 removed deprecated APIs from v8 — check migration guide when upgrading; several method signatures and option types changed
- ⚠ Redis Cluster routes commands to the shard owning the key — MGET/MSET across different slots requires go-redis ClusterClient which handles cross-slot routing automatically
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for go-redis.
Scores are editorial opinions as of 2026-03-06.