BaoGPT is an AI project that allows you to ask questions about youtube videos.
In the case, the target youtube video is Let's build the GPT Tokenizer from Andrej Karpathy.
- In the pipeline, a input question will be routed to the proper branch, greeting-like or query & answer(QA).
- When comes to QA, the LLM will do query analysis: extracted attributes as filters and the question will be optimised and rewriten for better vector retrieving in the vector DB.
- The filter conditions and optimised question will be passed to the retriever chain and get some top-k candidates for grading.
- The grader chain will take the question and documents as the grader input and output the final relative documents
- The LLM will do the summarisation based on the reraking output and provide the answer and attach the sources to the user.
Before running below cmd, make sure you have figured out the settings in settings.yaml based on your real scenarios.
# validated on python 3.11.4
# create vitual env
python3 -m venv .venv
source venv/bin/activate
pip install -Urq requirements.txt
# Note that below steps take Youtube: https://www.youtube.com/watch?v=zduSFxRajkE as example.
python -m bao.components.crawler.youtube_transcript.crawl -v "https://www.youtube.com/watch?v=zduSFxRajkE"
python -m bao.components.injest.injest --injest
python -m bao