← Open Source
raghavan

PdfGptIndexer

RAG based tool for indexing and searching PDF text data using OpenAI API and FAISS (Facebook AI Similarity Search) index, designed for rapid information retrieval and superior search accuracy.

AI EngineeringGive agent knowledgePython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
676
Stars
30
Forks
+-2
This week
1
Contributors
Created 2023-07-07 · Updated 2026-10-13 · #15141 today
Top developers
raghavan

raghavan/PdfGptIndexer is ranked 15,141 with 676 stars.

Same-category comparison

raghavan/PdfGptIndexer is ranked 15,141 among these 8 peers; teilomillet/gollm is ranked 15,142.

Same-category comparison
NameRankMetrics
NVIDIA/soma-retargeter15,124
Language:
Python
Stars:
677
Forks:
102
Description:
SOMA BVH to humanoid robot motion retargeting library built with Newton and NVIDIA Warp.
mrhan1993/Fooocus-API15,134
Language:
Python
Stars:
677
Forks:
182
Description:
FastAPI powered API for Fooocus.
Acly/comfyui-tooling-nodes15,137
Language:
Python
Stars:
676
Forks:
89
Description:
Nodes for using ComfyUI as a backend for external tools. Send and receive images directly without filesystem upload/download.
jmerelnyc/Photo-agents15,139
Language:
Python
Stars:
676
Forks:
23
Description:
Autonomous self-evolving agents. Vision-grounded layered memory and self-written skills for LLM agents that operate your computer.
teilomillet/gollm15,142
Language:
Go
Stars:
676
Forks:
67
Description:
Unified Go interface for Language Model (LLM) providers. Simplifies LLM integration with flexible prompt management and common task functions.
ThinkInAIXYZ/go-mcp15,146
Language:
Go
Stars:
675
Forks:
108
Description:
Go-MCP is a powerful Go(Golang) version of the MCP SDK that implements the Model Context Protocol (MCP) to facilitate seamless communication between external systems and AI applications.
mem-eval-suite/LoCoMo_refined15,157
Language:
Python
Stars:
675
Forks:
10
Description:
LoCoMo Refined: Recalibrating LoCoMo with stricter LLM judging and a cleaned dataset.
HumeAI/hume-evi-next-js-starter15,163
Language:
TypeScript
Stars:
674
Forks:
231
Description:
Quickly get started with EVI and Next.js.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryAI Engineering
SubcategoryGive agent knowledge
KeywordsRAG
Stars676
Forks30
Contributors1
Created date2023-07-07
Updated date2026-10-13
Stars in 1 day0
Stars in 7 days-2
Rank15,141
Previous rank14,967
Rank change-174
7-day stars rank18,460
Previous 7-day stars rank18,391
7-day stars rank change-69
Total stars rank15,285
Previous total stars rank15,259
Total stars rank change-26
CountryUSA
README summary

PdfGptIndexer **PdfGptIndexer was featured at the top of Hacker News! ** Description PdfGptIndexer is an efficient tool for indexing and querying PDF documents using OpenAI embeddings and FAISS (Facebook AI Similarity Search). It implements a RAG (Retrieval Augmented Generation) system that allows you to have intelligent conversations with your PDF documents. The software is designed for rapid information retrieval with superior search accuracy. How It Works PdfGptIndexer consists of two main components: 1. **Indexer** ( ) - One-time PDF Processing The indexer processes

your PDF documents and creates a searchable vector database: 1. **Extract Text**: Uses PyMuPDF to extract text from all PDF files in a folder 2. **Chunk Text**: Splits documents into manageable chunks (1000 characters with 200-character overlap) using LangChain's RecursiveCharacterTextSplitter 3. **Generate Embeddings**: Creates vector embeddings for each chunk using OpenAI's model 4. **Store Locally**: Saves the embeddings in a FAISS index on disk for fast retrieval 2. **Chatbot** ( ) - Interactive Q&A Interface The chatbot provides an intelligent interface

to query your indexed documents: 1. **Load Index**: Loads the pre-computed FAISS vector index from disk 2. **Semantic Search**: Converts your question into an embedding and finds the top 3 most similar document chunks 3. **Display Matches**: Shows you the similarity scores and text snippets from matched documents 4. **Generate Answer**: Uses GPT-4 to synthesize a coherent answer based on the retrieved context Advantages of Storing Embeddings Locally Storing embeddings locally provides several key benefits: 1. **Offline Access

