edgedb-ui icon indicating copy to clipboard operation
edgedb-ui copied to clipboard

Implement a way to pass a string as a query argument to perform vector search

Open anbuzin opened this issue 1 year ago • 1 comments

As part of working on queries that involve ext::ai capabilities a user would need to pass text embeddings as query parameters. A text embedding is a numeric representation of text that enables us to semantically compare different pieces of text using math.

Embeddings are obtained by passing text to an API like this. They are then passed into a query as an array<float32>. It is ~2000 elements long, however, which makes it difficult to input using existing UI widgets.

Screenshot 2024-12-07 at 11 19 53 AM

Current workflow:

  1. Set up some way externally (e.g. a Python script) to do the API request to transform text into an embedding
  2. Copy the embedding, paste it as a string parameter, then parse that in the query into array<float32>...? Haven't tried that personally, not sure if that'd work.

Desired workflow:

  1. Once the UI detects an array<float32> parameter, it offers a choice between the normal widget and a text embedding generation widget.
  2. When selecting the second one, the user can pass their text string as an input. They can also pick which of the configured embedding models to use (if multiple are configured in the AI tab).
  3. The UI handles the API request and passes an array<float32> to the DB.

anbuzin avatar Dec 07 '24 04:12 anbuzin

@jaclarke, @1st1 also asked that you have a chat with him about this when you get around to it.

anbuzin avatar Dec 07 '24 05:12 anbuzin