QueryGPT: NodeJS & OpenAI Chatbot for Personalized Data Q&A

QueryGPT

3.5 | 186 | 0
Type:
Open Source Projects
Last Updated:
2025/10/09
Description:
Build a personalized Q&A chatbot with QueryGPT using NodeJS & OpenAI GPT models. Leverage embeddings & completion for accurate answers from your data.
Share:
Q&A chatbot
NodeJS
OpenAI API
embeddings
knowledge base

Overview of QueryGPT

QueryGPT: Your Personalized Q&A Chatbot with NodeJS & OpenAI

What is QueryGPT?

QueryGPT is an open-source project that allows you to create a question-answering chatbot powered by NodeJS and OpenAI's GPT models. It enables the chatbot to learn from a knowledge base you provide, offering precise answers grounded in your data and OpenAI's training data. This makes it ideal for handling tech documentation, scientific papers, business product data, and more.

How does QueryGPT work?

QueryGPT leverages embeddings and completion models to provide accurate responses. Here's a breakdown of the process:

  1. Data Preparation: The project works seamlessly with text files, eliminating the need for JSON/JSONL conversion. Split your data into smaller paragraphs for optimal embedding.
  2. Embedding: The text paragraphs are converted into numerical vector representations using OpenAI's embedding models. These vectors capture the semantic meaning of the text.
  3. Question Embedding: The user's question is also converted into an embedding vector.
  4. Similarity Search: The system calculates the similarity between the question's embedding vector and the embedding vectors of each paragraph in your knowledge base using a dot product.
  5. Context Retrieval: The paragraphs with the highest similarity scores (typically 3-5) are selected as the context for answering the question.
  6. Completion: The selected paragraphs and the user's question are fed into OpenAI's completion model (e.g., text-davinci-003), along with a carefully crafted prompt.
  7. Response Generation: The completion model generates an answer based on the provided context and its pre-existing knowledge.

Key Features & Benefits:

  • Personalized Knowledge Base: Train your chatbot on your specific data for accurate and relevant answers.
  • No Python Required: Built with NodeJS, eliminating the need for Python knowledge.
  • Text File Support: Works directly with text files, simplifying data input.
  • Embedding-Based Accuracy: Utilizes embeddings for semantic understanding and precise context retrieval.
  • Customizable Prompts: Choose prompts that either prioritize answers from your knowledge base or allow the model to use its own knowledge when necessary.

How to use QueryGPT?

  1. Prerequisites:

    • NodeJS
    • Basic Javascript knowledge
    • OpenAI API key
  2. Setup:

    • Create a NodeJS project: mkdir QueryGPT && cd QueryGPT && npm init -y
    • Install dependencies: npm install @types/node dotenv openai
    • Create necessary folders: mkdir sourceData embeddedData utils
    • Create a .env file and add your OpenAI API key: OPENAI_API_KEY = YOUR_API_KEY
  3. Configuration:

    • Create a utils/helper.js file to configure the OpenAI API.
  4. Embedding Data:

    • Prepare your data by splitting it into small paragraphs and save it in ./embeddedData/sourceData.txt.
    • Run the embedding.js file to generate embeddings: node embedding.js
  5. Generating Responses:

    • Run the completion.js file with your question: node completion.js generateCompletion("Who is acting dean of the Faculty of Business Studies");

Who is QueryGPT for?

QueryGPT is ideal for:

  • Businesses: Create chatbots for product documentation and customer support.
  • Researchers: Build tools for analyzing scientific papers and research data.
  • Educators: Develop interactive learning resources based on course materials.
  • Anyone who wants a personalized AI assistant that learns from their own data.

Why choose QueryGPT?

  • Control over Data: You have complete control over the knowledge base used by the chatbot.
  • Accuracy: Embeddings ensure semantic understanding and precise context retrieval.
  • Customization: Adapt the chatbot to your specific needs with customizable prompts.
  • Open Source: Free to use and modify.

QueryGPT offers a powerful and flexible way to build AI-powered Q&A systems. By combining the power of NodeJS and OpenAI, you can create intelligent chatbots that provide accurate and personalized answers from your own data.

Best Alternative Tools to "QueryGPT"

TemplateAI
No Image Available
308 0

TemplateAI is the leading NextJS template for AI apps, featuring Supabase auth, Stripe payments, OpenAI/Claude integration, and ready-to-use AI components for fast full-stack development.

NextJS boilerplate
Supabase auth
BuildShip
No Image Available
594 1

BuildShip: AI-powered visual builder for workflows, APIs, and automation. Connect AI models, tools, and databases with no-code simplicity.

no-code
workflow
automation
Anakin.ai
No Image Available
315 0

Generate Content, Images, Videos, and Voice; Craft Automated Workflows, Custom AI Apps, and Intelligent Agents. Your exclusive AI app customization workstation.

no-code AI builder
AI app store
Myple
No Image Available
342 0

Deliver production-ready AI applications with Myple. Hassle-free managed safe AI agents and RAG models.

AI platform
AI development
RAG
Idea Link
No Image Available
241 0

Idea Link provides custom AI development and business automation solutions, leveraging a team of in-house AI experts to deliver measurable results in as little as 6 weeks. They offer AI strategy & consulting to deployment.

custom AI development
hachidori
No Image Available
429 0

hachidori is a chatbot development platform that allows you to create communications tailored to your objectives. Over 7,000 chatbots have already been created on hachidori.

chatbot
automation
customer support
Instant Answers
No Image Available
364 0

Instant Answers: Train ChatGPT on your website for instant Q&A. Automate support with customizable AI chatbots and knowledge base.

chatbot builder
AI chatbot
Juji
No Image Available
298 0

Juji enables businesses to build the best cognitive + generative AI agents in the form of a chatbot. Use chatbot templates with pre-built cognitive AI to rapidly set up and deploy website AI chatbots (ai chat widget) for education or healthcare. No coding required.

empathetic AI
cognitive chatbots
Dropchat
No Image Available
369 0

Dropchat is a no-code platform to create custom AI chatbots trained on your PDFs, videos, and web pages. Embed them on your site for instant customer support and escalate complex queries to email or live agents.

custom chatbot builder
no-code AI
CuServly
No Image Available
406 0

CuServly is an AI-powered chatbot that deeply understands your business, supports 95 languages, and handles customer queries instantly. Train it easily with your data to cut support costs by 80% and boost efficiency.

multilingual chatbot
Thinkstack
No Image Available
317 0

Thinkstack is an AI chatbot generator that allows users to create custom AI-powered chatbots without coding. Train your bot on your data, integrate with various tools, and deploy across multiple channels.

AI chatbot
chatbot generator
YouTube-to-Chatbot
No Image Available
393 0

YouTube-to-Chatbot is an open-source Python notebook that trains AI chatbots on entire YouTube channels using OpenAI, LangChain, and Pinecone. Ideal for creators to build engaging conversational agents from video content.

youtube-integration
chatbot-training
StartConvo
No Image Available
332 0

StartConvo lets you build and integrate custom AI chatbots into your website effortlessly. Enhance customer support, automate queries, and boost efficiency with features like multi-language support and analytics.

custom AI chatbot
Embed
No Image Available
436 0

Easily build and share RAG (Retrieval-Augmented Generation) chatbots from PDFs, URLs, and text. Embed them anywhere with an iFrame using Embed.

RAG chatbot
chatbot builder