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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Threatpost
GbyAI
GbyAI
V
Visual Studio Blog
H
Help Net Security
Vercel News
Vercel News
P
Palo Alto Networks Blog
Project Zero
Project Zero
AWS News Blog
AWS News Blog
Latest news
Latest news
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
The Register - Security
The Register - Security
博客园_首页
WordPress大学
WordPress大学
G
GRAHAM CLULEY
T
Tor Project blog
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
AI
AI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
O
OpenAI News
博客园 - 聂微东
月光博客
月光博客
S
Security Affairs
Webroot Blog
Webroot Blog
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
NISL@THU
NISL@THU
N
News and Events Feed by Topic
Blog — PlanetScale
Blog — PlanetScale
S
Securelist
V
Vulnerabilities – Threatpost
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
Stack Overflow Blog
Stack Overflow Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Y
Y Combinator Blog
Cisco Talos Blog
Cisco Talos Blog
The Cloudflare Blog
IT之家
IT之家
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss

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? 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 Designing a semantic routing system: From static rules to dynamic intelligence with Redis and Java | 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
What Is a Context Layer? AI Agent Infrastructure
Redis · 2026-05-19 · via Redis

In a demo, your agent only has to hold one conversation with one user, against fresh data, for a few minutes. Production is different. It has to remember users across sessions, reconcile retrieved documents that disagree, filter out irrelevant search results, and resume workflows hours later, all while staying within a finite context window.

A context layer is the subsystem that manages all of that. It decides what the agent knows, when it knows it, and what it should have forgotten across time, sessions, tools, and data sources. This article covers what a context layer is, the agent failure modes it helps reduce, how it differs from retrieval-augmented generation (RAG) and semantic layers, and where Redis Iris fits.

A context layer is the part of your AI stack that decides what an agent knows at any moment. It manages the information an agent needs to reason across time, across sessions, and across the other agents and tools it works with.

The simplest way to picture it: if the large language model (LLM) is the brain, the context layer is the short-term memory, long-term memory, reference library, and filing system that keeps that brain oriented in reality. It covers persistence (storing what happened), compression (summarizing what no longer fits), budgeting (deciding what gets a slot in the prompt), and assembly (composing the final input the model sees).

A regular database answers questions when asked. A context layer is active: it assembles the right inputs for each reasoning step, refreshes them as the agent works, and checks whether they are still valid. That shift from passive storage to active management is what separates a context layer from the databases and caches sitting underneath it.

Five context failures a context layer prevents

Most agents fail in production because of the inputs they're handed: stale data, conflicting documents, irrelevant retrievals, or instructions buried under noise. Five patterns come up again and again, and a context layer is designed to catch each one before it reaches the prompt.

Context poisoning

An error, hallucination, or malicious instruction enters the context window and gets treated as ground truth. Every downstream reasoning step inherits the contamination. Poisoning happens accidentally when a hallucination loops back in, and deliberately through prompt injection attacks. A context layer helps address both through provenance tagging and trust-level metadata on every context fragment.

Context distraction

As context grows, the model can over-weight what is in the window and repeat past actions rather than reasoning forward. Every early mistake stays available to influence later decisions. A context layer reduces this by moving agent outputs into persistent external storage and retrieving selectively, rather than accumulating everything in-band.

Context confusion

The more irrelevant context you load, the more the model misroutes: wrong tool calls, wrong documents retrieved, wrong paths taken. It gets worse with multiple agents in flight, where each one has to pull its own signal out of shared instructions. A context layer filters for relevance before injection, so only fragments that match the current subtask reach the active window.

Redis Iris

Build fast, accurate AI apps that scale

Get started with Redis for real-time AI context and retrieval.

Context clash

The longer a session runs, the more the context starts contradicting itself: a newer fact overwrites an older one, or two retrieved documents tell different stories. Instead of flagging the conflict, the model usually picks a side and answers confidently. A context layer ranks by recency and confidence so contradictory fragments don't land in the prompt with equal weight.

Context rot

As the context window fills across a long session, the model's ability to recall information from earlier in the context can degrade. Bigger windows do not solve that on their own. The countermeasures are active summarization, pruning, and externalized memory artifacts.

Context layer vs. RAG vs. semantic layer: key differences

RAG and semantic layers often get treated as alternatives to a context layer. They aren't. They solve different problems at different points in the stack, and most production agent systems end up using all three.

Retrieval-augmented generation (RAG)

RAG is a retrieval pattern. The pipeline is straightforward: embed a query, fetch semantically similar documents, inject them into the prompt, and let the model generate a grounded response. That works well when a human writes the prompt and reads the answer, but agents break the assumption. They run multi-step workflows, spawn parallel sub-agents, and need to carry information across turns, while RAG only retrieves documents for a single call. It doesn't persist state across tasks, isolate context between agents, or decide what to forget, and those jobs sit above retrieval.

Semantic layer

A semantic layer sits between raw data sources and the things that query them. Rather than storing the data itself, it stores definitions: what "revenue" means, how "active user" is calculated, which tables join to which. By giving the LLM a curated vocabulary to work from, it reduces the risk of incorrect joins or aggregations in generated SQL. The question it answers is a definitional one: "What does this metric mean and how is it computed?"

Context layer

A context layer answers different questions. Not "what does revenue mean?" but "what does the agent need to know right now, is it still valid, and what should it forget?" Those decisions get made at runtime, on every step, as the workflow moves forward.

A context layer doesn't replace RAG or a semantic layer. It sits above them, using retrieval (often RAG) to pull relevant fragments and definitions (often from a semantic layer) to interpret them, then handling everything RAG and semantic layers don't: memory, session state, conflict resolution, token budget, and freshness.

DimensionRAGSemantic layerContext layer
TypeTechnique / pipelineAbstraction / metadata layerArchitectural system
Main data focusUnstructured textStructured metrics and dimensionsBoth, plus governance and temporal state
GovernanceNonePartial (metric definitions, access controls)Extended (lineage metadata, conflict arbitration logic)
Agent suitabilitySingle-turn or simple multi-turnStrong for structured analyticsDesigned for long-horizon agentic tasks

The practical takeaway: these layers stack. RAG handles retrieval, a semantic layer handles definitions, and a context layer orchestrates both alongside memory and state so the agent has the right inputs on every step.

The building blocks of a real-time context layer

A production context layer combines a few moving parts: retrieval, memory, caching, operational data access, and session coordination. Redis Iris brings them into a single runtime sitting between an agent and the data it needs, feeding the right context, in the right form, at the right time.

Vector search & retrieval

Vector search is the retrieval backbone for RAG pipelines and long-term memory lookups, surfacing semantically relevant context instead of relying on exact matches. In Iris, this work runs on Redis Search, the fast layer underneath the context engine that retrieves vector, structured, unstructured, and real-time data. It supports hybrid search that combines full-text or keyword retrieval with vector search, plus filtered vector search that applies metadata constraints to results, and it's what powers both LangCache and Agent Memory underneath.

Agent memory

Short-term memory covers the current conversation and active task, while long-term memory holds user preferences, learned patterns, and past session summaries.

Iris handles this through Redis Agent Memory, which implements a two-tier model: session memory with configurable TTL-based expiration, and long-term memory stored as text with vector embeddings for semantic retrieval. When conversation events land in session memory, Agent Memory asynchronously extracts important information and promotes it to long-term storage, non-blocking on the agent's hot path.

Semantic caching

Semantic caching intercepts semantically similar queries before they reach the LLM. Instead of exact-match caching, it compares query embeddings against a cache index, so paraphrased questions that mean the same thing can serve cached responses rather than triggering duplicate inference calls. This is Redis LangCache's job inside Iris: before each request hits the model, LangCache checks if a semantically similar response already exists. Redis reported up to 15x faster cache hits in benchmarks and up to 73% lower LLM inference costs without code changes.

LLM memory 64px

Give your AI apps real-time context

Run them on Redis for AI, built for fast retrieval and low-latency responses.

Operational data access

Agents need live access to operational data: customer records, transactions, orders, inventory. That data lives in systems of record like Postgres, MySQL, Oracle, SQL Server, and MariaDB, and naïve approaches like text-to-SQL or hand-built tool integrations tend to be brittle, slow, and hard to secure.

Iris splits this job in two. Redis Context Retriever takes a schema-first approach: you define a semantic model of business entities, fields, keys, and relationships using pydantic models, and Redis auto-generates MCP tools the agent can call instead of querying source databases directly, with row-level access controls enforced server-side. Redis Data Integration sits behind that, syncing data from relational databases, warehouses, and document stores into Redis through change data capture so the entities the retriever serves stay fresh in near real time.

Feature serving

Feature serving delivers pre-computed ML features (like user tier, transaction history, and fraud scores) with low-latency access on every agent step. Keeping online serving data aligned with offline training data matters because drift between the two can create training-serving skew. Redis Feature Form handles this work.

Session state & pub/sub coordination

Session state maintains execution continuity across multiple LLM calls, tool invocations, and human-in-the-loop pauses: current workflow position, pending tool calls, intermediate results, and checkpoints for crash recovery. When a workflow pauses for human review, saved checkpoint state lets the framework resume from exactly where it left off. Pub/sub provides the real-time communication layer between agents, external systems, and human supervisors, the channel multi-agent systems use to exchange events, signal task completion, and notify supervisors of escalations without polling.

Both run on Redis core primitives (data structures, pub/sub, and streams) underneath Iris, available to any agent framework already running on Redis.

Several of these components sit on the hot path. Session state reads, short-term memory lookups, semantic cache checks, and feature serving have tight latency targets because they're queried on every agent step and LLM call. That's the case for keeping the context layer in memory, and it's why Iris extends the Redis infrastructure many teams already run rather than asking them to bolt on another set of vendors.

Redis Iris

Redis Iris serves agent context in milliseconds

Redis Iris connects memory, live data, and retrieval in one place.

The context layer is the agent's operating system

Better agents usually need better context infrastructure. Many teams moving agents from prototype to production discover that the model works fine; it's the context around it that breaks.

A context layer is the infrastructure response to that pattern. It manages what the agent knows, keeps it current, and helps reduce the failure modes that turn promising demos into unreliable production systems. Redis is built on an in-memory, real-time architecture that fits the hot-path requirements of session state, memory lookups, and semantic caching, and Redis Iris brings those capabilities together as a managed context engine for enterprise AI agents. Try Redis free or book a meeting to discuss your architecture.