Back to browse
Valkey-native semantic cache with OTel and Prometheus built in

Valkey-native semantic cache with OTel and Prometheus built in

by kaliades·Mar 22, 2026·4 points·1 comment

AI Analysis

●●SolidNiche GemSolve My Problem

First semantic cache handling Valkey Search 1.2 divergences without silent breaks.

Strengths
  • Handles Valkey Search 1.2 API differences where Redis libraries fail silently.
  • Emits OpenTelemetry spans and Prometheus counters on every cache operation automatically.
  • Standalone design works with any LLM client, no LangChain coupling required.
Weaknesses
  • Valkey adoption is low compared to Redis, limiting immediate audience size.
  • Requires iovalkey peer dependency and specific Valkey 8.0+ modules loaded.
Target Audience

Backend engineers using Valkey for LLM caching

Similar To

RedisVL · LangChain · LiteLLM

Post Description

Every semantic cache library - RedisVL, LangChain, LiteLLM - targets Redis and assumes RediSearch wire compatibility. Point any of them at Valkey Search 1.2 and they break silently in multiple places. There's no library that actually handles Valkey natively. This does.

@betterdb/semantic-cache is a standalone semantic cache backed by valkey-search. No framework coupling - works with any LLM client. Every check() and store() emits an OTel span and increments Prometheus counters and histograms out of the box. No instrumentation code required. MIT. Optional LangChain and Vercel AI SDK adapters. Works on self-hosted Valkey, ElastiCache for Valkey, and Memorystore for Valkey.

https://www.npmjs.com/package/@betterdb/semantic-cache

The Valkey Search 1.2 divergences from RediSearch that required explicit handling are in the changelog.

Similar Projects