惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
A
Arctic Wolf
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
A
About on SuperTechFans
P
Palo Alto Networks Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
博客园_首页
大猫的无限游戏
大猫的无限游戏
Cisco Talos Blog
Cisco Talos Blog
P
Proofpoint News Feed
D
DataBreaches.Net
Cyberwarzone
Cyberwarzone
T
Tor Project blog
IT之家
IT之家
P
Proofpoint News Feed
Help Net Security
Help Net Security
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
Microsoft Azure Blog
Microsoft Azure Blog
V2EX - 技术
V2EX - 技术
K
Kaspersky official blog
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
B
Blog
N
News and Events Feed by Topic
The Cloudflare Blog
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
T
The Blog of Author Tim Ferriss
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
The Last Watchdog
The Last Watchdog
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LangChain Blog
I
InfoQ
F
Full Disclosure
The Register - Security
The Register - Security
阮一峰的网络日志
阮一峰的网络日志
H
Hacker News: Front Page
V
V2EX

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I benchmarked my own semantic cache against RedisVL and Upstash for a week. Here is what actually held up
Kristian Ivanov · 2026-06-01 · via DEV Community

Most semantic cache benchmarks are a vendor showing you the one dataset where they win, on a model they finetuned, against a competitor they configured badly. You read it, you nod, you learn nothing.

I built and maintain a semantic cache library (@betterdb/semantic-cache on npm, betterdb-semantic-cache on PyPI, MIT, Valkey-native). So I had two choices. Write that post about my own library, or run the comparison straight and publish it even where I only tie. I did the second one. Four public datasets, two peers (RedisVL and Upstash), one self-tuning loop, and a fair amount of being wrong before being right.

There was no honest cross-library comparison of semantic caches anywhere I could find. So I made one. This is the short version. Links to the full tables and methodology are at the bottom.

1. Quality is a tie. That is the result you want.

Fix the embedding model and every honest semantic cache is doing the same thing: embed the prompt, measure cosine distance against stored prompts, return a hit below a threshold. So peak F1 converges. There is no secret sauce in the lookup.

I landed within roughly one percentage point of F1 against both RedisVL and Upstash, at each library's own optimal threshold, across STSb, SICK, PAWS-Wiki, and a real chatbot-prompt dataset from the vCache paper (ICLR 2026). The largest gap against RedisVL anywhere was 0.004 F1. That is noise.

This is the part vendor benchmarks bury, so let me say it plainly. Cache quality is bounded by the embedding model, not the library. Parity is the ceiling. Reaching it is the price of admission, not the win. Anyone showing you a big F1 lead on a fixed model is either using a model they tuned or a competitor they broke.

So if the lookup is solved, the cache you pick comes down to everything around the lookup. That is the rest of this post.

2. The threshold you copied is probably wrong. (Yes, yours.)

This was the finding that surprised me most, and I only saw it because I ran against two different engines.

Against RedisVL, same engine and same runtime, the similarity distributions were identical and so were the optimal thresholds. Boring. Expected.

Against Upstash they were not. Both adapters used bge-small-en-v1.5 by name. Same weights. But my local ONNX runtime and Upstash's server-side runtime produced different score distributions. Mine spread across [0, 0.50]. Theirs compressed into [0, 0.26]. The optimal threshold followed: 0.20 for me, 0.10 for them.

Read that again. Same model name, different runtime, different correct threshold. Neither is wrong. Each is right for its own runtime.

So a similarity threshold is not a constant you look up. It is a property of your embedding runtime, your data, and your traffic. Copy the number from a blog post (this one included) or a vendor default, and you are very likely running at the wrong cutoff. That is the entire argument for tuning the threshold to your own deployment instead of guessing it.

3. Self-tuning earns its keep. The tuning was the easy part.

