Use parse_embedding_from_db when reading embedding columns from Supabase. Supabase/PostgREST returns pgvector as string; normalize to list of floats before sending to Elasticsearch or other consumers.
Supabase/PostgREST returns pgvector (and embedding) columns as strings (e.g. "[0.1, -0.2, ...]"), not Python lists. Any code that reads an embedding from Supabase and then uses it (e.g. sends to Elasticsearch, does similarity, or passes to code expecting List[float]) must normalize it with parse_embedding_from_db first.
str, list, or None).List[float] or None; use the result and skip the row if None.This avoids type errors and failed bulk indexes when sending to Elasticsearch (dense_vector expects an array of floats, not a string).
from backend.storage.embedding_utils import parse_embedding_from_db
embedding (or any pgvector column) from Supabase in backfill scripts, sync code, or API handlers.embedding field (bulk or single-doc index).news_articles, sec_filing_chunks, macro_kb_chunks, long_stories, or story and uses the embedding.# After fetching row from Supabase (e.g. result.data or .select(...).execute())
embedding = parse_embedding_from_db(row.get("embedding"))
if embedding is None:
continue # or skip this doc
# Use embedding (list of floats) for ES, similarity, etc.
es_doc = {..., "embedding": embedding}
row.get("embedding") directly to Elasticsearch or to code that expects List[float].