This project provides a complete pipeline for extracting text from various document formats (PDF, Word, Images), chunking it, generating embeddings, and storing them in a Vector Database. It is designed to support document-based Retrieval-Augmented Generation (RAG) systems.
Start β Begin the document ingestion process.
Send Raw Documents β Upload raw documents such as PDFs, Word docs, or images.
Text Extractor β Extract text from different file types using specialized parsers:
pdf_text_extractor.pyimage_text_extractor.py (OCR)Splitter β Break extracted text into smaller chunks using a customizable splitter strategy.
Parallel Chunk Processing β Process chunks in parallel using threads.
Embedding Model β Convert each chunk into an embedding vector using a pre-trained model.
Vector Database β Store the resulting embeddings in a vector store for fast retrieval.
.
βββ docker-compose.yaml
βββ Dockerfile
βββ examples
βΒ Β βββ image.png
βΒ Β βββ volume_tracing.pdf
βββ LICENSE
βββ main.py
βββ Makefile
βββ mypy.ini
βββ README.md
βββ requirements.txt
βββ src
βββ config
βΒ Β βββ __init__.py
βββ database
βΒ Β βββ __init__.py
βΒ Β βββ dto
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ base_dto.py
βΒ Β βΒ Β βββ embedding_dto.py
βΒ Β βββ models
βΒ Β βββ __init__.py
βΒ Β βββ base.py
βΒ Β βββ embedding.py
βββ entities
βΒ Β βββ embedding.py
βββ machine_learning_models
βΒ Β βββ __init__.py
βΒ Β βββ factory
βΒ Β βΒ Β βββ __init__.py
βΒ Β βββ strategies
βΒ Β βββ __init__.py
βΒ Β βββ embedding_strategy.py
βΒ Β βββ hugging_face_strategy.py
βΒ Β βββ torch_vision_strategy.py
βββ repositories
βΒ Β βββ __init__.py
βΒ Β βββ base_repository.py
βΒ Β βββ base_unit_of_work.py
βΒ Β βββ embedding_repository.py
βΒ Β βββ unit_of_work.py
βββ services
βΒ Β βββ embedding_service
βΒ Β βΒ Β βββ embedding_service.py
βΒ Β βββ preprocessing
βΒ Β βΒ Β βββ image.py
βΒ Β βββ text_extractor
βΒ Β βββ __init__.py
βΒ Β βββ image_text_extractor.py
βΒ Β βββ pdf_text_extractor.py
βββ utils
βββ __init__.py
βββ parser.py
# Clone the repo
git clone git@github.com:JoaoGabrielSC/rag-vectordb.git
cd RAG
# (Optional) Create a virtual environment (using pyenv)
pyenv virtualenv 3.12.9 rag
pyenv activate rag
pyenv local rag
# Install dependencies
pip install -r requirements.txt
23 commits
Python
96.4%
Makefile
3.6%
This project provides a complete pipeline for extracting text from various document formats (PDF, Word, Images), chunking it, generating embeddings, and storing them in a Vector Database. It is designed to support document-based Retrieval-Augmented Generation (RAG) systems.
Start β Begin the document ingestion process.
Send Raw Documents β Upload raw documents such as PDFs, Word docs, or images.
Text Extractor β Extract text from different file types using specialized parsers:
pdf_text_extractor.pyimage_text_extractor.py (OCR)Splitter β Break extracted text into smaller chunks using a customizable splitter strategy.
Parallel Chunk Processing β Process chunks in parallel using threads.
Embedding Model β Convert each chunk into an embedding vector using a pre-trained model.
Vector Database β Store the resulting embeddings in a vector store for fast retrieval.
.
βββ docker-compose.yaml
βββ Dockerfile
βββ examples
βΒ Β βββ image.png
βΒ Β βββ volume_tracing.pdf
βββ LICENSE
βββ main.py
βββ Makefile
βββ mypy.ini
βββ README.md
βββ requirements.txt
βββ src
βββ config
βΒ Β βββ __init__.py
βββ database
βΒ Β βββ __init__.py
βΒ Β βββ dto
βΒ Β βΒ Β βββ __init__.py
βΒ Β βΒ Β βββ base_dto.py
βΒ Β βΒ Β βββ embedding_dto.py
βΒ Β βββ models
βΒ Β βββ __init__.py
βΒ Β βββ base.py
βΒ Β βββ embedding.py
βββ entities
βΒ Β βββ embedding.py
βββ machine_learning_models
βΒ Β βββ __init__.py
βΒ Β βββ factory
βΒ Β βΒ Β βββ __init__.py
βΒ Β βββ strategies
βΒ Β βββ __init__.py
βΒ Β βββ embedding_strategy.py
βΒ Β βββ hugging_face_strategy.py
βΒ Β βββ torch_vision_strategy.py
βββ repositories
βΒ Β βββ __init__.py
βΒ Β βββ base_repository.py
βΒ Β βββ base_unit_of_work.py
βΒ Β βββ embedding_repository.py
βΒ Β βββ unit_of_work.py
βββ services
βΒ Β βββ embedding_service
βΒ Β βΒ Β βββ embedding_service.py
βΒ Β βββ preprocessing
βΒ Β βΒ Β βββ image.py
βΒ Β βββ text_extractor
βΒ Β βββ __init__.py
βΒ Β βββ image_text_extractor.py
βΒ Β βββ pdf_text_extractor.py
βββ utils
βββ __init__.py
βββ parser.py
# Clone the repo
git clone git@github.com:JoaoGabrielSC/rag-vectordb.git
cd RAG
# (Optional) Create a virtual environment (using pyenv)
pyenv virtualenv 3.12.9 rag
pyenv activate rag
pyenv local rag
# Install dependencies
pip install -r requirements.txt
23 commits
Python
96.4%
Makefile
3.6%