So I built a loop that does the tuning for you. The cache logs similarity scores to Valkey, the Monitor reads the distribution and proposes a threshold change with reasoning, a human approves (or doesn't, your call), and the running cache picks up the new value within a second. No restart, no redeploy.

On datasets where the starting threshold was bad, it gained real F1. Up to +2.8% on STSb by loosening. +2.1% on SICK. +2.9% on the chatbot set by tightening. Same code path, no per-dataset config, adapting in both directions.

Here is the honest part. The naive version of this loop destroys performance, and I know because I shipped it first. My first attempt tightened the threshold five times in a row chasing a signal that was actually noise, and dropped F1 from 0.57 to 0.49. It saw "distant hits," said "tighten," and kept saying it because the signal never went away.

The engineering that matters is not the tuning. It is the four safety mechanisms that stop the loop from tuning itself off a cliff:

  • Signal-quality guards so it does not act on noise dressed up as signal.
  • Outcome tracking so if the last adjustment did not help, it stops instead of doubling down.
  • Velocity dampening so consecutive same-direction steps shrink and eventually stop.
  • A recall-cost check so a tighten that would drop too many real hits gets blocked outright.

With those in place, the loop either improves on a static threshold or matches it exactly. It never makes things worse. "Do no harm" turned out to be the hardest requirement in the whole thing, and it is the one nobody writes a blog post about.

4. Latency is mostly a deployment story, not an algorithm story.

Two latency numbers, and they mean different things, so I am going to keep them separate instead of mashing them into one big scary multiple.

Against RedisVL, on the same engine: about 7x faster on repeated queries (around 0.57ms vs 3.46ms p50). This is real and it is a library difference. I cache prompt embeddings keyed by hash; RedisVL recomputes the embedding on every call, even if you sent the same prompt three seconds ago. Any workload with prompt repetition (chatbots, agent retry loops, FAQ-shaped traffic) gets this for free.

Against Upstash: 48 to 136x. That number looks incredible and it is also not a fair fight. It is local Valkey against a cloud REST API. I am racing a process on localhost against a network round trip to another region. That is a deployment difference, not an algorithmic one, and I am not going to pretend otherwise.

The useful version of the claim: run the cache next to your app on Valkey you operate, and you get sub-millisecond lookups that a managed cloud vector API structurally cannot match, because the network hop is not something the vendor can optimize away. If zero ops footprint matters more to you than latency, the managed round trip is a perfectly reasonable trade. Just know which one you are buying.

5. Adversarial paraphrases are a wall for everyone.

On PAWS-Wiki, every adapter I tested plateaus around 61% F1. Mine, RedisVL's, Upstash's. All of them.

"Flights from NY to FL" and "flights from FL to NY" have nearly identical embeddings. No threshold separates them. No amount of tuning recovers signal the embedding never captured. I even threw an LLM judge at it; at default settings the uncertainty band only catches a handful of pairs, so it does not move aggregate F1.

This is not a BetterDB limit or a competitor limit. It is a property of cosine-distance caching. If your workload looks like PAWS, you need a different architecture (cross-encoder rerank, structural parsing, domain-specific embeddings), not a better cache. I would rather tell you that than hide it behind friendly datasets.

What the week actually argues

One point, told five ways: once everyone is at the quality ceiling, the cache you pick should be decided by what it does around the lookup, not by a fractional F1 delta.

For what it is worth, here is where I built deliberately, since the lookup was never going to be the differentiator:

  • OpenTelemetry spans and Prometheus metrics emitted from the library, no wiring.
  • Dollars-saved per cache hit, computed from a bundled price table (1,900+ models via LiteLLM), not a marketing counter.
  • The self-tuning loop above, free, through the Monitor.
  • MIT, runs on Valkey or any RESP-compatible endpoint, seven framework adapters, five embedding providers, no backend or vendor lock-in.

One honest caveat: the semantic cache needs valkey-search (Valkey 8+), so on stock ElastiCache or MemoryDB you would reach for the exact-match cache instead.

Reproduce it

Every number is reproducible. The harness, dataset loaders, and raw output are open source (Python, TypeScript). If I got something wrong, the issues tab is open.

The three deep-dives, with the full per-dataset tables:

The library is MIT: @betterdb/semantic-cache (npm), betterdb-semantic-cache (PyPI).

What benchmarks do you actually trust, and which ones do you assume are rigged until proven otherwise? Curious where other people draw that line.