Skip to content

Karthik Vishnu - RAG App

Karthik Vishnuvajjala requested to merge submit-rag-chatbot into master

🌌 NebulaRAG+ (Karthik RAG App)

NebulaRAG+ is a high-fidelity, production-grade Retrieval-Augmented Generation (RAG) chatbot designed for deep space mission control telemetry and operations. The app allows users to upload documents (PDF/TXT) or use the pre-built Nebula Space Initiative operations handbook to run semantic queries across local models (Ollama, FLAN-T5) or cloud-based engines (Gemini API) with dynamic English-to-Telugu translation, streaming tokens, and glassmorphic aesthetics.


📸 App Interface Mockup

Below is a preview of the high-fidelity UI design of NebulaRAG+:

NebulaRAG+ Demo Interface


🔍 Deep-Dive Technical Questions

1. What document did you use and why?

For the default knowledge source, we compiled and generated a structured operations document: data/your_document.pdf ("Nebula Space Exploration Initiative: Mission Documentation and Operations Handbook").

Why we chose this:

  • Rich Technical Vocabulary: Contains structured jargon such as Decoherence Mitigation, Rubidium-87 Spin Synchronization, and Magnetoplasmadynamic (MPD) Thruster. This tests the dense embedder's ability to map scientific relationships.
  • Granular Quantities: Includes precise dates (e.g., October 12, 2042), metrics (e.g., 128 kbps, 150,000 km/h), and names (e.g., Dr. Elena Rostova, Geneva Quantum Labs). These precise details are ideal for highlighting RAG's capability to prevent model hallucinations by fetching actual document facts.

2. How does your chunking work?

Our chunking process is managed in utils/loader.py and utilizes LangChain's RecursiveCharacterTextSplitter:

  • Recursive Separators: It processes the text by attempting to split on double newlines \n\n (paragraphs), single newlines \n (lines), spaces (words), and character boundaries "" in descending order. This preserves paragraph and sentence structures as cohesive semantic units.
  • Tuning Parameters:
    • Chunk Size (Default: 800 chars): Large enough to maintain self-sufficient context (approx. 100-150 words) without diluting the semantic signal.
    • Chunk Overlap (Default: 100 chars): Ensures that terms spanning across split boundaries are captured in adjacent chunks, maintaining continuity and avoiding lost information.
    • Note: Both parameters can be adjusted dynamically in the sidebar UI.

3. Which embedding model did you use?

We integrated the sentence-transformers/all-MiniLM-L6-v2 model loaded via langchain_community.embeddings (utils/embedder.py).

Why we selected this model:

  • Speed and Portability: It produces 384-dimensional dense vectors and runs 100% locally on CPU without needing GPU acceleration, ensuring fast index building.
  • Accuracy: Despite being highly compressed (approx. 80MB), it performs exceptionally well on semantic search tasks and provides consistent L2 similarity distances.

How to Run Locally

Prerequisites

  • Python 3.9 - 3.12
  • (Optional) Ollama installed and running locally for offline LLM support.
  • (Optional) A Gemini API Key from Google AI Studio for high-speed cloud execution.

Setup and Start

  1. Navigate to the app folder:
    cd karthik-rag-app
  2. Initialize a Virtual Environment:

bash python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate 3. Install Dependencies:

bash pip install -r requirements.txt 4. Add environment variables (Optional): Create a .env file in the karthik-rag-app/ directory and add your API key:

env GEMINI_API_KEY=your_gemini_api_key_here 5. Launch the Streamlit dashboard:

bash streamlit run app.py

Merge request reports

Loading