Giter Club home page Giter Club logo

markdown-langchain-rag's Introduction

LangChain Markdown RAG

This project implements a Retrieval-Augmented Generation (RAG) system using the LangChain library. It is designed to work with documents in Markdown format, allowing querying and obtaining relevant information from a collection of documents.

Prerequisites

Make sure you have Python version 3.10.10 installed on your system. Also, you will need pip to install dependencies.

Installation

To begin, clone this repository on your local system using the following command:

git clone https://github.com/yourusername/langchain-markdown-rag.git

Change to project directory:

cd langchain-markdown-rag

Create a Python virtual environment and activate it:

python3 -m venv venv
source venv/bin/activate  # On Windows use  `venv\Scripts\activate`

Once the virtual environment is activated, install the project dependencies:

pip install -r requirements.txt

Configuration

Before running the application, you must configure the environment variables:

  • Copy the file .env.example into .env:
cp .env.example .env

Open the .env file and enter your OpenAI API keys.

  • Insert your markdown files in the project's markdown_folder directory. Make sure that all markdown files you wish to analyse are present in this directory before proceeding.

  • Edit the main.py file to include the specific questions you wish to ask the system. You will find a designated area in the file where you can enter or edit questions.

Running

After setting up the environment, you can run the project with:

 python main.py

Project Structure

  • main.py: The main input file for running the RAG system.
  • DocumentManager.py: It managed the loading and segmentation of Markdown documents.
  • EmbeddingManager.py: Responsible for the creation and persistence of embeddings.
  • ConversationalRetrievalAgent.py: It manages the conversation-based information retrieval system.

markdown-langchain-rag's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.