Category · Data and retrieval-augmented generation
What is a vector database?
A vector database stores vectors, that is, the meaning of texts translated into numbers. When a question comes in, it quickly finds the passages closest in meaning. pgvector, in PostgreSQL, is one example.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- They use approximate search indexes, such as HNSW (Hierarchical Navigable Small World), which find close neighbours very fast at the cost of a small margin of error.
- The trade-off between speed and recall is tuned with a few index parameters, and measured on your own data rather than keeping the default values.
- Dedicated databases suit very large volumes, but for most business needs an existing database with a vector extension is enough.
The trap to avoid
The trap is separating vectors from metadata; filtering by access rights or by date then becomes complicated and error-prone.
Related terms
- Semantic chunkingData and retrieval-augmented generation
- EmbeddingData and retrieval-augmented generation
- RAG (retrieval-augmented generation)Data and retrieval-augmented generation
Where this is taught
This idea comes up throughout the lessons; we work on it with your own examples during a lesson.
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.