RAG with Open Source and Running "Examples"
Congratulations on coming this far! You've already made quite some progress. This module is to make it easy for you to build and run your applications using Examples on the LLM App repository.
It is not specific to the Basic RAG pipeline you saw earlier. But it's pretty much applicable there as well.
What are the Examples offered?
Most popular frameworks/repositories offers multiple possible use cases under its examples
folder to illustrate various possible avenues of impact.
For instance, an interesting example
is self-hosted real-time document AI pipelines with indexing from Google Drive/Sharepoint folders (webpage link).
For building RAG applications that leverage open source models available locally on your machine, understandably you need to refer to the "local" example.
But how can you, as a developer, leverage these resources and run these examples?
Once you've cloned/forked the LLM App repository and set up the environment variables, you're all set to run the examples.
The exact process is listed below the table which shares the types of examples you can explore. Do give it a quick read to know the possibilities of what you can build for your project.
Pick one of the application templates provided that suits you best. You can use it out of the box, or change some steps of the pipeline using YAML configuration files - for example, if you would like to add a new data source, or change a Vector Index into a Hybrid Index, it's just a one-line change.
Application (llm-app pipeline) | Description |
---|---|
Question-Answering RAG App | Basic end-to-end RAG app. A question-answering pipeline that uses the GPT model of choice to provide answers to queries to your documents (PDF, DOCX,...) on a live connected data source (files, Google Drive, Sharepoint,...). |
Live Document Indexing (Vector Store / Retriever) | A real-time document indexing pipeline for RAG that acts as a vector store service. It performs live indexing on your documents (PDF, DOCX,...) from a connected data source. It can be used with any frontend, or integrated as a retriever backend for a Langchain or Llamaindex application |
Multimodal RAG pipeline | Multimodal RAG using MLLM in the parsing stage to index PDFs. It is perfect for extracting information from unstructured financial documents in your folders (including charts and tables), updating results as documents change or new ones arrive. |
Slides AI Search | Multi-modal search service that leverages GPT-4o for PowerPoint and PDF presentations. Content is parsed and enriched with metadata through a slide parsing module powered by GPT-4o, with parsed text and metadata stored in an in-memory indexing system that supports both vector and hybrid indexing. |
Adaptive RAG App | A RAG application using Adaptive RAG, a technique developed by Pathway to reduce token cost in RAG up to 4x while maintaining accuracy. |
Private RAG App with Mistral and Ollama | A fully private (local) version of the demo-question-answering RAG pipeline using Pathway, Mistral, and Ollama. |
Simple Way to Run the Examples on LLM App
Considering you've done the steps before, here's a recommended, step-by-step process to run the examples easily:
- Open a terminal and navigate to the LLM App repository folder:
cd llm-app
- Choose Your Example. The examples are located in the
examples
folder. Say you want to run the 'Private RAG' example. You have two options here:
- Navigate to the specific pipeline folder and run the example directly. This option is more focused and best if you know exactly which example you're interested in:
python examples/pipelines/private-rag/app.py
That's it! 😄
By following these steps, you're not just running code; you're actively engaging with the LLM App’s rich feature set, which can include anything from real-time data syncing to triggering alerts on critical changes in your document store.
It's a step closer to implementing your LLM application that can have a meaningful impact.