Skip to content

[draft] Vector search#388

Open
yutin1987 wants to merge 6 commits into
masterfrom
vector-search
Open

[draft] Vector search#388
yutin1987 wants to merge 6 commits into
masterfrom
vector-search

Conversation

@yutin1987

Copy link
Copy Markdown

No description provided.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces AI embedding generation and caching capabilities. It adds a new EMBEDDING type to the GraphQL schema, implements a createEmbedding utility using Google Vertex AI with support for media chunking, and includes comprehensive tests. Feedback focuses on a breaking change in the createAIResponse utility that affects existing callers, the lack of handling for concurrent 'LOADING' states which could lead to redundant API calls, and opportunities to improve performance by parallelizing media chunk processing and reusing AI clients. Additionally, the AIEmbedding GraphQL type should include the text field to expose error messages.

Comment thread src/graphql/util.js
Comment thread src/util/embedding.ts
Comment on lines +86 to +93
if (
cached &&
cached.status === 'SUCCESS' &&
Array.isArray(cached.embeddings) &&
cached.embeddings.length > 0
) {
return cached.embeddings as EmbeddingChunk[];
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current logic only returns cached embeddings if the status is SUCCESS. If an embedding is currently being generated (status: 'LOADING'), this code will proceed to call createAIResponse, which likely creates a duplicate loading record and starts a redundant generation process. It should instead wait for the existing process to complete.

Comment thread src/util/embedding.ts Outdated
Comment thread src/util/embedding.ts
Comment on lines +105 to +107
fields: {
...commonAiResponseFields,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The AIEmbedding type is missing the text field. Since createEmbedding stores error messages in the text field when the status is ERROR, this field should be added to the GraphQL model to allow clients to retrieve error details.

  fields: {
    ...commonAiResponseFields,
    text: { type: GraphQLString },
  },

@yutin1987 yutin1987 force-pushed the vector-search branch 2 times, most recently from 770f044 to cbfc471 Compare May 5, 2026 03:43
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.

1 participant