How devarsh26/rag-app works
Project Type & Purpose
• This is a full-stack application focused on AI-powered document querying, using a Retrieval-Augmented Generation (RAG) approach.
• The main goal is to reduce document query resolution time by automatically extracting answers from internal documents (PDFs, Word, JSON, XML).
Analyzing the Architectural Components
From the README, break down the overall workflow into these key components:
• Document Ingestion: Documents collected from SharePoint.
• Data Pipeline: Uses Kafka and PySpark to stream and process both structured and unstructured data.
• Data Storage: Files are stored in SQLite (and note there is mention of Databricks as well).
• Processing Pipeline:
– Chunking: Uses LangChain’s SemanticChunker to break text into smaller parts.
– Embedding: Using HuggingFace’s sentence-transformer (MiniLM) for generating embeddings.
– Vector Storage: The embedding vectors are stored in a FAISS index (and also SQLite is mentioned for storage).
• Query Engine:
– Retrieves relevant context from the vector database based on semantic similarity.
– A locally run Mistral LLM (accessed via Ollama) generates answers using the provided context combined with the query.
• User Interface:
– A Streamlit-based UI provides the front-end for employee interaction.
Putting It All Together
• Branch this into storage components: one path for raw files in SQLite/Databricks and a parallel path for processing that goes to “Chunking & Embedding” with LangChain and HuggingFace MiniLM.
• Continue by depicting the “Query Module” which queries the vector DB for relevant context.
• Direct the output of the query module into the “Mistral LLM (via Ollama)” block, showing the generation of answers.