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

QueryGPT

3.5 | 15 | 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"

YouTube-to-Chatbot
No Image Available
106 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
EnergeticAI
No Image Available
253 0

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.

serverless AI
node.js
tensorflow.js
Jarvis AI
No Image Available
263 0

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.

AI chatbot
multi-agent
automation
Free Google Gemini AI ChatBot
No Image Available
260 0

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.

AI Chat
Gemini AI
Chatbot
BotPenguin
No Image Available
556 0

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.

chatbot
AI chatbot
chatbot builder
KoalaKonvo
No Image Available
72 0

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.

Telegram bot
code execution
FirePrep.chat
No Image Available
89 0

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.

firefighter exam prep
Text Assistant
No Image Available
93 0

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.

custom prompts
text generation
AI Actions
No Image Available
102 0

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.

Shortcuts integration
AI API actions
Auto Streamer
No Image Available
88 0

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.

course generation
ThinkBoxAI
No Image Available
226 0

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.

AI desktop app
ChatGPT client
Xpolyglot
No Image Available
283 0

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.

Xcode localization
AI translation
ChatGOT
No Image Available
307 0

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.

AI chatbot
PDF analysis
Dante AI
No Image Available
97 0

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.

conversational AI
GhostWryter
No Image Available
68 0

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.

SEO content generation