Skip to content

Instantly share code, notes, and snippets.

@wph95
Last active October 22, 2022 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wph95/bcb6f9fe3401a5978cedf3389afa7f75 to your computer and use it in GitHub Desktop.
Save wph95/bcb6f9fe3401a5978cedf3389afa7f75 to your computer and use it in GitHub Desktop.
[完整版本] magic mirror - ai2summary 智能查询工具

🪞魔镜

队名: 6c0c6375-462b-4320-9af2-03593d55b227

成员: 王鹏翰 @wph95 许灿文@jetrunner

repo: https://github.com/wph95/mirror


Abstract

通过 AI 帮助用户通过自然语言查询数据库,生成摘要。 tidb cloud 解决了存储数据的问题。Mirror 致力于解决查询数据,降低数据的使用难度,No-code BI, 无需 SQL/编程 知识也可以轻松的进行数据分析。

让人人都可以拥有针对私有数据集的 GOOGLE。

动机

大数据分析 ~= 收集与清洗数据 -> 存储数据 -> 查询数据。

随着数据规模的增长和数据结构的多样化,写出合理的 SQL 难度在指数性增长。让数据分析的门槛逐渐增加。 我们创新性的设计 mirror 魔镜,相较于学术界的各种 text to sql 方案。我们更端到端的降低数据分析查询的难度。

  1. 简化的接入流程
  2. 丰富的输入接口
  3. 业内前沿的 text to sql 模型
  4. 创新性的将结构化的结果通过 GPT-3 生成总结

项目设计

简化的接入流程

自动连接 TiDB Cloud 上的 database,自动扫描获得需要的表结构

丰富的输入接口

  1. 可以通过 siri/workflow 实现在 iphone 上查询数据库。
hi siri,Let the magic mirror tell me who submitted the most code to the tidb project last month.
  1. chrome plugin/ WebUI
  • 在 ossinsight 界面插入智能客服 bot。通过对话形式查询 github archive
  • Mirror WebUI,在给予 tidbcloud 访问权限后进行自然语言搜索。
  1. textToSQL

    我们会使用业内前沿的 textToSQL model 生成合理的sql

    并通过 https://github.com/pingcap/ossinsight/tree/main/api/querieshttps://github.com/cncf/devstats/tree/master/metrics 产生相对应的 textToSQL 训练模型。

    https://openai.com/blog/openai-codex/ https://github.com/microsoft/SCoRE https://github.com/microsoft/rat-sql

  2. 使用 AI 生成的 SQL 查询 tidbcloud Database

  3. 根据结果和用户输入的问题。通过 GPT3 生成一段小结

  4. 接受用户反馈,如果用户对小结不满意,可以使用自然语言对期望的结果进行描述。mirror 将从 #3 继续进行,优化 SQL 和结果

展示用例

  1. 个人记账本表。(通过招行csv,或美国银行的statment 得到原始数据,存入到 tidb cloud 上)
上个月我有多少笔付款?

我上个月总共入账多少钱?

上个月相比上上个月开销增长了多少?
  1. ossinsight 智能助手

    昨天 star 增长最多的项目是什么?

    昨天最热门的项目是什么?

tidb 上个季度star 数同比增长了多少?

tidb 这个季度谁的代码贡献量最多?

tidb 这个季度谁的代码贡献量最大,且不属于pingcap 公司?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment