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.
- 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
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/
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
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
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
User Query → Streamlit UI → SentenceTransformer Embedding → FAISS Search → Relevant Docs → Context Builder → Ollama LLM → Answer
User Upload → Data Loader → Text Split → Embedding → FAISS DB → Search → Response
User Input → Session Manager → Store History → Retrieve Context → RAG Chain → LLM → Response
- Auto downloaded from HuggingFace:
juasdexter/interview_questions - Used for:
- Interview practice
- Question similarity search
- Topic preparation
New-Item -ItemType Directory -Path data, uploads, vector_db -Force
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -r requirements.txt
Download the desktop client from https://ollama.com
Run your local model companion:
ollama run tinyllama
streamlit run app.py
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
- SentenceTransformers (
all-MiniLM-L6-v2) - FAISS Vector DB
- Ollama LLM (TinyLlama/Mistral)
- Streamlit UI
- Python Backend
- 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 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.