The step by step approach is published in Towards Data Science: https://towardsdatascience.com/improving-rag-answer-quality-through-complex-reasoning-2608ec6c2a65
This repository demonstrates the integration of Multi-Hop Chain of Thought (CoT) reasoning with Retrieval-Augmented Generation (RAG) using DSPy. The notebook provides a comprehensive workflow for combining these advanced AI techniques to enhance complex problem-solving capabilities.
- Multi-Hop Reasoning: Utilizes chain of thought processes to solve multi-step problems.
- Retrieval-Augmented Generation: Incorporates external knowledge retrieval to support and enhance generation tasks.
- DSPy Integration: Leverages the power of DSPy for managing and executing the pipeline.
- Indexify Integration: Real-time extraction engine and pre-built extraction adapters.
- Gradio UI: Built using a simple chatbot Gradio UI.
Ensure you have the following installed:
- Python 3.9+
- Required Python libraries listed in
requirements.txt
Clone the repository and install the dependencies:
$ git clone https://github.com/sachink1729/DSPy-Multi-Hop-Chain-of-Thought-RAG.git
$ cd DSPy-Multi-Hop-Chain-of-Thought-RAG
$ pip install -r requirements.txt
Run the notebook to see the Multi-Hop CoT with RAG in action:
$ jupyter notebook multi_hop_cot_rag_dspy_indexify.ipynb
We welcome contributions! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the Apache License. See the LICENSE file for details.