Repo that shows a few approachable techniques to improving your document retrieval results
See the diagram here to see where some of these fall in the standard RAG process. But most changes that can be made fall into 1 of 3 categories
- Document Indexing/Preparation
- The process of getting documents from your source, chunking, cleaning, parsing for metadata, and really transforming in any way before creating your embedding.
- Document Retrieval
- The process of finding the most similar indexed documents to you query. This is typically where many apps struggle.
- Inference
- After you have already found the document chunks you are intending to reference, this is the process of sending the user query, documents, and any other information to the LLM to generate your answer.
Before running anything in main.ipynb
- Create a python virtual environment
- Run
docker compose upto create our postgres container - Create a
.envfile in the base of this repository that setsCOHERE_API_KEYto be equal to your api key
This uses a snapshot of data pulled from Kaggle with around 15000 movie titles and plots. The data was pulled verbatim, so no cleaning has been done on it, either for quality or appropriateness. If you find data you don't think is appropriate, feel free to remove it!