Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 RAGVerse (Local RAG Assistant)

A clean and modular Retrieval-Augmented Generation (RAG) application built using Streamlit, FAISS, SentenceTransformers, and Ollama that allows users to chat with documents and interview datasets using a local LLM.


🚀 Features

  • Upload and chat with documents (PDF, TXT, CSV)
  • FAISS-based semantic search engine
  • SentenceTransformers embeddings (MiniLM)
  • Local LLM support via Ollama (TinyLlama)
  • Multi-session persistent chat history
  • Interview preparation dataset integration
  • Incremental indexing
  • Source-based filtering
  • Automatic dataset download from HuggingFace
  • Clean Streamlit UI

🏗️ Project Structure

rag_application/
├── app.py
├── requirements.txt
├── README.md
├── download_dataset.py
├── src/
│   ├── __init__.py
│   ├── data_loader.py
│   ├── embedding.py
│   ├── vectorstore.py
│   ├── search.py
│   ├── rag_chain.py
│   ├── session_manager.py
│   └── ui.py
├── data/
│   └── interview_dataset.csv
├── uploads/
│   └── test1.pdf
└── vector_db/


🧠 UML Diagrams

1️⃣ Class Diagram

classDiagram
    class App {
      +Streamlit UI
      +chat_input()
      +display_messages()
    }

    class SearchService {
      +search(query)
      +add_document(text, metadata)
      +save_index()
    }

    class VectorStore {
      +FAISS Index
      +add_vectors()
      +search_vectors()
    }

    class ChatStore {
      +create_chat()
      +save_chat()
      +load_chat()
      +delete_chat()
      +list_chats()
    }

    class RAGChain {
      +build_context()
      +generate_answer()
    }

    App --> SearchService : Uses for retrieval
    App --> ChatStore : Manages history
    SearchService --> VectorStore : Queries vectors
    SearchService --> RAGChain : Passes context
    RAGChain --> VectorStore : Reads documents

Loading

2️⃣ Full Architecture Sequence Diagram

sequenceDiagram
    autonumber
    actor User
    participant Streamlit UI as Streamlit UI
    participant SearchService as SearchService
    participant VectorStore as VectorStore
    participant RAGChain as RAGChain
    participant Ollama LLM as Ollama LLM
    participant UI as UI

    User->>Streamlit UI: Ask Question
    Streamlit UI->>SearchService: Send Query
    SearchService->>VectorStore: Similarity Search
    VectorStore-->>SearchService: Top Documents
    SearchService->>RAGChain: Build Context
    RAGChain->>Ollama LLM: Generate Answer
    Ollama LLM-->>RAGChain: Response
    RAGChain-->>UI: Final Answer
    UI-->>User: Display Result

Loading

3️⃣ High-Level Chat System Flow

sequenceDiagram
    actor User
    User->>Streamlit UI: Ask Question
    Streamlit UI->>Session Manager: Store History
    Streamlit UI->>Search Engine: Retrieve Context
    Search Engine->>RAG Chain: Format Prompt
    RAG Chain->>Ollama LLM: Request Token Generation
    Ollama LLM-->>Streamlit UI: Stream Response Text

Loading

🧠 System Architecture (RAG Pipeline)

User Query → Streamlit UI → SentenceTransformer Embedding → FAISS Search → Relevant Docs → Context Builder → Ollama LLM → Answer


📊 Data Flow

User Upload → Data Loader → Text Split → Embedding → FAISS DB → Search → Response


💬 Chat System Flow

User Input → Session Manager → Store History → Retrieve Context → RAG Chain → LLM → Response


📊 Interview Dataset

  • Auto downloaded from HuggingFace: juasdexter/interview_questions
  • Used for:
  • Interview practice
  • Question similarity search
  • Topic preparation

⚙️ Setup Instructions

1. Create folders

New-Item -ItemType Directory -Path data, uploads, vector_db -Force

2. Create virtual environment

python -m venv .venv

3. Activate environment

.\.venv\Scripts\Activate.ps1

4. Install dependencies

pip install --upgrade pip
pip install -r requirements.txt

5. Install Ollama

Download the desktop client from https://ollama.com

Run your local model companion:

ollama run tinyllama

6. Run app

streamlit run app.py

🧹 Cleanup

To safely reset your vector store states, clear local python caching, or wipe running instances, run:

Remove-Item -Recurse -Force __pycache__ -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force src\__pycache__ -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force vector_db -ErrorAction SilentlyContinue

🧠 Tech Stack

  • SentenceTransformers (all-MiniLM-L6-v2)
  • FAISS Vector DB
  • Ollama LLM (TinyLlama/Mistral)
  • Streamlit UI
  • Python Backend

⚠️ Note

  • First run downloads embedding model parameters automatically.
  • Ollama must be installed and running in the background separately.
  • Works best on systems with enough RAM (allocate at least 4-8 GB free system memory).

🏆 RAGVerse

RAGVerse is a RAG-based chatbot that lets users upload documents and interview question datasets and ask context-aware questions using vector search and a local LLM for interview preparation.

About

AI chatbot built using LangChain and Python with conversational memory and Streamlit UI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages