Giter VIP home page Giter VIP logo

ymd-rag's Introduction

Yongmudo (UC Berkeley Martial Arts Program) - Retrieval-Augmented Generation Chatbot

Yongmudo is a martial art taught at UC Berkeley and is part of the UC Martial Arts Program (UCMAP). Black belt candidates as part of UCMAP submit academic martial arts papers to help deepen theirs and the the community's understanding of martial arts.

Datasources

The collection of academic papers have been largely consolidated by Randy Vogel, the editor of the Monograph. This is a published work which compiles select papers for that edition. Currently the 10th edition is in progress.

This project takes in that semi-structured collection of documents and converts them to pdfs for processing.

Architecture & Tech Stack

This project was built with:

  • LlamaIndex
  • Weaviate
  • Openrouter.ai
  • Huggingface

Retrieval-Augmented Generation (RAG) Strategies

  • Hybrid search (enabled via Weaviate) showed a clear improvement on the standard RAG metrics
  • Using sentence rerank (via llamaindex + huggingface ) showed a negative performance in the RAG metrics. Suspected reasons:
    • Mismatch in encoding training between the use of BAAI/bge-small-en-v1.5 and cross-encoder/ms-marco-MiniLM-L-2-v2

Evaluation Process

  • Use LlamaIndex tools to generate a question and response dataset
  • Create iterations of query engines (seen in evaluate.py) and test against dataset using LlamaIndex framework
  • Run via docker-compose up evaluate

RAG Metrics

Run Correctness Relevancy Faithfulness Semantic Similarity
Default 3.067 0.967 0.267 0.916
Hybrid Search 3.133 0.967 0.433 0.936
Sentence Rerank 3.133 0.967 0.367 0.918

Chunk Size & Overlap

Both of the following were qualitiatively selected for a balance of processing time and data source size

  • chunk_size: 512
  • chunk_overlap: 20

Install & Run

  1. docker-compose build
  2. docker-compose up

The chatbot will be served at localhost:3000

The pdfs and api will be served at localhost:8000

Next Steps & Roadmap

  • Move from chat engine to agent implement web scraper for yongmudo.org as a tool
  • Implement auto merging retrieval for improved performance
  • Add observability via Langfuse for prompt engineering inspection and performance tracking
  • Test with other models, notably Gemma 7B-it. It's tuning for safety and accuracy makes it ideal for this application. At the time of writing, the LlamaIndex integration has an issue with it's chat template.

ymd-rag's People

Contributors

ashisghosh avatar

Watchers

 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.