Vector Database in Django with pgvector: Supercharge Your Similarity Search

preview_player
Показать описание
Want to build a powerful vector database for similarity search and recommendation systems using Django?

In this video, I dive into integrating pgvector, a PostgreSQL extension, into your Django project to store and search high-dimensional vectors efficiently.

#database #django
Рекомендации по теме
Комментарии
Автор

Hi! Thank you for sharing this.

class PostEmbedding(models.Model):
post = models.OneToOneField(Post, on_delete=models.CASCADE, related_name="embedding")
embedding = VectorField(dimensions=768,
help_text= "Vector embeddings for post content",
null= True, #true so that embedding computation can be done asynchronously
blank=True)

class Meta:
indexes = [
HnswIndex(
name="clip_l14_vectors_index",
fields=["embedding_clip_vit_l_14"],
m=16,
ef_construction=64,
opclasses=["vector_cosine_ops"],
)
]

My question is, do I have to create a serializer for this? as I haven't created serializers for embeddings before

HamzaAhmad-qt