RAG Pipelines
Google Colab notebooks that retrieve, ground, and answer from your own documents.
A set of RAG pipelines I built in Google Colab. Each card is a notebook you can open, with a short note on what that pipeline does.
- Python
- LlamaIndex
- OpenAI
- Hugging Face
- Gemini
- Gradio
- BM25
- Llamaindex
- PyMuPDF
- LangChain
- OpenSource Model
We compared three embedding models, MiniLM-L6-v2, BGE-small-en, and E5-small-v2. We generated statistical representations of their responses, ranked the model that gave the top response, and recorded each model's retrieval time.
We used Gemini to generate responses from user input, then tested our chatbot by asking it different questions.
Implemented an industry-standard RAG optimization, including query expansion and rewriting with an integrated hybrid retriever (keyword + vector search) and additional ranking for accurate results. Every result is presented in a table to meet company standards.
I demonstrated how to effectively use a RAG pipeline with a large document. We employed an LLM to classify document types and boundaries. By using key-concept metadata, the LLM can remember the document and execute an efficient RAG pipeline. Group pages into logical documents, chunk them, and assign metadata to each logical document. Then predict query routing and retrieve results with a metadata filter.
I used the LLM and a simple base rule to classify each PDF page, assign a type, and retrieve matching files. Then I created a temporary index from a matching document and queried it for the specific answers you need.
Integrated PDFs with LlamaIndex, then implemented an LLM-based query expansion and a complete end-to-end pipeline. I demonstrated the steps for extracting the best data from a large document using BM25 retrival for keyword matching.
Implemented a new chatbot interface using Gradio.
This RAG configuration uses a retriever with top-k on the specified document vector database, applies a similarity threshold, combines these settings to log the difference, and then runs the RAG.
The RAG pipeline: Extracts text from the document with PyMUdf. Generates embeddings. Performs query expansion and writes the result. Implements HybridRetriever, a hybrid of keyword and vector search. Initializes the large language model (LLM) and embedding models. Executes a rerank call to retrieve the top-k results. This creates a practical live RAG pipeline for most use cases.
Performed OCR on a PDF to obtain the text's bounding box. Extracted the bounding box and used CVT color tools to determine the exact box and the text's location. Executed the OCR action.