mindsdb_sql icon indicating copy to clipboard operation
mindsdb_sql copied to clipboard

Support of embedding related operators in postgres

Open yuhuishi-convect opened this issue 1 year ago • 0 comments

Example:

SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;

SELECT (embedding <#> '[3,1,2]') * -1 AS inner_product FROM items;

SELECT 1 - (embedding <=> '[3,1,2]') AS cosine_similarity FROM items;

Currently if we write these queries directly, the parser will try to parse it as AST tree, which causes an error since <->, <#>, <=> are not supported operators. Might need to add those column in the lexer, and modify renderer.

yuhuishi-convect avatar Aug 25 '23 06:08 yuhuishi-convect