Vector databases are critical in Retrieval-Augmented Generation (RAG) systems for ensuring the integrity of retrieved context. They help detect indirect prompt injections or poisoned data within documents by identifying adversarial embeddings that manipulate an LLM's behavior without direct user input.