How to set up a vector database for AI
Updated 7/20/2026
A vector database stores text as numbers (embeddings) that represent meaning, not just words. This lets you search by meaning, not just exact matches.
What it is for
- Semantic search (you find what you want, even with different words).
- Chatbots that answer based on your documents (RAG).
- Similarity-based recommendations.
Option 1: pgvector
If you already use PostgreSQL, the pgvector extension adds vector support:
CREATE EXTENSION vector;
CREATE TABLE documents (id serial, content text, embedding vector(1536));
Option 2: Qdrant
A dedicated, fast vector database, easy to start with Docker:
docker run -d -p 6333:6333 -v qdrant:/qdrant/storage qdrant/qdrant
Next step
With a vector database and a local model, you build a chatbot over your documents, see RAG chatbot on your docs.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to use OpenHands as an AI software engineer
OpenHands takes a task and writes, runs and debugs the code on its own. Here is how to use it safely.
Updated 7/20/2026AI & self-hostingHow to extract web data without code, using Maxun
Build robots that collect data from websites by clicking, without writing a line of code.
Updated 7/20/2026AI & self-hostingHow to build a customer chatbot with Dify
Use Dify to create an assistant that answers from your company documents, without writing code.
Updated 7/20/2026