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.
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.
This project was built with:
- LlamaIndex
- Weaviate
- Openrouter.ai
- Huggingface
- 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
andcross-encoder/ms-marco-MiniLM-L-2-v2
- Mismatch in encoding training between the use of
- 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
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 |
Both of the following were qualitiatively selected for a balance of processing time and data source size
chunk_size
: 512chunk_overlap
: 20
docker-compose build
docker-compose up
The chatbot will be served at localhost:3000
The pdfs and api will be served at localhost:8000
- 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, theLlamaIndex
integration has an issue with it's chat template.