3 ms·
How do you do the initial query -> possible schema matching? Also, how do you control token counts?
by iandanforth 3y ago
How do you do the initial query -> possible schema matching? Also, how do you control token counts?
- MrezaPourreza 3y agoFor schema matching, we leverage embeddings. We create embeddings for the tables within the database and generate one for the natural language question provided. We then calculate the cosine similarity between these embeddings to determine a relevance score. This score is then forwarded to the agent, which uses it to identify the pertinent tables. To minimize the token count used by Large Language Models (LLMs), we've designed our tools to handle most of the computational work internally. Consequently, only a small number of tokens are transmitted to the agent. The agent focuses solely on decision-making, while the tools handle the heavy lifting and similarity assessments.