# Vector Databases & Embeddings Storage

> Vector database architecture for semantic search and retrieval, comparing cosine similarity, Euclidean distance, and HNSW index tuning.

Canonical: https://www.agentickit.co/skills/vector-database
Last updated: 2026-11-18

## Key practices
- Use pgvector HNSW indexes for sub-millisecond approximate nearest neighbor search
- Normalize embedding vectors when using dot product or cosine distance
- Store original text chunks alongside embeddings to eliminate extra database joins
- Partition vector indexes by tenant ID to prevent cross-tenant vector leakage

## Related
- [ai-engineer](https://www.agentickit.co/agents/ai-engineer)
- [postgres-pro](https://www.agentickit.co/agents/postgres-pro)
- [/rag-pipeline](https://www.agentickit.co/commands/rag-pipeline)
- [/ai-feature](https://www.agentickit.co/commands/ai-feature)
