What is a vector database collection?
A vector database collection is a logical container that groups related vectors and their associated records so they can be stored, indexed, and searched together.
Think of a collection as somewhat similar to a table in a relational database, although the exact features and terminology vary by vector database.
What does a collection contain?
In a RAG system, each record commonly includes:
- Vector embedding: A numerical representation of a document chunk.
- Unique ID: Identifies the vector or chunk.
- Text or document reference: The original chunk text or a pointer to where it is stored.
- Metadata: Such as document ID, title, source, page number, tenant ID, or creation date.
The collection also has search settings or indexes that determine how vectors are compared and retrieved. Some databases specify vector dimensions and similarity metrics at collection creation; others configure these through individual vector fields or indexes.
Example in RAG
Suppose a company builds a RAG assistant over its internal documentation.
It might create a collection named company_knowledge containing:
- A vector for each document chunk.
- The corresponding chunk ID and source-document ID.
- Metadata such as
department,document_type, andupdated_at.
When a user asks, "What is the employee leave policy?", the query is embedded and searched against this collection. The database returns relevant vector records, which the RAG system uses to retrieve supporting text.
Why use separate collections?
Collections can help organize data that should be managed or searched differently.
For example:
hr_policies: HR document embeddings.product_manuals: Product support documentation.technical_docs: Engineering knowledge.
Separate collections may make sense when datasets need different embedding models, dimensions, index configurations, retention policies, or access arrangements.
However, you do not need a separate collection for every department, user, or tenant. A shared collection with metadata filtering can be simpler and more efficient when the vectors are compatible and authorization is correctly enforced.
Collection vs vector index
These two concepts are not the same:
- Collection: Organizes vector records and related metadata.
- Index: Speeds up similarity search over vectors in that collection.
A collection may support one or more indexes, depending on the database.
For instance, the same logical collection may hold document embeddings while an HNSW or IVF index accelerates nearest-neighbor retrieval.
Important design considerations
When creating a collection for production RAG:
- Keep vectors in a compatible embedding space for meaningful similarity comparisons.
- Choose an appropriate similarity metric and indexing method.
- Preserve stable document and chunk IDs for updates and deletions.
- Store metadata required for source citations and filtering.
- Enforce tenant permissions securely; collection boundaries or filters alone are not automatically sufficient access control.
Interview takeaway
A vector database collection is a logical grouping of vector records, identifiers, and metadata that can be searched and managed together. In RAG, it usually represents a searchable body of document chunks. Collections organize data, while indexes such as HNSW or IVF accelerate retrieval within that data.
Learning Sequence
Retrieval-Augmented Generation Curriculum
Explore Related Questions
Deepen your understanding across related Retrieval-Augmented Generation topics.