Retrieval Stage is the first that takes in user enquiry in its raw form. This includes the current user’s question as well as all chat history. The input is then processed through a Query Generator that comprehends the user’s question in relation to the chat history, and generates a summarized query of the user’s question.
The query is then sent into an Context Classifier that would classify the intent into a predefined Context Group. This grouping of context allows different sets of scenarios to be grouped away from each other, allowing each context group to have a more specific prompt for their subsequent enrichment stages.
Once the query is classified and sent to a Context Group. Each query group performs 3 query augmentations.
Instruction Selection dynamically retrieves the most relevant instruction - a textual instruction that contains the business context of the query group.
Schema Linking fetches and links all table schema and definition together.
Few Shots Selection dynamically retrieves the most relevant examples containing questions and target SQL query.