Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.93 KB

File metadata and controls

53 lines (34 loc) · 1.93 KB

DSPy-Multi-Hop-Chain-of-Thought-RAG


The step by step approach is published in Towards Data Science: https://towardsdatascience.com/improving-rag-answer-quality-through-complex-reasoning-2608ec6c2a65

cover

Multi-Hop Chain of Thought with Retrieval-Augmented Generation (RAG)

Overview

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.

Features

  • 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.

Getting Started

Prerequisites

Ensure you have the following installed:

  • Python 3.9+
  • Required Python libraries listed in requirements.txt

Installation

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

Usage

Run the notebook to see the Multi-Hop CoT with RAG in action:

$ jupyter notebook multi_hop_cot_rag_dspy_indexify.ipynb

Contributing

We welcome contributions! Please fork the repository and submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the Apache License. See the LICENSE file for details.