List your AI tool on AI Orion for free. Submit a tool

QueryGPT

QnA with NodeJS & OpenAI GPT models on Personal / Business data using Embeddings and Completion

About QueryGPT

QueryGPT is a Node.js example project that builds a chatbot answering questions from a personal or business knowledge base using OpenAI's GPT models. It combines embeddings and a completion model so the chatbot can answer based on documents a developer supplies rather than only the model's general training data. It is aimed at developers with basic Node.js and JavaScript knowledge.

A developer saves source text as plain paragraphs and runs an embedding script that sends the data to OpenAI and stores each paragraph alongside its vector representation. To answer a question, the question is embedded the same way, then its vector is compared against every stored paragraph using a dot product; the most similar paragraphs are passed to a completion model.

QueryGPT can run completion with one of two prompt styles: answering purely from the supplied context, replying "I dont know" if the answer is not present, or supplementing the context with the model's own general knowledge when needed. It works directly with plain text source files, with no need to convert them into JSON or JSONL first.

QueryGPT requires a Node.js project with the openai and dotenv packages installed and an OpenAI API key. It does not require Python, even though most official OpenAI code examples are written in Python. The project credits its approach to an earlier example by community member @gidgreen.

Use cases

  • Building an assistant for technical documentation or scientific papers
  • Answering questions strictly from provided data instead of the model's own knowledge

Key features

  • Answers questions from a custom knowledge base using OpenAI embeddings
  • Works with plain text files, no JSON conversion needed
  • Embeds source data into vector representations for similarity search
  • Scores paragraph similarity using the dot product of embedding vectors
  • Sends the top-matching paragraphs to a completion model to generate an answer
  • Supports a strict mode that only answers from provided data

Pros and cons

Pros

Works directly with plain text files without converting to JSON
Requires no Python knowledge despite most OpenAI examples being in Python

Reviews

No reviews yet. Used QueryGPT? Be the first to review it.Log in to review

Alternatives to QueryGPT

More in AI Chat Generator

Comparing tools