Redis is an open-source, in-memory key–value store used as a database, cache, or message broker. For a retrieval-augmented generation (RAG) chat application, Redis Stack provides a local place to store and search embeddings instead of reloading and re-embedding source documents for every question. section 8.2 section 8.1.2
A blog-post Q&A workflow uses Redis in four steps:
- Run Redis Stack in Docker; Docker must already be installed and configured. section 8.2
- Read posts from an RSS feed, retain their content and metadata, and create embeddings. section 8.3 section 8.6
- Create a Redis Search index with text, tag, and vector fields. The example stores embeddings in a FLOAT32 vector field using HNSW and cosine distance. section 8.3
- Embed each question, search for matching chunks, and place retrieved results alongside the question in the LLM prompt. section 8.6
Listing 8.2 Redis index schema
SCHEMA = [
TagField("url"),
TextField("title"),
TextField("description"),
TextField("publish_date"),
TextField("content"),
VectorField("embedding", "HNSW",
{"TYPE": "FLOAT32",
"DIM": 1536,
"DISTANCE_METRIC": "COSINE"}),
]
The index schema makes the division of work concrete: searchable post metadata and text sit beside a 1,536-dimensional embedding field. section 8.3
The local container and index are an implementation example, not a complete production deployment guide. The chat flow retrieves the top five matches and instructs the model to say when the posts do not contain an answer. section 8.2 section 8.6





