# QueryGPT

> QueryGPT is an open-source AI tool for document search. Node.js sample that answers questions over your own text files using OpenAI embeddings. It is available on CLI, API and self-hosted.

- **Kind:** Tool
- **Pricing:** Open source
- **Platforms:** CLI, API, self-hosted
- **Website:** https://github.com/tsensei/QueryGPT
- **Repository:** https://github.com/tsensei/querygpt
- **Categories:** document search, chatbot, generative art, developer tools
- **Listing updated:** 2026-11-18

## About

The README walks through a small Node.js project that splits a plain text file into paragraphs, embeds each one with an OpenAI embedding model, and stores the vectors locally. When a question arrives, it is embedded the same way, paragraphs are ranked by dot-product similarity, and the top few are passed to a completion model as context.

The author sets it up with the openai and dotenv packages and an API key in a .env file. The example uses a Wikipedia article on the University of Dhaka as source data, and the README notes that no fine-tuning or JSON conversion is needed because plain text files work directly.

The project suits developers who want a hands-on tutorial for retrieval-style question answering over documentation or business data. The README describes it as a learning project inspired by trainmy.ai rather than a packaged product.

## Features

- **Paragraph embedding pipeline:** Splits source text into paragraphs and stores each one with its embedding vector in a local file.
- **Similarity-based context selection:** Ranks stored paragraphs against the embedded question using dot-product scores and keeps the top few.
- **Two prompt modes:** Offers one prompt that allows the model's own knowledge and one that restricts answers to the supplied context.
- **Plain text input:** Works with ordinary text files without converting them to JSON or JSONL.

## Good for

- Building a question-answering prototype over internal documentation
- Learning how embeddings and retrieval feed a completion model
- Querying a set of scientific papers or product data in plain text

## FAQ

### Does it require Python?

No. The README says the project is written in Node.js and JavaScript and does not require Python knowledge.

### What input format does it accept?

The README states that plain text files work directly and do not need to be converted to JSON or JSONL.

### Which model does the example use for completion?

The README mentions text-davinci-003 as an example completion model.

### Is QueryGPT free?

Yes. QueryGPT is open source, so you can use and self-host it for free.

### What are the best alternatives to QueryGPT?

The closest alternatives to QueryGPT are BlueWillow, Midjourney, Humata, ChatDOC and RoomGPT.

## Where this comes from

- Description: written from the project's README and the project's website.

## Alternatives

- [BlueWillow](https://ai-powered.com/tools/bluewillow): BlueWillow is a freemium AI tool for generative art.
- [Midjourney](https://ai-powered.com/tools/midjourney): Midjourney is a freemium AI tool for generative art.
- [Humata](https://ai-powered.com/tools/humata): Humata is a freemium AI tool for chat.
- [ChatDOC](https://ai-powered.com/tools/chatdoc): ChatDOC is a freemium AI tool for productivity.
- [RoomGPT](https://ai-powered.com/tools/roomgpt): RoomGPT is a freemium AI tool for generative art.
- [Godmode](https://ai-powered.com/tools/godmode): Godmode is an AI tool for chat.
- [Maze](https://ai-powered.com/tools/maze): Maze is a freemium AI tool for generative art.
- [InstantArt](https://ai-powered.com/tools/instantart): InstantArt is a free AI tool for generative art.

---
Source: https://ai-powered.com/tools/querygpt
