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.

Evaluated Mar 06, 2026 (0d ago) vv9
Homepage ↗ Repo ↗ Developer Tools go redis cache pub-sub streams cluster open-source
⚙ Agent Friendliness
63
/ 100
Can an agent use this?
🔒 Security
85
/ 100
Is it safe for agents?
⚡ Reliability
85
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
82
Auth Simplicity
85
Rate Limits
85

🔒 Security

TLS Enforcement
90
Auth Strength
85
Scope Granularity
80
Dep. Hygiene
88
Secret Handling
82

TLS/SSL supported. Redis AUTH command for password auth. ACL support in Redis 6+. In-memory data — ensure Redis is not publicly exposed.

⚡ Reliability

Uptime/SLA
88
Version Stability
85
Breaking Changes
78
Error Recovery
88
AF Security 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

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Library — no external auth. Redis credentials (password, username) in redis.Options. TLS support for Redis TLS connections.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

BSD-licensed open source maintained by Redis Ltd (formerly Redislabs).

Agent Metadata

Pagination
cursor
Idempotent
Partial
Retry Guidance
Not documented

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.

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered