Qdrant, Redis, and Kubernetes can form a useful retrieval-backed LLM application, but they do not by themselves implement Cache-Augmented Generation (CAG) as defined in the research paper. In that approach, a manageable knowledge set is loaded into a model's context and its runtime key-value (KV) state is reused. A Qdrant search combined with a Redis cache is instead a retrieval-augmented pipeline with a cache in front of retrieval.
That distinction helps you choose the simpler design that fits your data. Use full-context CAG when the knowledge set is small, stable, and fits the model's context limits. Use Qdrant-backed retrieval when the corpus is larger or changes often. Add Redis when repeated, authorized requests make caching worthwhile. Kubernetes can run the application and its dependencies, but it does not make a cache highly available or scale a Redis data set safely by adding identical pods.

CAG, RAG, and retrieval caching are different choices
The CAG paper and its reference project describe preloading relevant knowledge into a long-context model and reusing the model's KV cache. This can avoid a separate retrieval step when the knowledge set is limited and can be refreshed as a unit. It still has context-window, prompt-size, model-support, and knowledge-refresh constraints.
Retrieval-augmented generation (RAG) searches an external knowledge base for each request, then gives selected passages to the model. A vector database such as Qdrant can retrieve relevant chunks from a larger or frequently updated collection. See this overview of vector databases for the basic data model.
Redis adds a separate, optional cache-aside layer: check for a valid cached retrieval result, query Qdrant on a miss, and cache the result for a bounded time. This can avoid repeat embedding and vector-search work for the same request scope. Redis does not store the model's KV state in this design, and a cached context is not automatically safe to reuse for a different user, permission set, corpus revision, or prompt.

