Skip to main content
Hyperterse supports Redis as a connector for key-value operations, caching lookups, session retrieval, rate limit checks, and working with Redis data structures (hashes, lists, sets, sorted sets). Statements are standard Redis commands executed directly against the server.
Hyperterse connects to your existing Redis instance. It does not create or manage databases — you provide a running Redis server (self-hosted, AWS ElastiCache, Upstash, etc.) and a connection string.

Adapter configuration

Create an adapter file in app/adapters/:
app/adapters/cache.terse
connector: redis
connection_string: '{{ env.REDIS_URL }}'
options:
  pool_size: '10'
The connection string uses the standard Redis URI format:
redis://user:password@host:port/db_number

Connection options

pool_size
string
Maximum number of connections in the pool.
For password-protected instances, include the password in the URI:
connection_string: 'redis://:password@localhost:6379/0'
For TLS-enabled cloud providers, use the rediss:// scheme:
connection_string: 'rediss://:password@host:6379/0'

Verify the connection

Start the server and confirm the adapter connects:
hyperterse start
A successful connection produces:
INFO  Connected to adapter: cache
If the connection fails, the server exits immediately with a diagnostic message.

Usage

Redis tool statements contain the Redis command to execute. Use {{ inputs.field }} placeholders for dynamic values.
app/tools/get-cached-value/config.terse
description: 'Retrieve a cached value by key'
use: cache
statement: 'GET {{ inputs.key }}'
inputs:
  key:
    type: string
    description: 'Cache key'
auth:
  plugin: allow_all
Redis commands return results in JSON format. Multiple values are returned as arrays; hash operations return key-value pairs.

Common command patterns

# GET
statement: "GET {{ inputs.key }}"

# SET with expiry
statement: "SET {{ inputs.key }} {{ inputs.value }} EX {{ inputs.ttl }}"

Separate adapters for different concerns

Use separate Redis adapters for distinct purposes:
app
adapters
session-store.terse
rate-limiter.terse
feature-flags.terse
Each adapter can connect to a different Redis database number or a different Redis instance entirely. Tools reference the appropriate adapter by name.

Troubleshooting

Connection refused

Verify Redis is running:
redis-cli ping
A PONG response confirms the server is accessible. Check firewall rules for remote instances.

Authentication failed

Ensure the password is correct in the connection string:
redis://:correct_password@localhost:6379/0
Verify that Redis has authentication enabled in its configuration (requirepass directive).

TLS required

Cloud-hosted Redis instances typically require TLS. Switch from redis:// to rediss://:
rediss://:password@host:6379/0

Memory issues

Monitor Redis memory usage with INFO memory. Configure maxmemory and an eviction policy (maxmemory-policy) on the Redis server to prevent out-of-memory conditions.