This project provides a simple RAG (Retrieval-Augmented Generation) pipeline.
It takes a document from the files directory, splits it into chunks, and generates embeddings for each chunk using an external embedding service (for example, the fab-codes/embedding-service).
The embeddings are then stored in a vector database, allowing semantic search or retrieval over the document contents.
In the project root, run:
docker-compose up --build -dThis will build and start the service together with its dependencies.
-
Set the document path in the
.envfile (for example,PDF_FILE_PATH=files/mydocument.pdf). -
Open a shell inside the container and go to the
appdirectory:docker exec -it documents-rag bash cd app
-
Run the main script:
python -m src.main
Main variables to configure in .env:
PDF_FILE_PATH→ path to the file you want to process inside thefiles/directory.EMBEDDING_SERVICE_URL→ URL of the external embedding service (default:http://embedding-service:8000).QDRANT_URL,QDRANT_API_KEY,QDRANT_COLLECTION→ connection details for the vector database.
- Load a document (just PDF in this moment) from the
filesfolder. - Split the document into smaller text chunks.
- Call the external embedding service to generate embeddings for each chunk.
- Store the embeddings in Qdrant.
- Enable retrieval and semantic search over the indexed document.