US 12,265,566 B2
Creating contextual prompts based on embeddings to enrich user text
Mayur Madnani, Bangalore (IN)
Assigned to INTUIT INC., Mountain View, CA (US)
Filed by INTUIT INC., Mountain View, CA (US)
Filed on Aug. 3, 2023, as Appl. No. 18/365,153.
Prior Publication US 2025/0045314 A1, Feb. 6, 2025
Int. Cl. G06F 16/33 (2019.01); G06F 16/3329 (2025.01); G06F 16/334 (2025.01)
CPC G06F 16/3344 (2019.01) [G06F 16/3329 (2019.01); G06F 16/3347 (2019.01)] 18 Claims
OG exemplary drawing
 
1. A computer-implemented method comprising:
receiving, by at least one processor, a query, wherein the query comprises raw text;
creating, by the at least one processor, a first embedding based on the query wherein the embedding comprises a vector representation of the raw text;
retrieving, by the at least one processor, a plurality of other embeddings, wherein the plurality of other embeddings are vectors complementary to the vector of the first embedding, and the vectors of the plurality of other embeddings encode context;
ranking, by the at least one processor, the plurality of other embeddings based on a relevance to the query determined by a vector similarity algorithm measuring the similarity between the other embeddings and the first embedding in a vector space;
creating, by the at least one processor, a contextual prompt comprising the raw text of the query and the context from at least a highest ranked one of the plurality of other embeddings;
querying, by the at least one processor, a large language model (LLM) trained on a data set different from the context, the querying comprising providing the contextual prompt as a prompt to the LLM, thereby generating a response to the query; and
causing, by the at least one processor, the response to be displayed by a display device.