# Discourse AI + Data Explorer?

**URL:** https://meta.discourse.org/t/discourse-ai-data-explorer/274011
**Category:** Feature
**Tags:** data-explorer, completed, ai, ai-bot
**Created:** [August 4, 2023, 6:54pm UTC](https://meta.discourse.org/t/discourse-ai-data-explorer/274011 "2023-08-04T18:54:32Z")
**Posts on this page:** 1
**Showing post:** 47

<div class="post-metadata">

### Author: ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://meta.discourse.org/u/EricGT)
#### Post date: [August 18, 2023, 1:14pm UTC](https://meta.discourse.org/t/discourse-ai-data-explorer/274011/47 "2023-08-18T13:14:01Z")

</div>

> [@simon](#):
>
> Another approach could be to develop a more interactive dialogue where I ask clarifying questions … This would make the process more interactive and could potentially lead to more accurate queries.

That is my favorite option so far, albeit a very hard one to implement. Thus, you guessed it, another paper. Again this is not an authoritative paper as there are many similar approaches.

“DiagGPT: An LLM-based Chatbot with Automatic Topic Management for Task-Oriented Dialogue” by Lang Cao ([pdf](https://arxiv.org/pdf/2308.08043.pdf))

Just replace the medical information with PostgreSQL information as needed. The nice part is the paper gives the prompts and suggest which tool with agents to use.

 ![image](https://global.discourse-cdn.com/meta/original/4X/2/f/f/2ffcd80f4171bc8fb4d6387914050cc912baa2bc.png)

> **Going down the rabbit hole. (Click triangle to enter)**
>
> Since `Task Oriented Dialogue` is what appears is needed.  
> Google search: `task oriented dialogue`  
> Search result includes: [Papers With Code](https://paperswithcode.com/) - [Task-Oriented Dialogue Systems](https://paperswithcode.com/task/task-oriented-dialogue-systems)  
> The leader board entry is `T5-3b(UnifiedSKG)` which includes a link to paper  
> “UnifiedSKG: Unifying and Multi-Tasking Structured Knowledge Grounding with Text-to-Text Language Models” by Tianbao Xie, Chen Henry Wu, Peng Shi, Ruiqi Zhong, Torsten Scholak, Michihiro Yasunaga, Chien-Sheng Wu, Ming Zhong, Pengcheng Yin, Sida I. Wang, Victor Zhong, Bailin Wang, Chengzu Li, Connor Boyle, Ansong Ni, Ziyu Yao, Dragomir Radev, Caiming Xiong, Lingpeng Kong, Rui Zhang, Noah A. Smith, Luke Zettlemoyer and Tao Yu ([pdf](https://arxiv.org/pdf/2201.05966v3.pdf))
> 
> ![image](https://global.discourse-cdn.com/meta/original/4X/b/4/f/b4fabafda81f0a969fc10dfed412e8263e062cc8.png)
> 
> Notice this  
> ![image](https://global.discourse-cdn.com/meta/original/4X/e/d/2/ed2f55880644ff53f1e2c81d39541b9e92ede9b5.png)
> 
> 🙂

* * *

**EDIT**

From [https://python.langchain.com/](https://python.langchain.com/)

Construct an SQL agent from an LLM and tools. ([ref](https://api.python.langchain.com/en/latest/agents/langchain.agents.agent_toolkits.sql.base.create_sql_agent.html))

It list a few at the bottom of the page, this one should be looked at

> **[Build a RAG agent with LangChain - Docs by LangChain](https://docs.langchain.com/oss/python/langchain/rag)**

> **Use case**
> 
> Enterprise data is often stored in SQL databases.
> 
> LLMs make it possible to interact with SQL databases using natural language.
> 
> LangChain offers SQL Chains and Agents to build and run SQL queries based on natural language prompts.
> 
> These are compatible with any SQL dialect supported by SQLAlchemy (e.g., MySQL, PostgreSQL, Oracle SQL, Databricks, SQLite).
> 
> They enable use cases such as:
> 
> - Generating queries that will be run based on natural language questions
> - Creating chatbots that can answer questions based on database data
> - Building custom dashboards based on insights a user wants to analyze

* * *

**EDIT** (08/23/2023)

> **[Spider: Yale Semantic Parsing and Text-to-SQL Challenge](https://yale-lily.github.io/spider)**
>
> Yale Spider is a large dataset for complex and cross-domain semantic parsing and text-to-SQL Task introduced by our EMNLP 2018 paper. It was annotated by 11 Yale students. It can be used for developing natural language interfaces for relational...

> Spider is a large-scale [_complex and cross-domain_](https://medium.com/@tao.yu/spider-one-more-step-towards-natural-language-interfaces-to-databases-62298dc6df3c) semantic parsing and text-to-SQL dataset annotated by 11 Yale students. The goal of the Spider challenge is to develop natural language interfaces to cross-domain databases. It consists of 10,181 questions and 5,693 unique complex SQL queries on 200 databases with multiple tables covering 138 different domains. In Spider 1.0, different complex SQL queries and databases appear in train and test sets. To do well on it, systems must _generalize well to not only new SQL queries but also new database schemas_ .

* * *

**EDIT** (0824/2023)

[https://github.com/Dataherald/dataherald](https://github.com/Dataherald/dataherald)

> Dataherald is a natural language-to-SQL engine built for enterprise-level question answering over structured data. It allows you to set up an API from your database that can answer questions in plain English.

As I often tell others, for some things in life you just have to wait and someone will do the work for you for free.

---

_[View the full topic](https://meta.discourse.org/t/discourse-ai-data-explorer/274011)._
