Shortening the embedding dimensions while retaining accuracy

11-09-2025

tbl_document_fts = Table(
    "tbl_document_fts",
    metadata,
    Column(
        "chunk_id",
        BigInteger,
        ForeignKey("tbl_document_chunks.id", ondelete="CASCADE"),
        primary_key=True,
    ),
    Column("search_vector", TSVECTOR, nullable=False),
    Column("indexed_at", DateTime, server_default=func.now(), index=True),
    Index("idx_chunk_fts_gin", "search", postgresql_using="gin"),
)