Giter Club home page Giter Club logo

siosio-rag's Introduction

siosio-rag

This open-source project demonstrates Retrieval Augmented Generation (RAG) using Large Language Models (LLMs).

Overview

siosio-rag uses the following technologies:

  • Orchestration: LangChain.
  • Embedding Vectorstore: Weaviate.
  • Text Embeddings: FlagEmbedding.
  • LLMs: OpenAI ChatGPT and Google Gemini.
  • Evaluation: Ragas.

Reference: chat-langchain

Getting Started

Prerequisites

  • Python (version 3.10 or higher)
  • PyTorch (version 2.1.2 or higher)

Once you have these dependencies installed, clone this repository and set up the environment:

Installation

Clone the repository

git clone https://github.com/your-username/siosio-rag.git

Install dependencies

pip install -r requirements.txt

Usage

Prepare Data

Run prepare_data.py to preprocess and save the data:

python prepare_data.py --out_path out_directory_path

Build Index for Retrieval

Run build_index.py to convert data into embeddings and build an index:

python build_index.py --input_path data_directory_path --out_path out_directory_path --index_name name_for_index

Perform RAG

Run rag.py to execute RAG:

python rag.py \
    --input_path csv_path \
    --output_path out_directory_path \
    --index_path index_path \
    --index_name index_name \
    --model_name llm_model_name \
    --api_key api_key_for_llm

Evaluation (Optional)

Run evaluate.py to evaluate the RAG results:

python evaluate.py \
    --input_path result_csv_path \
    --output_path out_directory_path \
    --api_key api_key_for_llm

Results

alt text

Note:

  1. Data used in the experiment can be found here.
  2. The results were obtained with Ragas v1.7.
  3. For information about the metrics, please refer to this doc.

License

This project is licensed under the MIT license. Please refer to the LICENSE file for details.

siosio-rag's People

Contributors

ntu-p04922004 avatar

Watchers

Kostas Georgiou avatar  avatar

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.