Inference Logic
Last updated
Last updated
When Tracy receives a user's question, the following steps are taken to generate an answer:
Intent Assessment: Determine whether the question is related to the NBA.
Question Decomposition and Rewriting: If the question is NBA-related, attempt to decompose and rewrite it. This process involves referencing predefined NBA domain knowledge and question templates.
Retrieval Based on Question Type: Once the question is decomposed, it is categorized into one of two types—data-related or information-related:
NL-to-SQL (NL2SQL)
For data-related questions, use NL2SQL to translate the question into a database query (SQL). This step references the database's DDL and predefined SQL templates.
For information-related questions, retrieve relevant information through a knowledge base or online search.
Synthesis and Answer Generation: Compile all collected information and utilize a llm to generate the final answer based on the user's original question.