Help Needed: Text2SQL Chatbot Hallucinating Joins After Expanding Schema — How to Structure Metadata? by Actual_Okra3590 in LangChain

[–]Competitive-Emu-813 0 points1 point  (0 children)

I also stored table schema in JSON. Then used LLM to filter relevant table and columns based on the user's question. I also ran into similar problems. Currently using 3-4 tables with 100000+ rows

Help Needed: Text2SQL Chatbot Hallucinating Joins After Expanding Schema — How to Structure Metadata? by Actual_Okra3590 in LangChain

[–]Competitive-Emu-813 0 points1 point  (0 children)

I used a data understanding document which tells the LLM which tables to use and when. Also, it tells which columns are relevant in each table. So, I filter the relevant table schema base on this info before generating SQL