← all repositories
bhaskatripathi/pdfGPT

Chat with PDFs using KNN, not a vector database

pdfGPT exists to answer questions about PDFs through OpenAI models while deliberately avoiding vector databases, LangChain, and complex indexing in favor of KNN and cached embeddings.

7.2k stars Python RAG · SearchChat Assistants
pdfGPT
Not currently ranked — collecting fresh signals.
star history

What it does pdfGPT is a web application that chunks uploaded PDFs, generates embeddings for each chunk using a Deep Averaging Network Encoder, and retrieves the top matches with K-Nearest Neighbour search to feed into an OpenAI prompt. The goal is to let you ask questions about a document and receive answers that cite page numbers in square brackets. It has been around since 2021, making it an early open-source attempt at what later became known as RAG.

The interesting bit Instead of following the modern playbook—vector database, heavy indexing, dense retrieval servers—the author deliberately keeps the stack minimal: embeddings are computed, saved to disk, and queried with KNN. The author claims this bare-bones approach is why accuracy has held up even as the ecosystem grew fancier.

Key highlights

  • Uses the Universal Sentence Encoder family (Deep Averaging Network) rather than OpenAI embeddings for chunk similarity.
  • Retrieves context with KNN and injects the top chunks into the prompt, citing source page numbers.
  • Supports GPT-4, 16K, and 32K token models alongside legacy text-davinci-003; includes chat history and pre-defined questions.
  • Caches generated embeddings to a file so repeat queries skip recomputation.
  • Provides a Hugging Face demo space for browser-based testing.

Caveats

  • The author notes the documentation is outdated and maintenance time is scarce; the project is actively seeking contributors.
  • Multiple PDF support, OCR, and local LLM backends (Falcon, Llama, etc.) are listed as upcoming, not shipped.
  • Turbo models can return weaker answers when embedding similarity is low; the author recommends falling back to text-davinci-003 or GPT-4.

Verdict Worth a look if you want to study a minimal, pre-hype RAG architecture or need a lightweight PDF Q&A prototype. Skip it if you require production-grade multi-document pipelines, OCR, or fully offline operation.

Frequently asked

What is bhaskatripathi/pdfGPT?
pdfGPT exists to answer questions about PDFs through OpenAI models while deliberately avoiding vector databases, LangChain, and complex indexing in favor of KNN and cached embeddings.
Is pdfGPT open source?
Yes — bhaskatripathi/pdfGPT is open source, released under the MIT license.
What language is pdfGPT written in?
bhaskatripathi/pdfGPT is primarily written in Python.
How popular is pdfGPT?
bhaskatripathi/pdfGPT has 7.2k stars on GitHub.
Where can I find pdfGPT?
bhaskatripathi/pdfGPT is on GitHub at https://github.com/bhaskatripathi/pdfGPT.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.