Vector Databases
Choose and configure vector databases for knowledge bases, including pgvector, Qdrant, Redis, and filesystem providers.
Driver Compatibility
| Metadata Driver | Vector Provider | Notes |
|---|---|---|
| PostgreSQL | pgvector | Native integration when the vector extension is installed. |
| PostgreSQL | Qdrant, Redis, Filesystem | Supported via external services if you prefer to separate workloads. |
| SQLite | Qdrant (recommended) | External vector database required for knowledge bases. |
| SQLite | Redis with RediSearch | Works for low-latency deployments with managed Redis. |
| SQLite | Filesystem | Development-only option for lightweight prototypes. |
pgvector (PostgreSQL Only)
CREATE EXTENSION IF NOT EXISTS vector;knowledge:
vector_dbs:
- id: main
provider: pgvector
dimension: 1536- Works alongside metadata in the same PostgreSQL cluster.
- Ensure
dimensionmatches the embedding model output. - Managed databases (Neon, Supabase, RDS) often provide pgvector as a toggle or automatic extension.
Qdrant (Recommended with SQLite)
knowledge:
vector_dbs:
- id: main
provider: qdrant
url: http://localhost:6333
dimension: 1536
collection: compozy_embeddings- Production-ready open-source vector database.
- Supports filtering, payloads, and distributed deployments.
- Works with both PostgreSQL and SQLite metadata drivers.
Redis with RediSearch
knowledge:
vector_dbs:
- id: cache
provider: redis
url: redis://localhost:6379
dialect: search
dimension: 1536
index: compozy:kb- Utilize managed Redis offerings with RediSearch enabled.
- Ideal when you already depend on Redis for caching or rate limiting.
- Memory-bound; monitor dataset size closely.
Filesystem Provider (Development Only)
knowledge:
vector_dbs:
- id: local
provider: filesystem
path: ./data/embeddings
dimension: 1536- Stores embeddings as structured files on disk.
- Great for unit tests or quick demos.
- Not recommended for production due to limited concurrency and durability.
Decision Matrix
| Requirement | Recommended Provider |
|---|---|
| Production deployment with PostgreSQL | pgvector |
| Production deployment with SQLite | qdrant |
| Edge deployment with minimal services | filesystem (development) or qdrant (managed) |
| Shared cache infrastructure already in place | redis |
Operational Tips
- Dimension Consistency
Ensure every provider uses the same embedding dimension across collections.
- Health Checks
Add readiness probes for external vector services to avoid startup race conditions.
- Access Control
Secure API keys or tokens for Qdrant/Redis; never store them in plain text inside repositories.
- Monitoring
Track latency and memory usage, especially when running Redis or Qdrant alongside Compozy.