Skip to content

News RAG: give news_article.embedding a fixed dimension to enable a pgvector index #203

Description

@rappm

Follow-up from PR #177 review.

news_article.embedding is an untyped Vector() (no fixed dimension). This deliberately lets one table hold embeddings from multiple models/dimensions, but pgvector cannot build an HNSW or IVFFlat index on a dimensionless column, so every semantic retrieval is a sequential scan.

That is acceptable at current volume. If volume grows, the fix is to pin a dimension and add an ANN index, which requires a table rewrite and interacts with the retention cap (NEWS_RETENTION_MAX_ROWS) added in #177. Recording it so the tradeoff stays a conscious decision.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions