Git Product home page Git Product logo

querygpt's Introduction

icon QueryGPT

License GitHub Stars GitHub Forks GitHub Contributors

QueryGPT Natural Language Data Query

  1. QueryGPT is a natural language data query tool based on OpenAI GPT3.5 and Langchain.
  2. It is implemented using OpenAI GPT3.5-turbo-0613 and Langchain Function Agent, which is faster, more stable, and more accurate than Pandas Agent and CSV Agent.
  3. It supports data output in Markdown format, JSON format, and visualization with ECharts and Matplotlib.

Example

example

Quick Start

Start API

  1. Install Python 3.10 and pip, and create a virtual environment.
  2. git clone [email protected]:sdaaron/QueryGPT.git
  3. cd QueryGPT/server
  4. pip install -r requirements.txt
  5. Rename .env.example to .env and modify the environment variables.
OPENAI_API_KEY='Your OpenAI Key'
  1. Start the API
    Start the API with the default local data file: python main.py --host xx --port xxx
    Start the API with a specific local CSV file: python main.py --host xx --port xxx --csv_path xxx.csv
    Start the API with a specific local Excel file: python main.py --host xx --port xxx --excel_path xxx.xlsx

Start UI

  1. cd QueryGPT/client
  2. pnpm install
  3. npm run dev
  4. Make sure your vite.config.js has the same proxy configuration as your API service address.

Project Introduction

  1. Project Overview

    • QueryGPT is a data query tool based on OpenAI. It uses FastAPI as the backend framework and Langchain to implement specific functions. The advantages of this tool include data privacy and validity, as all data operations are performed locally without passing through the interface. Additionally, the tool is extensible, and developers can add custom classes in the Langchain tool to implement specific query functions. Furthermore, the tool uses Embedding similarity search to achieve multi-file search, enabling quick identification of target columns and reducing the token usage.
  2. Features and Characteristics

    • The tool retrieves the required information by calling OpenAI's API, completes the data query by calling the interface, and preprocesses the information to retain only the relevant information, ensuring data privacy and validity.
    • The Langchain tool implements agent functions, and developers can extend the tool's functionality by adding the required classes in the tool to achieve specific query functions.
    • Embedding similarity search is used to quickly identify target columns and reduce the number of tokens. By converting the data into vector representations and calculating the similarity between vectors, target columns similar to the query conditions can be quickly found. Reducing the number of tokens improves search efficiency and performance.
  3. Limitations

    • The tool has relatively simple functionality and cannot flexibly implement complex query tasks. It may not meet users' requirements for advanced queries and complex data analysis tasks.
    • Limited usability: The tool is currently only suitable for querying structured data (such as CSV files). It has low applicability to other types of data or different query scenarios and cannot achieve good migration and scalability.
  4. Future Development To further enhance the functionality and applicability of the tool, the following improvements and developments can be considered:

    • Support more query scenarios: The tool can be extended to support more query scenarios for structured data, such as database queries. This can increase the tool's applicability and meet a wider range of user needs.
    • Implement a universal data repository: To support more query methods and data types, consider implementing a universal data repository. By building a data repository, users can flexibly perform data queries and analysis, and enjoy more features and capabilities.

Contact Us

example

Roadmap

  • Implement data query functionality and result output

    • Implement custom Langchain Function Agent
      • Implement Query Tool to achieve basic data retrieval requirements
      • Implement Plot Tool to enable chart generation
      • Implement various custom calculation tools
        • Calculate average order value, percentage, growth rate
        • Calculate month-over-month and year-over-year growth rate
        • Support more custom calculations
      • Integrate ydata-profiling for simple data description
    • Embedding similarity search
    • Support multiple output formats
      • Output data in Markdown format
      • Output data in JSON format
      • Use Matplotlib to generate clustered bar charts, line charts, pie charts
      • Output Echarts charts
      • Output tables
  • Optimization of interactivity

    • Improve UI design
    • Optimize chart styles
    • Streamed output
    • Guide users to ask questions correctly and display related questions
    • Display data retrieval process
  • Implement more features

    • Enhanced data analysis capabilities: Perform simple analysis on output data
    • Support user-uploadable tabular data
    • Support database connection
    • Support natural language operations on tabular data
    • User login

querygpt's People

Contributors

sdaaron avatar fxjhello avatar

Stargazers

 avatar Li Guo Chun avatar GentleLemon avatar  avatar SpreadWater avatar  avatar Ding avatar chen avatar zhangucan avatar Kaucy avatar  avatar  avatar Evan avatar 凝紫暮 avatar 废材 avatar  avatar PapacyDai avatar Steven Lee avatar Benedict King avatar panhong avatar  avatar  avatar W  avatar  avatar  avatar Verna Spinka avatar jiangfangfang avatar Mino_Qin avatar kyle-hy avatar  avatar  avatar ZeroZ avatar genix avatar Bo Rong Ou  avatar Kelvin avatar yi.liang avatar Azitai avatar  avatar Warren Wen avatar  avatar  avatar  avatar  avatar  avatar k11hao avatar  avatar ideallove avatar Jake avatar Seder(方进) avatar fh12 avatar Matthew Lau avatar Mangooo avatar  avatar MonsterPi avatar  avatar liujian avatar  avatar hello avatar  avatar Jiaqing avatar Smile_L avatar  avatar sssfeather avatar 宋祖康 avatar tech-jum avatar  avatar xuan avatar  avatar  avatar  avatar  avatar Ryan.G.Sun avatar fofo avatar Aria F avatar sunny avatar GUOQIANG LIN avatar breeze avatar  avatar  avatar  avatar  avatar  avatar 大花猫 avatar  avatar lsave avatar ZiheLiu avatar YangCaine avatar z avatar Ziv Chen avatar  avatar Han Tianshuo avatar 余岸 avatar qixiaobo avatar  avatar Teng Yu avatar zgia avatar  avatar short mamba avatar 王军杰 avatar  avatar

Watchers

Bottle avatar maxmon avatar  avatar  avatar  avatar

querygpt's Issues

能连openai官网,不知道为啥会这样

requests.exceptions.ProxyError: HTTPSConnectionPool(host='openaipublic.blob.core.windows.net', port=443): Max retries exceeded with url: /encodings/cl100k_base.tiktoken (Caused by ProxyError('Unable to connect to proxy', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001C0DD3A3430>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')))

指定excel文件报错

image

1、指定excel文件运行api服务会报错
2、把data文件夹里的data.cvs删了,然后把excel文件存在data文件夹里,然后运行 python main.py --host xx --port xxx 也会报错
image
3、客户端里点击上传excel文件的图标,没反应,上传不了文件

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.