**: After initial creation, query your data without internet access to OpenAI (only the answer generation requires API calls) 3. **Cost Savings**: Compute embeddings once and reuse them, saving on API costs 4. **Scalability**: Makes it feasible to work with large document collections that would be expensive to process in real-time Getting Started Prerequisites Python 3. Installation Clone the repository: Install dependencies: Or install manually: 2. Configuration Create a file in the project root and add your OpenAI API key

: 3. Prepare Your PDFs Place your PDF files in the folder (or any folder of your choice). Usage Step 1: Index Your PDFs Run the indexer to process your PDFs and create the vector database: Or specify a custom PDF folder: Or specify both custom PDF folder and index location: **What happens:** Extracts text from all PDFs in the folder Creates text chunks with metadata Generates embeddings using OpenAI Saves the FAISS index to (or your specified location) **Note:** You

only need to run this once, or when you add new PDFs to your collection. Step 2: Query Your Documents Start the interactive chatbot: Or specify a custom index location:

Frequently asked questions

How many stars and forks are recorded?

raghavan/PdfGptIndexer has 676 stars and 30 forks.

What is the repository rank?

raghavan/PdfGptIndexer is ranked 15,141.

What language and category are recorded?

raghavan/PdfGptIndexer has 676 stars, uses Python and belongs to AI Engineering.

Which repository is closest in rank?

raghavan/PdfGptIndexer is compared with teilomillet/gollm, ranked 15,142 with 676 stars.

README

PdfGptIndexer

PdfGptIndexer was featured at the top of Hacker News!

Description

PdfGptIndexer is an efficient tool for indexing and querying PDF documents using OpenAI embeddings and FAISS (Facebook AI Similarity Search). It implements a RAG (Retrieval Augmented Generation) system that allows you to have intelligent conversations with your PDF documents. The software is designed for rapid information retrieval with superior search accuracy.

How It Works

PdfGptIndexer consists of two main components:

1. Indexer (indexer.py) - One-time PDF Processing

The indexer processes your PDF documents and creates a searchable vector database:

  1. Extract Text: Uses PyMuPDF to extract text from all PDF files in a folder
  2. Chunk Text: Splits documents into manageable chunks (1000 characters with 200-character overlap) using LangChain's RecursiveCharacterTextSplitter
  3. Generate Embeddings: Creates vector embeddings for each chunk using OpenAI's text-embedding-ada-002 model
  4. Store Locally: Saves the embeddings in a FAISS index on disk for fast retrieval

2. Chatbot (chatbot.py) - Interactive Q&A Interface

The chatbot provides an intelligent interface to query your indexed documents:

  1. Load Index: Loads the pre-computed FAISS vector index from disk
  2. Semantic Search: Converts your question into an embedding and finds the top 3 most similar document chunks
  3. Display Matches: Shows you the similarity scores and text snippets from matched documents
  4. Generate Answer: Uses GPT-4 to synthesize a coherent answer based on the retrieved context

Advantages of Storing Embeddings Locally

Storing embeddings locally provides several key benefits:

  1. Speed: Retrieval is significantly faster as embeddings are pre-computed—no need to regenerate them for each query
  2. Offline Access: After initial creation, query your data without internet access to OpenAI (only the answer generation requires API calls)
  3. Cost Savings: Compute embeddings once and reuse them, saving on API costs
  4. Scalability: Makes it feasible to work with large document collections that would be expensive to process in real-time

Getting Started

Prerequisites

  • Python 3.8 or higher
  • OpenAI API key

1. Installation

Clone the repository:

git clone https://github.com/raghavan/PdfGptIndexer.git
cd PdfGptIndexer

Install dependencies:

pip install -r requirements.txt

Or install manually:

pip install langchain langchain-openai langchain-community langchain-text-splitters openai pymupdf faiss-cpu python-dotenv tiktoken

2. Configuration

Create a .env file in the project root and add your OpenAI API key:

OPENAI_API_KEY=your_openai_api_key_here

3. Prepare Your PDFs

Place your PDF files in the pdf/ folder (or any folder of your choice).

Usage

Step 1: Index Your PDFs

Run the indexer to process your PDFs and create the vector database:

python indexer.py

Or specify a custom PDF folder:

python indexer.py /path/to/your/pdfs

Or specify both custom PDF folder and index location:

python indexer.py /path/to/your/pdfs /path/to/save/index

What happens:

  • Extracts text from all PDFs in the folder
  • Creates text chunks with metadata
  • Generates embeddings using OpenAI
  • Saves the FAISS index to faiss_index/ (or your specified location)

Note: You only need to run this once, or when you add new PDFs to your collection.

Step 2: Query Your Documents

Start the interactive chatbot:

python chatbot.py

Or specify a custom index location:

python chatbot.py /path/to/your/index
Nearby in the ranking
Similar items