QueryGPT
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:
- 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.
- Embedding: The text paragraphs are converted into numerical vector representations using OpenAI's embedding models. These vectors capture the semantic meaning of the text.
- Question Embedding: The user's question is also converted into an embedding vector.
- 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.
- Context Retrieval: The paragraphs with the highest similarity scores (typically 3-5) are selected as the context for answering the question.
- 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. - 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?
Prerequisites:
- NodeJS
- Basic Javascript knowledge
- OpenAI API key
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
- Create a NodeJS project:
Configuration:
- Create a
utils/helper.js
file to configure the OpenAI API.
- Create a
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
- Prepare your data by splitting it into small paragraphs and save it in
Generating Responses:
- Run the
completion.js
file with your question:node completion.js
generateCompletion("Who is acting dean of the Faculty of Business Studies");
- Run the
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"

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.

EnergeticAI is TensorFlow.js optimized for serverless functions, offering fast cold-start, small module size, and pre-trained models, making AI accessible in Node.js apps up to 67x faster.

Jarvis AI is an AI copilot chatbot that integrates ChatGPT, Claude, and Gemini. Translate, check grammar, rewrite, and automate tasks with one tool. Free Chrome extension, desktop, and mobile apps available.

Free Google Gemini AI ChatBot is an AI Chatbot based on Google Gemini. Use your Google Gemini Api Key, you can use it free. It simulates human conversation and assists with various tasks.

BotPenguin is a FREE AI chatbot maker for website, WhatsApp, Facebook, and Telegram. Build no-code chatbots with live chat and ChatGPT integration to generate leads and automate customer support.

KoalaKonvo is a Telegram bot powered by OpenAI, offering AI assistance on the go. Enjoy code execution, web browsing, image recognition, and more, all via Telegram with your own API key—no subscriptions needed.

Crafted by firefighters for firefighters, FirePrep.chat uses advanced AI to deliver efficient training for first responders. Access essential resources and simulations anytime, anywhere, to boost skills and readiness. Prepare for exams, recertification, and advanced training. Pro Level members can upload materials to create custom quizzes with unlimited credits.

Text Assistant is an AI-powered app that lets you create and reuse custom prompts for generating targeted text outputs, like sales pitches or blog posts. Connect directly to OpenAI for cost-effective use, with features for easy sharing and Safari integration.

AI Actions enhances Apple's Shortcuts app with powerful AI integrations like GPT-4o, Claude, and DALL·E, using your own API keys for secure, customizable automation on iOS and macOS.

Discover Auto Streamer, an AI-powered app for creating and live streaming educational courses in 50+ languages. Build customizable websites with audio narration, flexible lengths, and dark/light modes. Ideal for teachers, students, and EdTech innovators using OpenAI API.

ThinkBoxAI is an affordable and easy-to-use AI desktop client for Mac, Windows, and Linux. Unlock the full potential of AI using your own OpenAI API key. Features include a prompt library and AI image generation.

Xpolyglot by FiveSheep is a macOS app that uses AI to streamline Xcode project localization, making app store submissions easier and opening your app to global markets. It integrates seamlessly with Xcode, localizes strings with AI (OpenAI API key required), and manages app store metadata.

ChatGOT is a free AI chatbot assistant integrating AI models like GPT-4, Claude 3.5, Gemini 2.0. Enhance your writing, coding, summarizing, and more. Instant answers, PDF parsing, PPT generation, and image creation, all in one place.

Dante AI offers free AI agents for websites, including chatbots and voice calls, integrating with 7,000+ apps like WhatsApp and Shopify. Setup in 60 seconds without coding, handling 95% of customer service and transferring to live agents for seamless support.

GhostWryter is an AI-powered writing assistant for Google Docs, leveraging OpenAI GPT models to generate SEO texts, blog posts, and marketing content at low cost. Generate thousands of words for just $1 and streamline your writing process efficiently.