| Need | Starting point | Main trade-off |
|---|---|---|
| A small, mostly static knowledge set that fits a model's context | CAG with supported long-context and prefix/KV-cache behavior | Rebuild or refresh the prepared context when its source changes; check model context and caching limits |
| A large or frequently changing knowledge set | RAG with Qdrant or another retrieval system | Retrieval, embedding, indexing, and authorization must be operated and evaluated |
| Repeated requests for the same scoped information | Add a Redis cache-aside layer to the retrieval path | Cache invalidation, memory use, and access isolation add complexity |
Do not assume CAG is faster or more accurate for every application. Compare representative questions, answer quality, end-to-end latency, token use, refresh frequency, and operating cost with your actual model and corpus before choosing.
A Qdrant retrieval path with a Redis cache
Start with an authoritative document store or ingestion process, then chunk and embed documents into Qdrant. Store the text and the metadata needed for filtering, such as tenant, document ID, and revision, in each point's payload. The application should authenticate the caller and apply the corresponding access filter on every cache miss.
The following example caches exact-query retrieval results. It uses the current Qdrant client's query_points search API and Redis key expiration. It is an application-layer example, not a complete deployment: configure clients, collections, vector dimensions, payload indexes, timeouts, credentials, and an embedding function for your environment.
import hashlib
import json
from collections.abc import Callable
from qdrant_client import QdrantClient, models
from redis import Redis
def cache_key(
*,
tenant_id: str,
access_scope: str,
query: str,
collection: str,
corpus_revision: str,
embedding_model: str,
) -> str:
normalized_query = " ".join(query.casefold().split())
identity = json.dumps(
[
tenant_id,
access_scope,
collection,
corpus_revision,
embedding_model,
normalized_query,
],
ensure_ascii=False,
separators=(",", ":"),
).encode("utf-8")
digest = hashlib.sha256(identity).hexdigest()
return f"retrieval:v1:{digest}"
def get_context(
*,
query: str,
tenant_id: str,
access_scope: str,
collection: str,
corpus_revision: str,
embedding_model: str,
cache_ttl_seconds: int,
embed_query: Callable[[str], list[float]],
redis_client: Redis,
qdrant_client: QdrantClient,
) -> list[dict[str, str]]:
key = cache_key(
tenant_id=tenant_id,
access_scope=access_scope,
query=query,
collection=collection,
corpus_revision=corpus_revision,
embedding_model=embedding_model,
)
cached = redis_client.get(key)
if cached is not None:
return json.loads(cached)
points = qdrant_client.query_points(
collection_name=collection,
query=embed_query(query),
query_filter=models.Filter(
must=[
models.FieldCondition(
key="tenant_id",
match=models.MatchValue(value=tenant_id),
)
]
),
limit=5,
with_payload=["text", "document_id"],
).points
chunks = []
for point in points:
payload = point.payload or {}
text = payload.get("text")
document_id = payload.get("document_id")
if isinstance(text, str) and text:
chunks.append(
{
"text": text,
"document_id": str(document_id or ""),
}
)
if chunks:
redis_client.set(
key,
json.dumps(chunks, separators=(",", ":")),
ex=cache_ttl_seconds,
)
return chunks
The example uses a stable SHA-256 digest instead of Python's process-dependent hash(). The key scopes cached data to the tenant, authorization scope, collection, corpus revision, embedding model, and normalized query. Derive access_scope from trusted server-side authorization data; do not accept it as a permission claim from the request. If users inside a tenant have different document permissions, apply those filters in Qdrant and use an authorization scope that distinguishes them.
Increment or replace corpus_revision after an ingestion, deletion, or permission change that can affect results. A short TTL provides another bound on stale data; select it based on how quickly changes must take effect. The example deliberately caches only non-empty results. If you cache empty results, use an appropriately short expiration. For approximate semantic caching across different queries, define and validate a similarity threshold and permission boundary rather than treating it as an exact cache hit.
Use Redis expiration as an ordinary SET option (EX) or through the client library, as in the example. Prefer namespaced keys and an explicit TTL over two logical Redis databases and scheduled FLUSHDB calls. Logical databases do not provide separate memory, failure, or security boundaries, and SELECT is not available with Redis Cluster. If two caches truly need different eviction, access, or durability policies, separate them deliberately and account for the added resources and operations.
The cached value here is retrieved context, not a completed LLM answer. Your application still needs to build the prompt, call the model, handle citations, and validate the result. Protect Redis and Qdrant with private networking, authentication, narrowly scoped credentials, and encryption in transit where supported. Do not put secrets or sensitive prompts into cache keys or logs.
Run the components responsibly on Kubernetes
For a small application, first consider a managed Redis service and managed Qdrant deployment. This avoids operating stateful storage inside your cluster, though you still need to evaluate network latency, availability, backups, quotas, and provider cost. The original article's Redis-on-Kubernetes overview remains a useful secondary introduction; consult the current Redis documentation for product and version-specific behavior.
If you self-host Redis, do not turn the original single-instance Deployment into a multi-replica cache by increasing replicas. Each pod would have its own memory; a Kubernetes Service distributing requests among them does not make those independent caches share keys. Use a supported Redis Cluster topology for sharding, or a documented replication and failover design when you need high availability. Redis Cluster scaling is a data-topology operation, not just a pod-count change. For workloads that need persistent Redis data, plan storage, recovery, and failover explicitly with the relevant Kubernetes StatefulSet and persistent-volume behavior. If Redis is only a cache, treat it as rebuildable and keep the source documents and Qdrant collection recoverable independently.
Deployments and autoscaling are usually more appropriate for the stateless API or worker pods. For example, an HPA can scale the retrieval API based on CPU after you set realistic CPU requests and provide the required metrics pipeline:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: retrieval-api
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: retrieval-api
minReplicas: 2
maxReplicas: 6
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
These replica counts and target are examples, not production sizing advice. Follow the Kubernetes guides for declarative configuration and Horizontal Pod Autoscaling; HPA does not automatically resize Redis or Qdrant. Monitor cache hit rate, cache and vector-search latency, embedding and model latency, Redis memory and evictions, Qdrant resource use, and error rates. Set resource requests and limits from observed workload behavior, and test what happens when Redis is unavailable. If caching is optional, a bounded Redis timeout can let the request continue to Qdrant; if both cache and retrieval are unavailable, return a controlled error rather than silently presenting stale or fabricated context.
For cluster security, keep data services off public endpoints, restrict pod-to-pod traffic, rotate credentials, and apply an appropriate Pod Security Standard. The right controls depend on your cluster and threat model; do not copy a demo manifest into production without reviewing access, storage, backups, and network policy.

A practical way to choose
- Estimate the size and update frequency of the knowledge set. If it is small and can be loaded into the model context within practical token and latency limits, evaluate CAG without adding a vector database first.
- Use Qdrant-backed RAG when you need targeted retrieval from a larger or changing corpus. Apply tenant and document permissions in the retrieval query, not only after a cache hit.
- Measure repeated, identical requests before adding Redis. Cache only data that is safe to reuse within the same authorization and corpus scope, then choose a TTL and invalidation strategy.
- Add Kubernetes only when its scheduling, deployment, or scaling capabilities justify the operational overhead. Scale stateless application pods separately from stateful data services.
The best design may combine these approaches: retrieve current documents from Qdrant, cache eligible retrieval results in Redis, and use a model's supported prompt or KV caching to reduce repeated prefill work. Keep each cache's purpose explicit, and verify quality, freshness, permissions, latency, and cost against your own workload rather than assuming a cache makes every answer faster or more accurate.
For related cluster troubleshooting, see Navigating Common Hurdles in Kubernetes Deployments.