Once you have vectors, how do you manage them?
A RAG system may need to search thousands or millions of passage embeddings and still keep track of the original text, document ID, date, tenant, and permissions.
A vector database or vector-capable data store keeps vectors together with metadata and provides similarity-search capabilities. The embedding model creates the vector; the database stores and searches it.
What is stored for one passage?
Illustrative record
Follow the record rather than only its vector. The identifier connects a search hit back to source text; metadata lets the application keep the result within the appropriate version and scope.
A vector database stores more than the vector
Exact search versus approximate nearest neighbours
For a small collection, comparing the query with every eligible vector can be simple and completely exact. As collections grow, scanning everything may become too expensive.
Search trade-off
ANN reduces search work by accepting a recall trade-off
Metadata filters are useful—but authorization is stronger
A topic filter such as department = "HR" can improve relevance. It does not automatically prove that the current user is allowed to read every HR document.
Do you always need a specialized vector database?
No. If a team already uses PostgreSQL, has a moderate vector workload, and needs relational joins or transactional metadata, a vector extension in the existing database can be a sensible starting point. Specialized infrastructure becomes useful when measured scale, latency, indexing, or operational requirements justify it.
Why the next lesson matters
The vector store can return candidates. How do chunk boundaries, hybrid search, reranking, and retrieval metrics improve what reaches the LLM?
Advanced RAG →Summary / Key Takeaways
- The embedding model creates vectors; the vector-capable database stores and searches them.
- A useful record keeps the vector together with source text and traceable metadata.
- Exact search can be simple and fully accurate for small enough collections.
- ANN indexes reduce search work but can lose neighbour recall, so the trade-off should be measured.
- Metadata relevance filters do not replace explicit authorization and tenant isolation.
- An existing relational database with vector support may be enough before specialized infrastructure is justified.