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