A vector database stores content alongside its embeddings: numerical representations used to find semantically similar content. In an enterprise retrieval-augmented generation (RAG) application, it lets a retriever find relevant passages in proprietary data before an LLM generates an answer. This avoids reloading and embedding the entire source collection for every question. section 7.4 section 8.1.2
The database and its vector index do different jobs. The database persists content, embeddings, and associated metadata; the index organizes vectors for fast similarity lookup. Searching every stored vector directly can be prohibitively expensive for a large corpus. Index choices include exact and approximate nearest-neighbor methods, with speed, accuracy, and memory trade-offs. section 7.4 section 7.5 section 7.5.1
A typical RAG workflow is:
- Read source data, split it into chunks, create embeddings, and retain links to the source as metadata. section 7.4
- Save the chunks and embeddings, then create an index suited to the search requirements. section 7.5 section 7.5.1
- Embed a user query, retrieve matching chunks, and place them with the question in the LLM prompt. section 8.6
Chat over a blog
For a blog spanning nearly 20 years, Redis holds previously ingested posts as chunks and embeddings. A chat application embeds each new question, uses a hybrid search index to retrieve the top five matches, and supplies those chunks to the LLM. Redis Stack in a local Docker container makes the workflow easy to try; that local setup is not, by itself, a production deployment. section 8.1.2 section 8.2 section 8.6
Listing 8.1 docker-compose file for redis-stack
version: '3.7'
services:
vector-db:
image: redis/redis-stack:latest
ports:
- 6379:6379
- 8001:8001
environment:
- REDISEARCH_ARGS=CONCURRENT_WRITE_MODE
volumes:
- vector-db:/var/lib/redis
- ./redis.conf:/usr/local/etc/redis/redis.conf
healthcheck:
test: ["CMD", "redis-cli", "-h", "localhost", "-p", "6379", "ping"]
interval: 2s
timeout: 1m30s
retries: 5
start_period: 5s
volumes:
vector-db:
The Redis Stack Compose listing shows the local vector-database service, ports, volume, and health check used for the example setup. section 8.2
Production use requires more than selecting a database. Plan for ingestion and refresh, index size and schema, scaling, security, and operations. The right database and index depend on the source data and the required retrieval performance; managed services can take on some operational demands. section 8.9 section 10.4.2

























