Systems and methods for performing vector search
A computer-implemented is disclosed. The method includes: receiving a search query input; generating input enhancement data based on the search query input, the generating comprising processing the search query input using a large language model (LLM); causing to transform at least one of the search query input or the input enhancement data into a first vector embedding; and performing a search of an embedding space based on the first vector embedding.
1 . A computer-implemented method, comprising:
receiving a search query for a search of items in a database;
generating an enhanced query based on the search query, the generating including:
identifying, based on text of the search query, a first object and one or more properties of the first object;
providing, to a large language model (LLM), an indication of the first object and instructions to produce output comprising description text that includes inferred additional properties of the first object; and
combining the search query text and the output of the LLM to obtain text of the enhanced query;
obtaining a first vector embedding based on the enhanced query text; and
performing a search of an embedding space associated with the database based on the first vector embedding.
2 . The method of claim 1 , wherein the search query comprises at least one of text, image, or video.
3 . The method of claim 1 , further comprising providing, to the LLM, instructions to output at least one of enhancement text, enhancement image, or enhancement video that is not included in the search query.
4 . The method of claim 1 , further comprising:
causing to be presented, via a user device, one or more prompts including questions relating to the search query;
receiving user responses to the one or more prompts; and
providing, to the LLM, the user responses to the one or more prompts.
5 . The method of claim 4 , wherein the one or more prompts comprise questions relating to properties of a product identified in the search query and wherein the user responses are received via a chatbot interface.
6 . The method of claim 1 , wherein performing the search further comprises:
performing a search of a second embedding space based on a second vector embedding, the second vector embedding based on at least one of the search query or the description text; and
combining one or more results of the search of the embedding space with the search of the second embedding space.
7 . The method of claim 1 , further comprising:
obtaining contextual data associated with the search query,
wherein generating the enhanced query includes providing, to the LLM, the contextual data associated with the search query.
8 . The method of claim 7 , wherein the contextual data comprises historical chat log data for a user.
9 . The method of claim 7 , wherein the contextual data comprises profile information of a user, the profile information including at least one of product purchase history or browsing history.
10 . The method of claim 1 , further comprising:
determining that the search query does not satisfy defined criteria in connection with the search of the embedding space,
wherein the enhanced query is generated only in response to determining that the search query does not satisfy the defined criteria.
11 . The method of claim 10 , wherein the defined criteria relate to at least one of:
query length of the search query; or
number of different attributes associated with the search query.
12 . A computing system, comprising:
a processor; and
a memory coupled to the processor, the memory storing computer-executable instructions that, when executed by the processor, configure the processor to:
receive a search query for a search of items in a database;
generate an enhanced query based on the search query, the generating including:
identifying, based on text of the search query, a first object and one or more properties of the first object;
providing, to a large language model (LLM), an indication of the first object and instructions to produce output comprising description text that includes inferred additional properties of the first object; and
combining the search query text and the output of the LLM to obtain text of the enhanced query;
obtain a first vector embedding based on the enhanced query text; and
perform a search of an embedding space associated with the database based on the first vector embedding.
13 . The computing system of claim 12 , wherein the instructions, when executed, further configure the processor to provide, to the LLM, instructions to output at least one of enhancement text, enhancement image, or enhancement video that is not included in the search query.
14 . The computing system of claim 12 , wherein the instructions, when executed, are to further cause the processor to:
cause to be presented, via a user device, one or more prompts comprising questions relating to the search query;
receive user responses to the one or more prompts; and
provide, to the LLM, the user responses to the one or more prompts.
15 . The computing system of claim 12 , wherein performing the search further comprises:
performing a search of a second embedding space based on a second vector embedding, the second vector embedding based on at least one of the search query or the description text; and
combining one or more results of the search of the embedding space with the search of the second embedding space.
16 . The computing system of claim 12 , wherein the instructions, when executed, are to further cause the processor to:
obtain contextual data associated with the search query,
wherein generating the enhanced query includes providing, to the LLM, the contextual data associated with the search query.
17 . The computing system of claim 16 , wherein the contextual data comprises historical chat log data for a user.
18 . The computing system of claim 16 , wherein the contextual data comprises profile information of a user, the profile information including at least one of product purchase history or browsing history.
19 . A non-transitory processor-readable medium storing processor-executable instructions that, when executed by a processor, are to cause the processor to:
receive a search query for a search of items in a database;
generate an enhanced query based on the search query, the generating including:
identifying, based on text of the search query, a first object and one or more properties of the first object;
providing, to a large language model (LLM), an indication of the first object and instructions to produce output comprising description text that includes inferred additional properties of the first object; and
combining the search query text and the output of the LLM to obtain text of the enhanced query;
obtain a first vector embedding based on the enhanced query text; and
perform a search of an embedding space associated with the database based on the first vector embedding.