A modular Retrieval-Augmented Generation (RAG) system built with LangChain, HuggingFace, and FAISS.
This chatbot ingests documents, stores them in a vector database, retrieves the most relevant chunks, and generates context-aware answers.
- Document ingestion pipeline (load, split, embed, store)
- FAISS vector store for efficient similarity search
- Retriever module to fetch relevant chunks
- Generator module powered by HuggingFace models (e.g.,
flan-t5-base) - Interactive CLI chatbot with persistent FAISS index
- Modular design for easy extension and scaling
rag-chatbot/
│
├── ingestion/
│ ├── loader.py # Load documents
│ ├── splitter.py # Split into chunks
│ ├── embedder.py # Embedding manager
│ └── vector_store.py # FAISS vector store wrapper
│
├── rag/
│ ├── retriever.py # Retrieve chunks & build prompt
│ └── generator.py # Generate answers with HuggingFace
│
├── data/ # Sample documents
├── main.py # Entry point (chatbot loop)
├── requirements.txt # Dependencies
├── test_rag.py # Quick validation script
└── README.md # Project overview
Clone the repo and install dependencies:
git clone https://github.com/<your-username>/rag-chatbot.git
cd rag-chatbot
pip install -r requirements.txt- Place your documents in the
data/folder. - Run the chatbot:
python main.py
- Ask questions interactively:
Hi how may I help you? : What is retrieval-augmented generation?
Type <quit> to exit.
Query:
What is FAISS used for?
Response:
FAISS (Facebook AI Similarity Search) is a library for efficient similarity search and clustering of dense vectors. In this RAG pipeline, it stores embeddings of document chunks and retrieves the most relevant ones for a given query.
- Add a short terminal screenshot or GIF here
- (Optional) Record a 1–2 min demo video and link it
- Web UI with Gradio/Streamlit
- Support for larger context models
- Evaluation metrics for retrieval quality
- Dockerized deployment
- LangChain – orchestration
- HuggingFace Transformers – embeddings & generation
- FAISS – vector similarity search
- Python 3.13
To prove this works, run:
python test_rag.pyThis script will:
- Ingest sample data
- Run a few queries
- Print responses
Built by Amin — passionate about AI, NLP, and building intelligent systems.
Connect with me on LinkedIn or check out my other projects on GitHub.