USE GRAPH financialGraph CREATE OR REPLACE QUERY q1b () SYNTAX v3 { ListAccum @@query_vector; MapAccum @@distances; //find Scott's embedding, store it in @@query_vector s = SELECT a FROM (a:Account) WHERE a.name == "Scott" POST-ACCUM @@query_vector += a.emb1; //find top-5 similar to Scott's embedding from Account's embedding attribute emb1, store the distance in @@distance v = vectorSearch({Account.emb1}, @@query_vector, 5, { distance_map: @@distances}); print v WITH VECTOR; //show the embeddings print @@distances; //show the distance map } #compile and install the query as a stored procedure install query q1b #run the query run query q1b()