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

推荐订阅源

T
Threatpost
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
U
Unit 42
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
L
LINUX DO - 最新话题
博客园_首页
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
C
Cisco Blogs
博客园 - 【当耐特】
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
罗磊的独立博客
MyScale Blog
MyScale Blog
Last Week in AI
Last Week in AI
A
About on SuperTechFans
G
GRAHAM CLULEY
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
D
DataBreaches.Net
The Hacker News
The Hacker News
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
I
InfoQ
T
The Exploit Database - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 叶小钗
Project Zero
Project Zero

Redis

Real-Time Fraud Detection: Latency, Features & Scale Context window in AI: why every token is a budget decision Connecting to Redis Cloud with AWS PrivateLink vs. VPC peering | Redis Redis Data Integration in Redis Cloud is now GA in AWS | Redis Why AI Misses Business Context & How Teams Fix It AI Reasoning Explained: Why Context Matters Semantic Layer vs Context Layer: Key Differences Redis array data type: How it works and when to use it Context Graphs vs. Vector Search: When RAG Falls Short What’s new in two – May 2026 edition Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more Redis 8.8: New array data structure & open source features How Conflict-free Replicated Data Types power active-active database replication Context Orchestration: What It Is & How It Works Context Compaction for AI Agents: A Complete Guide Prompt Bloat: Causes, Costs & Fixes for LLM Apps Agentic Retrieval Techniques: A Complete Guide Single-shot reliable consumers with XREADGROUP CLAIM in Redis 8.4 | Redis Long-Horizon AI Agents: Memory & State Infrastructure What is a context engine? What Is a Context Layer? AI Agent Infrastructure Context Retrieval for AI Agents: What It Is & Why It Matters Context Poisoning: How Bad Data Breaks Agent Reasoning Context is all you need: Introducing Redis Iris | Redis Context Engineering for AI: What It Is & How to Build It Dynamic endpoints: Migrate databases without changing your endpoint | Redis AI Shopping Assistants: How They Work & What to Build Endless Aisle Retail: Infrastructure & Real-Time Data LLM Speed Benchmarks: Metrics & Infrastructure Guide Context Pruning: Cut LLM Tokens Without Losing Quality What’s new in two – April 2026 edition Agentic AI Architecture: 5 Patterns Explained AI Agent vs Chatbot: Key Differences Explained Advantages of Building a Vector Search Solution API Latency in LLM Apps: Causes & How to Fix It Security advisory: [CVE‑2026‑23479] [CVE‑2026‑25243] [CVE-2026-25588] [CVE‑2026‑25589] [CVE-2026-23631] | Redis Edge Computing Latency: Causes & How to Reduce It AI Agents vs Workflows: When to Use Each Streaming LLM Responses: Make Your AI App Feel Fast Active-Active vs Active-Passive Database Architecture Prefill vs Decode: LLM Inference Phases Explained Long-Term Memory Architectures for AI Agents Time to First Byte Test: Tools, Causes & Fixes Speculative decoding: how it works & when to use it P95 Latency: What It Is & Why It Matters Why Multi-Agent LLM Systems Fail & How to Fix Them AI Human in the Loop: Production Oversight Patterns Native OpenTelemetry metrics for Redis client libraries | Redis Client-side geographic failover for Redis Active-Active | Redis Use Redis with SQL | Redis Introducing Redis Feature Form Build Google ADK Agents with persistent, real-time memory on Redis | Redis Startup Spotlight: Neuron Systems API Throttling: Algorithms, Patterns & Mistakes Agentic AI Examples Across 6 Industries Best Chunking Strategies for RAG Pipelines Agentic AI Guardrails: Controls That Work Redis joins AWS at GDC to support the next generation of gaming | Redis Real-Time Dispatch System: A Complete Guide P99 Latency: What It Means & How to Fix It Tokenization in LLMs: What AI App Devs Need to Know TTFT Meaning: What is Time to First Token? Atomic slot migration with Redis 8.4 Hybrid search benefits: Why your RAG system needs both keyword & vector search What’s new in two: March 2026 edition Vector embedding generators: How they work & how to use them Throughput-optimizing Redis for L2 KV Cache Reuse What is a data pipeline? Building AI agent pipelines that don't forget, fail, or fall apart Redis achieves Google Cloud Ready, Distributed Cloud status ahead of Google Cloud Next ‘26 | Redis Real-time network monitoring: what your data platform needs to keep up AI agent API: How agents connect to the real world What is multicloud infrastructure? A guide for 2026 What is a transaction monitoring system & how does it work? Why your AI agent fails in production & how tracing helps AI agent benchmarks: Where they fall short & why your infrastructure matters What is a JSON database (and when should you use one)? Introducing the Redis Partner Network: A new foundation for real-time innovation How real-time customer segmentation works in retail Payment orchestration & vault architecture in retail Agentic systems vs. GenAI: when generation isn't enough What is fuzzy matching? Semantic caching & routing: two powerful patterns for vector classification Redis alternatives: Why there are no exact substitutes Connect to Azure Managed Redis with Redis Insight 3.2.0 How to tame the thundering herd problem Redis to Manage Storage Replication | Redis How hierarchical navigable small world (HNSW) algorithms can improve search | Redis How leading financial institutions use Redis to drive growth | Redis What’s new in two: May 2025 | Redis Introducing Model Context Protocol (MCP) for Redis | Redis Redis vs. Elasticsearch: What’s faster for GenAI & vector search? | Redis Build fast, production-worthy AI apps with Spring AI and Redis | Redis Azure Managed Redis is GA today | Redis Redis then & now: Adapting with developers through every era | Redis Supercharge Your AI with OpenShift AI and Redis: Unleash speed and scalability | Redis What’s new in two: April 2025 | Redis Redis 8 is now GA, loaded with new features and more than 30 performance improvements | Redis What is a data strategy? 6 key components explained Data replication explained: types, examples & use cases
Designing a semantic routing system: From static rules to dynamic intelligence with Redis and Java | Redis
Redis · 2026-04-03 · via Redis

