peepshow/ sinks/ redis-vector

Reel #81 In-memory search

peepshow sink / redis-vector

Redis VectorHash + RediSearch index — every run becomes a Redis 8 hash.

Spawns the `redis-cli` binary to issue `FT.CREATE` (idempotent) + `HSET`. Soft-fails when the RediSearch module isn't loaded; still writes the hash.

drop · process · redis-vector

What it does

[Redis](https://redis.io) 8 ships [RediSearch](https://redis.io/docs/latest/develop/interact/search-and-query/) as a first-class module — full-text + vector search over hashes. This sink writes one hash per peepshow run (`<index>:<runId>`) and issues `FT.CREATE … IF NOT EXISTS` on first run so a paired full-text/vector index is materialised lazily. It shells out to the system `redis-cli` (no Node client dependency, zero install for users who already run Redis) and passes the password via stdin's `AUTH` command so secrets never appear in `ps aux`. When the FT module isn't loaded the hash still gets written; the sink logs the skip and exits 0.

When to reach for it

  • Microsecond-latency keyword + vector search over peepshow runs, served from a Redis you already operate
  • Pair with Redis Streams / Pub/Sub fan-out — same datastore, same operational footprint
  • Embed peepshow into an existing Redis-backed agent memory layer without standing up a second search service

Install

npm i -g peepshow
# Redis 8+ with RediSearch module (preferred) or redis-stack
brew install redis  # or: https://redis.io/docs/latest/operate/oss_and_stack/install/

Use it

REDIS_URL="redis://127.0.0.1:6379" \
peepshow ./demo.mp4 --sink redis-vector

Make it automatic

Register the sink once — every run fires it afterward. Scope by --when so it only runs for matching videos.

peepshow sinks add redis-vector
peepshow sinks add redis-vector --when extension=mp4,mov
peepshow sinks add redis-vector --when path=/Volumes/Work/

Configuration

  • REDIS_URL Redis connection URL. Default `redis://127.0.0.1:6379`.
  • REDIS_INDEX FT index name + hash prefix. Default `peepshow:runs`.
  • REDIS_PASSWORD Password sent via the `AUTH` command on stdin (kept out of argv).
  • REDIS_BIN Override the `redis-cli` executable path. Default `redis-cli` (must be on PATH).
  • PEEPSHOW_FRAME_BASE_URL When set, the first frame URL is written to the `thumbnail_url` hash field.

Use with an LLM agent

Every peepshow sink reads its config from env vars and receives a single JSON payload on stdin. An LLM agent (Claude Code, Cursor, Windsurf, Gemini, Codex) can drive the Redis Vector sink automatically when three things are true:

  • the env vars below are exported in the agent's shell (or a project .env it can load),
  • the peepshow CLI is on PATH — install with npm i -g peepshow,
  • a peepshow auto-sink is registered for the run (optional but recommended — makes invocation zero-argument).

1. Set the environment

This sink has no required env vars — it writes to a local path. Pass the destination via --sink-arg:

REDIS_URL="redis://127.0.0.1:6379" \
peepshow ./demo.mp4 --sink redis-vector

2. Register as an auto-sink

peepshow sinks add redis-vector
peepshow sinks add redis-vector --when extension=mp4,mov

3. Example LLM session

You → drop a .mov into Claude Code.

Claude → auto-invokes /peepshow:slides ./clip.mov. peepshow extracts frames + audio, the Redis Vector sink forwards the run to the configured collection. Claude replies with a summary and a link to the created record.

The transcript text is a natural embedding target — index it next to the frames.

Write your own

A sink is any executable that reads the --emit json payload on stdin. Shell, Node, Python, Go — the spec's in docs/PLUGINS.md. Register persistent ones with peepshow sinks add-cmd 'your-command'.