Skip to content

Conversation

@bobular
Copy link
Member

@bobular bobular commented Oct 24, 2025

This PR integrates embedding API calls to generate semantic vector representations for each topic's headline and summary text. The embeddings are computed by concatenating the headline and summary with double newlines, then calling the embedding service to produce 512-dimensional vectors. A new embedding_vector field (number array) is optionally added to the topic response payload for use in client-side similarity calculations and visualization. The "Other" topic does not get a vector.

The token usage handling was overhauled while we were at it (to avoid applying the much higher chat model costs). The $0.02/M input tokens cost has been hardcoded in DailyCostMonitor

TO DO:

  • Add config mechanism for enabling/disabling the embedding functionality - now via a makeTopicEmbeddings prop in the JSON request payload to the SingleGeneAiExpressionReporter - defaults to false of course.
  • Remove requirement for OPENAI_API_KEY to be set if makeTopicEmbeddings is false
  • Add hard-coded configurable support for extended reasoning in ClaudeSummarizer

@bobular bobular changed the base branch from master to ai-expression-claude October 27, 2025 11:51
@bobular bobular requested a review from ryanrdoherty October 29, 2025 17:49
@bobular bobular changed the base branch from ai-expression-claude to master November 8, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants