Files
haunt-fm/alembic/versions/002_add_playlist_vibe.py
Thomas Hallock 1b739fbd20 Add vibe-aware playlists with CLAP text embeddings
Blend taste profile with text-embedded mood descriptions (e.g. "chill
ambient lo-fi") using pre-blended vector search against the existing
HNSW index. New optional `vibe` and `alpha` params on playlist generate
and recommendations endpoints. Backward compatible — no vibe = pure
taste profile (alpha=1.0).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 13:14:28 -06:00

27 lines
636 B
Python

"""Add vibe and alpha columns to playlists
Revision ID: 002
Revises: 001
Create Date: 2026-02-22
"""
from typing import Sequence, Union
import sqlalchemy as sa
from alembic import op
revision: str = "002"
down_revision: Union[str, None] = "001"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.add_column("playlists", sa.Column("vibe", sa.Text, nullable=True))
op.add_column("playlists", sa.Column("alpha", sa.REAL, nullable=True))
def downgrade() -> None:
op.drop_column("playlists", "alpha")
op.drop_column("playlists", "vibe")