Prompt
vector db with metadata filters
Latest observation
Oct 7, 2026
OpenAI APIWeb search: off
A vector DB with metadata filters lets you do two things at once:
- Semantic search over embeddings (find “similar meaning”)
- Structured filtering on fields like
tenant_id,date,category,source,language, etc.
How it works
You store each vector together with metadata, for example:
{
"id": "doc_123",
"vector": [0.12, -0.44, ...],
"metadata": {
"tenant_id": "acme",
"type": "invoice",
"created_at": "2026-10-01",
"language": "en"
}
}
Then you query with:
- an embedding vector
- plus a filter like:
tenant_id = "acme"type in ["invoice", "receipt"]created_at >= "2026-01-01"
The DB first narrows candidates using metadata, then ranks by vector similarity.
Common vector DBs supporting metadata filters
- Pinecone
- Weaviate
- Milvus
- Qdrant
- Chroma (basic filtering)
- Elasticsearch / OpenSearch with kNN
- Postgres + pgvector with SQL filters
Example use cases
- Multi-tenant apps: only search within one customer’s data
- RAG systems: filter by document type, source, access control
- Time-based retrieval: search only recent docs
- Hybrid search: semantic + metadata + keyword constraints
Important considerations
- Filter expressiveness: equality, range,
IN, nested fields, boolean logic - Indexing strategy: some DBs do pre-filtering, others post-filtering
- Performance: highly selective filters can speed up search, but poorly indexed filters can hurt
- Consistency: make sure metadata and vectors are updated together
- ACL/security: metadata filters are often used for permission checks
Quick recommendation
- Qdrant: great filtering + open source
- Weaviate: flexible schema and filtering
- Pinecone: managed and simple to use
- pgvector: good if you already use Postgres
If you want, I can also give you:
- a comparison table
- example queries for Pinecone/Qdrant/Weaviate
- or help choose the best one for your stack.