A semantic routing pattern is a powerful technique used in intelligent systems to classify incoming requests based on their meaning and direct them to the most appropriate processing path. Unlike traditional rule-based approaches that rely on keywords or binary logic, semantic routing leverages embeddings and similarity matching to understand user intent. By comparing an input against predefined categories—such as FAQ, restricted topics, or complex queries—the system can efficiently determine how to handle each request. This enables use cases like routing simple questions to low-cost pipelines, blocking sensitive topics, or escalating complex queries to advanced models, all within milliseconds.

In a production environment, flexibility is critical. Rather than hardcoding routing rules, modern systems allow configurations to be defined and updated dynamically. In this approach, routing definitions are stored in Redis as a centralized source of truth. The application loads these configurations at runtime to build the router, while also exposing services that enable users to update or extend routing rules without requiring redeployment. This design ensures scalability, maintainability, and real-time adaptability.

To support semantic routing, this sample leverages RedisVL for Java, a library that simplifies working with vector embeddings and similarity search in Redis. RedisVL provides high-level abstractions for vector indexing, embedding storage, and similarity-based retrieval. In this setup, the stored example queries act as reference data that can be vectorized and used by the semantic router to match incoming user inputs based on meaning rather than exact keywords.

Find the source code here: https://github.com/Redislabs-Solution-Architects/semantic-router-with-redis

1. Define default routing config in Java and store in Redis

The first step is to establish a default routing configuration directly in the application code. This configuration maps each category—such as sports, technology, or business—to a set of representative example queries that define its semantic intent. When the loaddefaultRouterConfig() method is executed, it begins by clearing any existing routing data in Redis to prevent inconsistencies or stale entries. It then iterates through each category and stores the associated queries in Redis using a structured key format (e.g., router:sports). Each query is saved as a field in a Redis hash. By persisting this data in Redis, the system externalizes its routing knowledge, making it reusable, shareable, and independent of application memory.

Code snippet is as follows.

2. Build a service to update router settings dynamically

To support runtime flexibility, a service layer is introduced to allow users or external systems to modify routing configurations dynamically. The updateRouter() method serves this purpose by accepting a new set of categories and example queries. For each category, it replaces the existing Redis entry by deleting the old key and inserting the updated values. This ensures that updates are applied cleanly and consistently at the category level. In a real-world app, this functionality would typically be exposed via a REST API, letting users add new categories, refine example queries, or adjust routing behavior without redeploying the system. This approach transforms routing from a static configuration into a dynamic, user-driven capability.

Code snippet is as follows.

3. Build the semantic router dynamically from Redis

Once routing data is stored in Redis, the system can dynamically construct the semantic router at runtime. The build() method scans all Redis keys that match the routing pattern, retrieves their associated queries, and transforms each category into a Route object. Each route includes a name, a set of reference examples for semantic comparison, metadata such as category and priority, and a distance threshold that controls matching sensitivity. These routes are then aggregated into a router configuration, which defines how many matches to consider and how similarity scores are calculated. Finally, the SemanticRouter is instantiated using this configuration along with a vectorizer for embedding generation. Because the router is built entirely from Redis data, any updates made through the service layer are automatically reflected, resulting in a fully dynamic and data-driven routing system.

Code snippet is as follows.

Workflow

  1. Initialize → Load default categories and store them in Redis
  2. Update → Users modify routing rules via a service → Redis is updated
  3. Runtime → The router reads from Redis, builds routes, and processes queries

Frontend view to use the service

The frontend might appear as shown below.

1. The Semantic routing configuration is visible to the user.

Semantic routing settings

2. The user has the ability to submit queries for verification of the routing outcome.

Router for questions

3. User can submit new question list and assign a category like “health”

Submit question list

4. Load the router for questions can get the updated routing settings

Load the router for questions can get the updated routing settings

5. The user can then inquire about "Health" to retrieve results for a new question category.

The user can then inquire about "Health" to retrieve results for a new question category.

Flexible and scalable system architecture

This architecture cleanly separates routing data from routing logic, enabling a flexible and scalable system. By leveraging Redis as a dynamic configuration store and semantic similarity for intelligent classification, you create a routing mechanism that is both efficient and adaptable. As a result, your system can evolve over time—supporting new categories, refining intent recognition, and improving user experience—without requiring code changes or redeployments.