Redis
Binary-safe strings, hashes, lists, sets, sorted sets, streams, SCAN and publish with an optional key prefix, agent tools read-only unless opted in, a node-only command escape hatch with a denylist
Stable v0.1.0 Node.js 31 actions
About
A Graphrt plugin for Redis (and Redis-compatible servers such as Valkey), built on ioredis. It covers strings, hashes, lists, sets, sorted sets, streams, SCAN and publish. Values are binary-safe, an optional key prefix isolates the plugin's keys, and agent tool calls are read-only unless you opt in.
What it can do
- Strings and keys: get, mget, set (EX/PX/NX/XX), del, exists, expire, ttl, incr, incrby.
- Hashes: hget, hset, hgetall, hdel.
- Lists: lpush, rpush, lrange, llen.
- Sets: sadd, smembers, srem.
- Sorted sets: zadd (NX/XX, GT/LT, CH) and zrange (by rank or by score, reverse, with scores), zrem.
- Keyspace: scan (cursor, MATCH, COUNT, TYPE). KEYS is never sent.
- Pub/sub: publish.
- Streams: xadd (MAXLEN ~, NOMKSTREAM), xrange (paged, reverse), xgroup_create, xreadgroup (never blocks) and xack.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Get value
redis.get - Get values
redis.mget - Set value
redis.set - Delete keys
redis.del - Keys exist
redis.exists - Set expiry
redis.expire - Time to live
redis.ttl - Increment
redis.incr - Increment by
redis.incrby - Get hash field
redis.hget
Show all 31 actions
- Set hash fields
redis.hset - Get all hash fields
redis.hgetall - Delete hash fields
redis.hdel - Push to list head
redis.lpush - Push to list tail
redis.rpush - List range
redis.lrange - List length
redis.llen - Add to set
redis.sadd - Set members
redis.smembers - Remove from set
redis.srem - Add to sorted set
redis.zadd - Sorted set range
redis.zrange - Remove from sorted set
redis.zrem - Scan keys
redis.scan - Publish message
redis.publish - Add stream entry
redis.xadd - Read stream range
redis.xrange - Read stream as consumer
redis.xreadgroup - Create consumer group
redis.xgroup_create - Acknowledge stream entries
redis.xack - Run Redis command
redis.command
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
REDIS_URL(required)redis://[user]:password@host:6379/<db>, or rediss:// for TLS. A node's access_token (from a secret, with --trust-plugin redis) overrides it. The password is redacted from every error. -
REDIS_KEY_PREFIX(none)Added in front of every key and pub/sub channel, e.g. shop:, and stripped from keys returned by scan (see Safety) -
REDIS_TOOL_ALLOW_WRITES(off)1 lets agent tool calls run the write operations. Workflow nodes can always write. -
REDIS_MAX_VALUE_BYTES1048576Largest value one write may send, and the most bytes returned per value on reads (max 64 MiB) -
REDIS_MAX_RESULT_BYTES4194304Most bytes one read returns in total (max 8 MiB) -
REDIS_COMMAND_TIMEOUT_MS10000Time limit for each command (100 to 60000) -
REDIS_IDLE_MINUTES5Close the pooled connection after this many idle minutes
How to use it
In Graphrt Desktop
- Open Plugins and search for Redis.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install redis workflow.yaml
- { id: cache, type: redis.set, key: "quote:A-12", value: "{{#price.data.total#}}", ex: 3600 }
- { id: cached, type: redis.get, key: "quote:A-12" }
- { id: profile, type: redis.hset, key: "user:42", fields: { name: Budi, city: Bandung } }
- { id: events, type: redis.xadd, key: orders, fields: { order: A-12, status: paid }, max_length: 10000 }
- { id: work, type: redis.xreadgroup, key: orders, group: workers, consumer: graphrt-1, count: 10 }
- { id: done, type: redis.xack, key: orders, group: workers, ids: ["{{#work.data.entries.0.id#}}"] }
- { id: score, type: redis.command, command: ZSCORE, args: [leaderboard, budi] }