This project is an implementation of a Retrieval-Augmented Generation (RAG) system designed to process and retrieve relevant information from internal company documents, specifically earnings reports. The system leverages OpenAI's GPT-4o Vision model for semantic chunking and embedding generation, and ZillizDB (Milvus) for vector storage and retrieval.
- Embedder:
text-embedding-3-large
- Model: GPT-4o Vision
- Chunking Method: Semantic Chunking by paragraph/section/table
- Distance Metric: Euclidean Distance (L2)
- Index Type: IVF_FLAT
- Metadata Filters: Company name, Document type, Date (TODO)
- Python 3.8 or later
- pip (Python package installer)
- Git
-
Clone the repository:
git clone https://github.com/your-username/internal-document-rag-system.git cd internal-document-rag-system
-
Set up virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required Python packages:
pip install -r requirements.txt
-
API Keys and ZillizDB Credentials:
Update the
api_key
andzilliz_credentials
variables in the main script with your OpenAI and ZillizDB credentials. -
Folder Path:
Set the
folder_path
variable to the directory containing your PDF documents.
-
Querying:
query = "give me a breakdown of revenues from each quarter from 2021 that is available and please put it into tables for me" response = run_query_pipeline(query) print("LLM Response:") print(response)
openai
numpy
pymupdf
pymilvus